PDA

View Full Version : [OT][FUN] Indiana BOFH ed i Predatori del CED Perduto


banryu79
15-06-2012, 16:33
Oggi non mi passa un cavolo, la sezione è un mortorio e quindi... e comunque non è spam al 100%, l'anedotto ha un valore didattico in quanto illustra un caso tipico di dipendenza circolare :asd:
---

Sembrava una giornata molto tranquilla, T e' a casa a cercare di sviluppare una applicazione (o meglio, ad adattare una applicazione) per un cliente, H e' ancora in 'recupero' dopo l'esplosione, Bart e' alla co-locazione. Il che sostanzialmente lascia ME... con licenza di cazzeggiare. E cazzeggio e' fino circa alle 11.30, poi arriva Wendy (la nostra segretaria) con il Problema.

W - Ha chiamato SL di $dittafancazzisti, hanno un guaio con un paio di macchine che vennero installate tempo addietro e di cui noi dovremmo occuparci.
IO - Ok, molla il foglio.
W - No, il fatto e' che quelle macchine sono per la LAN del loro ufficio, quindi qualcuno dovrebbe andare la a vedere...

Oh che bello. Cosi' vado a $dittafancazzisti, li' vengo accolto da UL, con l'altisonante titolo di Direttore dell'IT.

UL - ...quindi abbiamo avuto questo problema con l'ups e praticamente tutti i server si sono spenti...
IO - Ok, e perche' non li avete riaccesi?
UL - Non e' cosi' semplice, e' un sistema altamente integrato yada yada, processi concorrenti blah blah, massima ridondanza yada yada...
IO - ?? Come sarebbe a dire??
UL - Mah... il vostro collega H non vi ha spiegato?
IO - H e' momentaneamente in ferie, quindi no, non ha spiegato un tubo. Avete della documentazione su sta cosa?
UL - Ah si, c'e' un manuale...

E mi molla il malloppazzo. Ok, sti rimbamba hanno una manica di server, di cui uno, che sarebbe quello principale e che chiameremo A tanto per capirci, pare che abbia dei file di configurazione che sono su una partizione montata via NFS da un altro server, che chiameremo B, il quale a sua volta ha qualche accrocchio di middelware scoobydoobydo che richiede per avviarsi una autenticazione via server Radius che e' installato sul server C, il quale a sua volta richiede saildiavolocosa su server A...

He...hummmm... 'spetta 'n moment... allora, per avviare server A ti serve il server B, ma per avviare B ti serve C e C dipende da A... oh che bello!

IO - (rivolto ad UL) E chi sarebbe il Torquemada che si e' sognato sta cosa?

Si, perche' bisogna essere Himmler o Hannibal Lecter per mettere in piedi una roba del genere. Comunque, nella documentazione c'e' anche la "procedura per il riavvio del sistema", che e' una roba del genere:

1) Pregare Cthulhu che un asteroide distrugga l'edificio risolvendo il problema per voi (no, ok, questo punto non c'era, l'ho aggiunto io a matita...)
2) Avviare server B in single-user mode
3) Avviare server A in single-user mode
4) Mentre A si avvia e quando raggiunge il punto X, avviare su B il processo tal-de-tali
5) Avviare C in single-user mode
6) Avviare su A il processo tal-de-tali
7) su C fare un ping -c 10 -s 128 verso B
8) su A avviare il processo tal-de-tal-altro

E va avanti cosi' per un bel po'... in sostanza il sistema e' imbrogliare i 3 rottamoni facendogli credere che i vari servizi siano gia' su quando questi non lo sono. Sembra facile eh?

Quello che ancora non ho detto e' che i 3 cosi sono agli estremi opposti della sala macchine di $dittafancazzisti, separati da quello che potrebbe essere solo descritto come un percorso alla Indiana Jones con cavi di rete tesi in mezzo ai corridoi, mattonelle del pavimento pericolanti, racks proni al crollo e CL che sputano freccette avvelenate con le cerbottane (ok, no, quest'ultimo particolare non c'era, ma non mi sarei stupito piu' di tanto)

Ah, ed ovviamente in tutta la sala macchine c'e' UN solo monitor ed UNA sola tastiera.

Ok, indosso il mio cappellino da BOFH, la giacca da moto, faccio schioccare un cavo di rete a mo' di frusta e recupero dagli uffici attinenti 3 tastiere e 3 monitors con relativi cavi di alimentazione, dopo di che procedo a mettere in pratica cio' che dice la documentazione. Al terzo o al quarto tentativo imbrocco il tempo giusto ed i 3 magi sembrano riavviarsi.

Dopo essermi ripreso dall'immane faticata sono arrivato persino a suggerire ad UL di mettere in piedi un sistema diverso, o come minimo a mettere i 3 maledetti nello stesso rack e con un KVM, sono quasi pronto per ripartire.

UL - Ma in effetti stavamo pensando ad un sistema piu' robusto, distribuito su 2 datacenter con un load-balancer geografico e...

Un serpente velenoso! Voglio un serpente velenoso. Anzi no, 2! Che li metto in cluster!

---

(Autore: Davide Bianchi)

DioBrando
16-06-2012, 00:00
Mi ricorda il sistema della doppia chiave nell'inizio di WarGames. Solo che stavolta è in due stanze separate.

Geniale :asd:

banryu79
19-06-2012, 16:37
Ne aggiungo un'altra. Altra fonte.

Social Engineering:

<Cthon98> hey, if you type in your pw, it will show as stars
<Cthon98> ********* see!
<AzureDiamond> hunter2
<AzureDiamond> doesnt look like stars to me
<Cthon98> <AzureDiamond> *******
<Cthon98> thats what I see
<AzureDiamond> oh, really?
<Cthon98> Absolutely
<AzureDiamond> you can go hunter2 my hunter2-ing hunter2
<AzureDiamond> haha, does that look funny to you?
<Cthon98> lol, yes. See, when YOU type hunter2, it shows to us as *******
<AzureDiamond> thats neat, I didnt know IRC did that
<Cthon98> yep, no matter how many times you type hunter2, it will show to us as *******
<AzureDiamond> awesome!
<AzureDiamond> wait, how do you know my pw?
<Cthon98> er, I just copy pasted YOUR ******'s and it appears to YOU as hunter2 cause its your pw
<AzureDiamond> oh, ok.

Un genio :asd:

banryu79
26-06-2012, 17:54
Pare che ci sia in giro gente che non ha ben capito che cosa si intenda per codice 'parlante' o 'autodocumentato':

public bool IsEligibleToSeeThisEvent(EventRegistrationInformation eventRegistrationInformation)
{
if (ThisEventDoesNotRestrictRegistrantsBasedUponActivityType(eventRegistrationInformation))
return TrueBecauseThisEventDoesNotRegistrictBasedUponActivityType();

var activityTypes = GetTheActivityTypesAttachedToThisEvent(eventRegistrationInformation);

if (NoActivityTypesAreAttachedToThisEvent(activityTypes))
return TrueBecauseThereAreNoActivityTypesToFilterOnThisEvent();

if (TheUserIsNotLoggedIn(eventRegistrationInformation))
return FalseBecauseNoActivityTypesAreAvailableForUsersWhoAreNotLoggedIn();

return ThereIsAtLeastOneSharedActivityTypeBetweenTheEventAndCurrentUser(
eventRegistrationInformation,
activityTypes);
}

private static bool TrueBecauseThisEventDoesNotRegistrictBasedUponActivityType()
{
return true;
}

private bool ThisEventDoesNotRestrictRegistrantsBasedUponActivityType(
EventRegistrationInformation eventRegistrationInformation)
{
return eventActivityTypeFilterRetriever
.DoesThisEventHaveARestrictionBasedOnActivityTypes(
eventRegistrationInformation.EventId) == false;
}

private bool ThereIsAtLeastOneSharedActivityTypeBetweenTheEventAndCurrentUser(
EventRegistrationInformation eventRegistrationInformation,
IEnumerable<ActivityType> activityTypes)
{
var currentActivities = registrantActivityRetriever
.GetRegistrantActivityProductCode(eventRegistrationInformation.AccountId);

return activityTypes.Any(x => currentActivities.Any(y => y.Id == x.Id));
}

private static bool FalseBecauseNoActivityTypesAreAvailableForUsersWhoAreNotLoggedIn()
{
return false;
}

private static bool TheUserIsNotLoggedIn(EventRegistrationInformation eventRegistrationInformation)
{
return eventRegistrationInformation.IsLoggedIn == false;
}

private static bool TrueBecauseThereAreNoActivityTypesToFilterOnThisEvent()
{
return true;
}

private static bool NoActivityTypesAreAttachedToThisEvent(IEnumerable<ActivityType> activityTypes)
{
return activityTypes.Any() == false;
}

private IEnumerable<ActivityType> GetTheActivityTypesAttachedToThisEvent(
EventRegistrationInformation eventRegistrationInformation)
{
return eventActivityTypeFilterRetriever.GetAll(eventRegistrationInformation.EventId);
}

:asd:

DioBrando
26-06-2012, 18:51
:eek:

Meno male che sono arrivati i Retina sul mercato, un bel po' di spazio in più per Visual Studio, XCode, Eclipse ecc. :asd:

biffuz
29-06-2012, 00:29
:eek:

Meno male che sono arrivati i Retina sul mercato, un bel po' di spazio in più per Visual Studio, XCode, Eclipse ecc. :asd:
Certo, infatti il MegaDirettore ne comprerà subito uno!

Ai sottoposti toccheranno gli Acer da 1366*768.

Seriamente, ne ho conosciuti alcuni che per la disperazione si sono comprati un monitor di tasca loro...

franksisca
29-06-2012, 09:18
è sempre bello e gratificante vedere che ci sta qualcuno messo peggio di te.

uan curiopsità...ma a voi capita di scrivere codice con commenti "per i posteri"???

l'altro giorno mi sono ritrovato a scriver eun commento che faceva più o meno così:
Se qualcuno si troverà a leggere questo codice...in bocca al lupo. sono 3 giorni che provo a ricostruire come mi sia venuto in mente. L'unica cosa che sò è che funziona!!! se devi modificare attento che ho invertito i nomi di due variabili, quindi attento a quello che fai e in bocca al lupo

riflettendo dopo sul fatto che la variabile potevo semplicemente rinominarla.

P.S.: la variabile ancora non l'ho cambiata

shinya
29-06-2012, 09:47
uan curiopsità...ma a voi capita di scrivere codice con commenti "per i posteri"???
Sì, spesso.
Nei commenti ho: chiesto scusa in anticipo, bestemmiato, inveito contro chi ha deciso di implementare una cosa in un certo modo senza poi doverci mettere le mani, ammesso che la mia soluzione in questo o quel caso faceva cagare, scritto "hic sunt leones", e tanto altro ancora...

Con lo stress mi capita di usare i commenti come un diario. I miei colleghi ci ridono sopra, quindi per ora tutto ok! :D

banryu79
29-06-2012, 10:36
Un'altra (dis)avventura di Davide Bianchi, la posto perchè è da antologia:
---

Dopo un certo numero di cappellate da parte del nostro co-location partner, abbiamo deciso che era il caso di cercare un'altra societa' presso la quale piazzare i nostri server. SL, dimostrando una incredibile rapidita', ha selezionato a tempo di record una societa' di co-locazione che promette faville.

Stabilito pertanto un contratto "di prova", si tratta di installare qualche server e vedere come funziona la cosa. Nel nostro contratto per altro e' specificato che noi vogliamo un rack per intero tutto per noi. Sistemate le cose, telefono al capoccia che promette di essere presso il centro dati all'ora giusta, io lo informo che voglio prima dare un'occhiata al rack e poi installarci i server e che (dato che i server pesucciano), mi portero' dietro due aiutanti. Lui si fa dare i nomi dei due (CB e AD), e mi assicura che e' tutto Ok.

Con i server nel bagagliaio della macchina ed il mio laptop al seguito ci avviamo percio' alla volta del centro dati, e la' giunti ci presentiamo alla Reception. Li' veniamo apostrofati da CL.

CL - Che volete?
IO - (alla faccia della gentilezza) Salve, sono DB di $societa, dobbiamo controllare il nostro rack ed installare i server.
CL - Io non so niente! Non ho ricevuto nessuna e-mail di autorizzazione!
IO - (mostrandogli il fax) Ecco, questa e' l'autorizzazione del vostro boss.
CL - Non mi interessa. Io devo avere una mail di autorizzazione direttamente dalla societa'.
IO - Questo qui' e' un fax dalla vostra societa'!
CL - Non me ne frega niente! Io devo avere una mail da voi che vi autorizza ad entrare!
IO - Una mail? Da me?
CL - Esattamente!
IO - ...Ok...

Tiro fuori il portatile, mi appoggio sul suo banco, attivo il modem GSM... cliccketi-clicckety-mail [email protected]...

-*BING*- You've got mail...

CL - Ecco, adesso va bene...
IO - Ma.... te l'ho mandata da qui!!! Vedi???
CL - Non mi interessa! A me serve una mail...

Gia' le cose mi pare che non vadano troppo bene... guardo CB e AD che sembrano pensarla allo stesso modo. Ok, presentiamo i documenti e ci vengono forniti i tesserini di identificazione. Entriamo quindi e CL ci conduce al Rack... ed io osservo i 3 Dell con le lucine lampeggianti dentro...

CL - Ecco, questo qui' e' il vostro rack.
IO - ??? Hemmm... momento... non puo' essere il nostro rack! Ci sono tre server dentro!
CL - Questo qui' e' il vostro rack! C'e' scritto cosi' sul foglio!
IO - Ma noi abbiamo pagato per un rack vuoto. Questi di chi sono?
CL - (veramente incazzato) Questo qui' e' il vostro rack! E questi sono i vostri Server!
IO - Ma noi non li abbiamo ancora messi dentro i server! Questi non sono nostri!
CL - QUESTO E' IL VOSTRO F@77UT0 RACK E QUESTI SONO I VOSTRI F@77UT1 SERVER! SE NON SIETE CONTENTI NON SONO AFFARI MIEI!!!

A questo punto mi volto a guardare CB e AD...

IO - (rivolto a CB e AD) Voi avete sentito bene che questi sono i NOSTRI server giusto?
CB e AD - Hemmm... herr... si', ha detto proprio cosi'...
IO - (rivolto a CL) Allora... se questi sono nostri possiamo portarceli via giusto?
CL - PIANTATELA DI ROMPERMI I C@GL1@N1! POTETE FARCI QUELLO CHE VI PARE!!!
IO - Potrebbe controllare un'ultima volta che questo sia il NOSTRO Rack? Senza dubbio alcuno??
CL - QUESTO E' IL VOSTRO RACK!!! E' IL VOSTRO F@77U7@ RACK!!!
IO - Ok, allora...

Stacco uno dei server, lo smonto dal rack, lo metto in mano ad AD e (parlando italiano che AD lo capisce benissimo)

IO - (rivolto ad AD) Mettilo in macchina e porta qui' uno dei nostri.
AD - Hemmm.. 'spetta un momento... che hai in mente???
IO - Lo hai sentito no? Questi sono i nostri server!

Smonto tutti e tre ed installo i nostri, CL, molto incazzato, passa il tempo parlando al cellulare, da come cinguettava direi che stava parlando con la fidanzata. Mentre sto finendo di controllare che il tutto funzioni correttamente (con AD e CB piuttosto preouccupati dietro), Luser-Supervisor (LS) arriva al galoppo dalla receptions con un bel colorito da colpo apoplettico imminente...

LS - FEEEEERMIIIIIII!!! CHE CA$$@ STATE FACEEEENDOOOOOOO!!!!!!
IO - (il piu' calmo possibile) Sto' controllando i miei server.
LS - (fissando il rack) QUESTO NON E' IL VOSTRO RACK!!!!!!
IO - Si', lo e'. L'ho chiesto a lui (indicando CL) almeno sei volte. E lui ha confermato almeno 6 volte che questo e' il mio rack. Ed io ho pure due testimoni (indicando AD e CB). Quindi e' il mio rack.
LS - (fissa CL, poi guarda me) QUESTO NON E' IL VOSTRO RACK!!! E DOVE SONO I SERVER CHE ERANO DENTRO?????
IO - (sempre calmissimo) Li abbiamo buttati via.
LS - (arterie pulsanti, occhi fuori dalle orbite...) COOOOOOOOOSAAAAAAA????
IO - Lui (indicando CL) ha detto che erano i nostri server, pertanto li abbiamo eliminati.

A questo punto LS comincia ad ululare in direzione di CL, ed io mi godo la scena di CL il cui colore passa dal rosso al bianco e poi al verde. Non ho capito un gran che di quello che ha detto, ma ho sentito la parola "ontslagen" (licenziato) almeno 3 o 4 volte... poi LS si rivolge a me.

LS - (sull'orlo di un colpo apoplettico) Ditemi che state scherzando e che i server li avete ancora...
IO - Certo che li ho ancora. Non sono mica come lui (indicando CL).
LS - E se dimenticassimo tutta la faccenda e li rimettessimo dentro?
IO - No, non credo proprio... penso che io restero' qui ad aspettare che il legittimo poprietario di quei server venga a vedere che sta succedendo, cosi' potremmo avere una bella discussioncina riguardo il vostro cosiddetto "servizio"... Che ne dice?

Adesso ho una tesserina di plastica nel mio portafogli, che mi consente accesso illimitato, 24 ore su 24, al mio rack. No-question-asked.

banryu79
04-07-2012, 13:03
... riporto alcuni stralci di commenti tratti dai sorgenti di Win2K.
E' ovviamente roba vecchia, ma sempre lollica :)

---

Some dissatisfaction with the compiler is expressed in private\shell\shell32\util.cpp:

// the fucking alpha cpp compiler seems to fuck up the goddam type "LPITEMIDLIST", so to work
// around the fucking peice of shit compiler we pass the last param as an void *instead of a LPITEMIDLIST


Some insight into Microsoft's famous daily build process is given in private\windows\media\avi\verinfo.16\verinfo.h:

* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!IF YOU CHANGE TABS TO SPACES, YOU WILL BE KILLED!!!!!!!
* !!!!!!!!!!!!!!DOING SO FUCKS THE BUILD PROCESS!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


There are also various references to idiots and morons, some external, some within Microsoft. The file private\ntos\rtl\heap.c, which dates from 1989, tells us:

// The specific idiot in this case is Office95, which likes
// to free a random pointer when you start Word95 from a desktop
// shortcut.


The file private\ntos\w32\ntuser\kernel\swp.c from 11-Jul-1991 points at:

* for idiots like MS-Access 2.0 who SetWindowPos( SWP_BOZO
* and blow away themselves on the shell, then lets
* just ignore their plea to be removed from the tray


private\genx\shell\inc\prsht.w:
// we are such morons. Wiz97 underwent a redesign between IE4 and IE5

private\shell\ext\ftp\ftpdrop.cpp:
We have to do this only because Exchange is a moron.

private\shell\shdoc401\unicpp\desktop.cpp:
// We are morons. We changed the IDeskTray interface between IE4

private\shell\browseui\itbar.cpp:
// should be fixed in the apps themselves. Morons!

private\inet\mshtml\src\core\cdbase\baseprop.cxx:
// HACK! HACK! HACK! (MohanB) In order to fix #64710 at this very late

private\inet\mshtml\src\core\cdutil\genutil.cxx:
// HACK HACK HACK. REMOVE THIS ONCE MARLETT IS AROUND

private\inet\mshtml\src\other\moniker\resprot.cxx:
// <HACK>
goto EndHack;
// </HACK>

private\inet\mshtml\src\site\layout\flowlyt.cxx:
// God, I hate this hack ...

private\inet\wininet\urlcache\cachecfg.cxx:
// Dumb hack for back compat. *sigh*

private\inet\wininet\urlcache\filemgr.cxx:
// ACHTUNG!!! this is a special hack for IBM antivirus software

private\ispu\pkitrust\trustui\acuictl.cpp:
// HACK ALERT, believe it or not there is no way to get the height of the current
// HACK ON TOP OF HACK ALERT,

private\ntos\udfs\devctrl.c:
// Add the hack-o-ramma to fix formats.

private\shell\shdoc401\unicpp\sendto.cpp:
// Mondo hackitude-o-rama.

private\ntos\w32\ntcon\server\link.c:
// HUGE, HUGE hack-o-rama to get NTSD started on this process!

private\ntos\w32\ntuser\client\dlgmgr.c:
// HACK OF DEATH:

private\shell\lib\util.cpp:
// TERRIBLE HORRIBLE NO GOOD VERY BAD HACK

private\ntos\w32\ntuser\client\nt6\user.h:
* The magnitude of this hack compares favorably with that of the national debt.

private\shell\ext\tweakui\genthunk.c:
* CallProc32W is insane. It's a variadic function that uses
* the pascal calling convention. (It probably makes more sense
* when you're stoned.)

private\mvdm\wow32\wcntl32.c:
// These undocumented messages are used by Excel 5.0

private\mvdm\wow32\wgdi31.c:
// InquireVisRgn is an undocumented Win 3.1 API. This code has been
// suggested by ChuckWh. If this does not fix the s 2.0
// problem, then ChuckWh would be providing us with an private entry
// point.

private\mvdm\wow32\wgfont.c:
* This thunk implements the undocumented Win3.0 and Win3.1 API
* GetCurLogFont (GDI.411). Symantec QA4.0 uses it.
* To implement this undocumented API we will use the NT undocumented API

private\ntos\w32\ntuser\kernel\mnpopup.c:
// Set the GlobalPopupMenu variable so that EndMenu works for popupmenus so
// that WinWart II people can continue to abuse undocumented functions.

private\windows\shell\accesory\hypertrm\emu\minitel.c:
// Guess what? Latent background color is always adopted for mosaics.
// This is a major undocumented find...

private\windows\shell\accesory\hypertrm\emu\minitelf.c:
// Ah, the life of the undocumented. The documentation says
// that this guys does not validate, colors, act as a delimiter
// and fills with spaces. Wrong. It does validate the color.
// As such its a delimiter. If...

:D

DioBrando
04-07-2012, 13:18
Un mio collega da un altro cliente ha twittato:
Sai che la giornata partirà già storta quando ti chiedono "che differenza c'è tra compila e funziona?"

Non benissimo :asd:

biffuz
04-07-2012, 13:40
Personalmente, una volta stavo cercando di debuggare per l'ennesima volta una funzione da circa 1000 righe, scritta malissimo, con una serie di cicli innestati, senza uno straccio di spiegazione e piena di pezzi di codice commentati in anni e anni di debug, quando con una illuminazione divina ho capito a cosa serviva.
L'ho commentata tutta, ci ho scritto sopra "CHI E' QUELL'IDIOTA CHE SI E' INVENTATO QUESTA ROBA???" e l'ho sostituita con una nuova funzione da circa 50 righe che faceva la stessa cosa in tempo O(logn), che ho scritto nella spiegazione.

Il mio capo si è complimentato per la nuova funzione, ha esclamato "wow, non pensavo che quella roba di O(logn) si potesse usare davvero", però ha dovuto rimettere quella vecchia: "non ci pagano per scrivere nuove funzioni... e poi non sta bene dare dell'idiota al cliente" :D

shinya
04-07-2012, 14:14
http://www.vidarholen.net/contents/wordcount/graph.png

banryu79
04-07-2012, 14:18
@shinya: shit & crap in crescita esponenziale, mwawawawa!!

@biffuz: beato te che ancora ce le hai le "illuminazioni divine" :D

banryu79
12-07-2012, 09:20
Altra storiella di Davide Bianchi, questa ci racconta che tutto il mondo è paese quando si tratta di project managment et similia (le vicende di Davide Bianchi sono localizzate in Olanda)
---

Ritorniamo a parlare di $allupati, di cui avevo accennato in questa storia.

Allora, avevamo lasciato il branco a smazzarsi la loro server-farm composta da una dozzina di macchine per capire perche' la foxxuta applicascione e' cosi' lenta prima di andare in produzione.

Fedeli al modo standard di pianificare le cose, l'intero ambaradan e' andato in produzione prima che i problemi di cui sopra fossero corretti. Cosi' ci ritroviamo alla prima settimana di attivita'. Settimana che e' stata preceduta da un barrage pubblicitario inaudito per promuovere una qualche cosa che sta' gente vorrebbe vendere.

Il risultato e' che il primo giorno e' tutto calmo sul fronte occidentale, il secondo giorno cominciamo a vedere che dalle 11.30 circa il numero di richieste comincia ad aumentare e la webapplicascion comincia ad andare in panico. Ogni tanto qualche cosa si incatasta ed io mi ritrovo con Tomcat a palla con 300 thread attivi in stato di attesa e niente che arriva. Risultato: si riavvia tomcat.

Avendo questi 8 (otto) applicascionserver il gioco consiste nell'avere su uno schermo un computo dei thread attivi sui vari servers e quando uno dei servers comincia ad aumentare (20... 23.... 28.... 31... 38...) significa che e' andato in palla ed e' il momento di fare un restart. Il che va' avanti dalle 11.30 fino circa alle 14.00, poi la gente ritorna a lavorare (o far finta di) e tutto ritorna tranquillo fino al giorno dopo.

Solo che $allupati non gradisce di ricevere una fattura per 3 ore di lavoro extra ogni giorno, specialmente da quando io ho cominciato a chiamare tale attivita' "retarded craplication pick-and-spin-up" (cioe' dal primo giorno). Quindi oggi, verso le 10.30, ci becchiamo la telefonata dall'UL di turno del branco di mammalucchi che hanno scritto l'applicascion che fa' domande varie.

IO - ...e quindi penso che il problema non sia tanto in TomCat quanto nella connessione tra la vostra applicazione ed il backend che fornisce i dati.
UL - Ma il backend non lo abbiamo fatto noi.
IO - E mi sta bene. Ma tu mi hai chiesto che cosa ne penso, e questo e' quello che ne penso.
UL - Mi viene in mente... avete provato a fare una pulizia della cache del database?
IO - La cache di che cosa?
UL - La cache del database.

Pausa, mentre io e DB ci guardiamo pensando "di che ca$$o sta' parlando questo qui'?".

IO - No, noi manco sapevamo che ci fosse una roba del genere... dove sarebbe sta' cosa, come si fa' ed a che serve?

E qui' UL si e' lanciato in una spiegazione irta di buzzwords in cui specificava che nel database esistono una serie di tabelle che contengono le query che sono state eseguite precedentemente allo scopo di stilare delle classifiche e statistiche e tali tabelle vengono elaborate ogni ora e sarebbe opportuno ripulirle di tanto in tanto in modo da mantenerle il piu' possibile pulite.

Ora, sorvoliamo sulla logica della cosa e sul fatto che se non ce lo dici sara' dura che ce lo sogniamo di notte, ma la faccenda mi ha fatto venire un dubbio.

IO - 'momento... ma di database ce ne sono due e dovrebbero essere sincronizzati, quindi a che vi serve calcolare ste' statistiche?
UL - Ah no, i databases non sono sincronizzati. Ne usiamo solo uno.
IO - ??? Come sarebbe a dire ne usate solo uno? Tutto sto' popo' di front-end con 8 server ed avete UN SOLO database?
UL - Bhe', si', perche' altrimenti e' un casino e... Ma che cosa puo' andare male in ogni caso?
IO - Hu... che il database si incatasta e tutto smette di funzionare?
UL - Heee... Ma no, questo non succede. Comunquesia, io suggerisco di eseguire la pulizia delle statistiche.
IO - (guardando DB che sta' eseguendo un perfetto face-palm) Ok, lo possiamo schedulare per stanotte?
UL - No, no. Facciamolo subito!
IO - (guardando l'orologio) Ma sono gia' le 11. E fra mezz'ora comincia il momento di massimo carico. Forse e' meglio evitarlo.
UL - Ma no, la procedura e' rapida e dovrebbe risolvere il problema. Che cosa puo' andare male?

Cosi' dopo un rapido giro di mails, lanciamo sta' cosa e rimaniamo a guardare mentre il db server comincia a macinare ed il load average comincia a salire fino ad assestarsi intorno ad un 49 e rimane li'.

E di concerto gli otto servers cominciano ad incatastarsi uno dopo l'altro quando le loro richieste non ricevono risposta.

Verso le 12, DB che e' al telefono da una parte con $allupati e dall'altra parte con gli sviluppatori decide che e' il caso di tirare giu' tutti e 8 i servers, fare un bello shutdown del database e ripartire da capo.

Io do' lo shutdown al database e rimango ad aspettare mentre quello comincia il rollback di quella famosa procedura di pulizia, con il redo log che si riempie a ritmi allucinanti.

Dopo un quarto d'ora DB decide che forse e' il caso di mettere una pagina di "lavori in corso" sul sito.

Finalmente, alle 13.45, il database riesce a spegnersi, noi riavviamo tutto in sequenza e le cose ritornano in vita. A quel punto abbiamo schedulato la procedura di pulizia per mezzanotte e vedremo come vanno le cose.

Ed adesso ho visto che stamani c'era pure una mail da parte di SL di $allupati che voleva avere una misura della frequenza dei riavvii dei servers durante il "round-up". Be', per oggi e' facile, la frequenza e' UNO.

Quindi dei DUE database servers in realta' ne e' usato solo uno. Per la serie: che cosa puo' andare male?

Davide
07/02/2011 08:00

marco.r
14-07-2012, 15:16
Bisogna sempre stare attenti a quello che si scrive nei commenti... non si sa mai chi li legge.
Ma puo' andare anche peggio. Ad esempio una volta ci era capitato di dover sviluppare una interfaccia utente per un macchinario.
In caso di errore in uno dei componenti hardware, doveva apparire un popup a video e il classico "ping!" di errore.
Un giorno per fare uno scherzo qualcuno sostitui il .wav dell ping con qualcosa di piu' colorito (fate conto un qualcosa tipo un spezzone tratto da un video di Mosconi, o giu' di li').
Momento di grande ilarita', fatto salvo che il qualcuno si dimentico' di togliere il .wav "burlone", che rimase li' fino al giorno in cui il cliente venne a testare il macchinario.
E come sanno tutti, se c'e' un momento in cui un macchinario si rompe, e' proprio quando viene il cliente a testarlo.
Per fortuna era un burlone anche lui e si e' fatto solo quattro risate...

banryu79
16-07-2012, 10:01
Momento di grande ilarita', fatto salvo che il qualcuno si dimentico' di togliere il .wav "burlone", che rimase li' fino al giorno in cui il cliente venne a testare il macchinario.

Leggerezza imperdonabile :asd:
Per fortuna il cliente aveva il senso dell'umorismo...

DioBrando
16-07-2012, 11:04
Discussione tipo con gli utenti di un call center dediti al data entry:

Utente: "Salve, non riusciamo a chiudere pratiche da Giovedì, ad es questa ticket numero 123456 di tipo X"
Io: "Controlliamo. Possiamo avere il tracciato utilizzato per verificare che sia corretto?"
Utente: "Sì certo, lo alleghiamo".
Io: "scusate ma nella segnalazione si parla di un ticket di tipo X numero 123456.
Ma il tracciato allegato è di tipo Y (che non c'entra una mazza aggiungo sommessamente). E' possibile avere quello utilizzato?"
Utente: "Esatto. Grazie. Saluti"



...




Poi uno non deve bestemmiare contro l'intelligenza da armadillo degli utenti.
:muro:

banryu79
25-07-2012, 17:25
Questa volta la storiella divertente illustra cosa succede nel mondo reale quando diventa "stardand" il non rispetto degli standard (RFC)

---

Premessa: questa qui' non e' propriamente una 'storia', ma mi e' stato fatto notare da piu' parti che ultimamente scrivo un po' troppi "commenti", ed e' abbastanza relativa, quindi la posto qui'.

Il termine talebani o talibani indica gli studenti delle scuole coraniche (incaricati della prima sommaria alfabetizzazione, basata esclusivamente su testi sacri islamici). Sono diventati famosi sugli organi di comunicazione di massa, che usa questo termine per indicare la popolazione fondamentalista presente in Afghanistan e nel confinante Pakistan (fonte: Wikipedia). Ed e' usato (aggiungo io) anche per indicare in generale chiunque assuma posizioni estremiste in una qualunque discussione o su qualunque argomento.

Che io sia tacciato di "talibanismo" non e' cosa anormale, in molti casi le mie opinioni su certe cose sono oramai un po' troppo "estremizzate" per poter essere definite "bilanciate" (cose come "php e' una chiavica", "tutti i phprogrammatroti dovrebbero essere sterminati" e "exchange != mail server" tanto per citarne alcune). Ma in molti casi capisco che un approccio del tipo "digitale", con solo due posizioni possibili (bianco e nero, giusto e sbagliato, si o no) e' piuttosto difficile da tenere ed alla lunga provoca piu' problemi che altro, in questo mondo complesso e differenziato e' sempre necessario mediare.

Allora, stamani mi arriva la telefonata del CL del giorno (CL per gli amici), che si lamenta che non riesce a ricevere la posta dall'altro CL del giorno (CL2 per gli amici) il quale sarebbe tanto interessato a diventare suo cliente (cliente di CL intendo) ma a quanto pare se non riescono a comunicare via e-mail non c'e' modo.

Il server di posta di CL fu' installato un po' di tempo fa' dal mio ex-collega (si', quello che tirava le tastiere dalla finestra), il quale era pure lui un talebano, ma fino ad ora ha funzionato regolarmente e, dato che pare che sia solo la mail di CL2 che non viene ricevuta, io comincio a sentire puzza di un grosso, peloso e fetente Exchange in giro.

IO - Quindi che errore ricevete?
CL - Noi non riceviamo nessun errore, e' la posta di CL2 che non riceviamo
IO - E CL2 non riceve nessun errore al riguardo?
CL - No nessun errore, solo la posta di CL2 che non arriva.
IO - Si', che la sua posta non vi arriva lo avevo capito, ma di solito quando la posta non viene consegnata viene consegnato un qualche tipo di messaggio di mancato recapito, con una indicazione del perche' non si e' potuto consegnare il messaggio. CL2 dovrebbe avere un qualche tipo di errore.
CL - No la posta di CL2 non ci arriva.

Grrr...

Dopo una rapida ricerca nel nostro database di configurazione scovo i dati di login sul server di posta di CL, mi loggo e scopro che il server e' QMail. Nel paese dei Talebani Dan Bernstein e' il supremo ed indiscusso imperatore. Ravano un po' nei log e mi becco questo frammento di balbuzie:

[ScanFlowStore] Mail error: The message could not be sent to the SMTP server. The transport error code was 0x800ccc6a. The server response was 451 See http://pobox.com/~djb/docs/smtplf.html.

E nella pagina specificata si legge: Your mailer is violating 822bis section 2.3, which specifically prohibits all bare LFs

Un rapido controllo sul server di posta di CL2 mi dice che si', loro usano Sexchange.

Venghino venghino siorre e siorri! Lo scontro del secolo! Il Talebano delle RFC contro "noipossediamolafottutainterneteglistandardlipossiamoignorare", l'Oggetto Inamovibile contro La Forza Irresistibile! Vecchi e bambini meta' prezzo.

Che sexchange abbia un approccio per cosi' dire "rilassato" nei confronti delle RFC e degli standard vari non e' che sia una cosa tanto nuova. D'altra parte le RFC stesse specificano che e' consigliabile tenere a mente che, si', esistono dei software bacati che non rispettano i dettami e sarebbe opportuno tentare di cooperare e non stigmatizzare questi cerebrolesi. Si potrebbe anche obiettare che porcoca$$o! Non e' che non abbiano i soldi, l'energia o le capacita' per scrivere una chiavica di mailer che rispetti quei quattro dettami che sono vecchi di vent'anni, e che se non vogliono rispettare gli standard possono anche andare a succhiare le dita dei piedi sporchi di una valkiria incazzosa (la Convenzione di Ginevra non copre le torture alle metafore vero? Phew...)

Purtroppo, in molti casi occorre anche sapersi destreggiare, perche' e' bello dire che bisogna essere interoperabili (che detto cosi' suona quasi una roba sconcia) ed essere aperti agli standard di scambio delle informazioni eccetera eccetera. Ma se vuoi lavorare in certi casi devi anche saperti adattare, quindi accettare documenti di Worp, Expel ed aspettarti il CL del caso che ti manda uno snapshot dello schermo incorporato in un documento di Word per spiegarti quale e' l'errore che riceve dalla famosa applicazione (404, pagina non trovata).

Comunquesia, io giro la cosa a CL, con spiegazione che sostanzialmente dice "finche' CL2 non invia una mail che risponde ai dettami di quello che una mail dovrebbe essere il mail server persistera' nel non accettarlo. Potrebbe essere che CL2 stia cercando di inviare un qualche file binario che non viene impacchettato come dovrebbe, potrebbe essere che hanno qualche casino, ma come e' come non e' il server si rifiuta di accettare la mail. E dato che si rifiuta di accettare solo la mail di CL2 non e' che il mail server e' rotto. E' quello di CL2 che e' rotto.

Ovviaemente la spiegazione non e' garbata a CL che ha cominciato con una filippica allucinante che loro stanno cercando di acquisire il cliente e che la comunicazione e' essenziale e blah blah blah yada yada yada. Per cui alla fine della lunghissimissima telefonata mi sono limitato a dirgli che se vuole cambiare la cosa dovremo installare un server di posta diverso e meno "stretto" nei confronti delle regole. E come accennato sopra, a volte per amore del quieto vivere e della busta paga a fine mese bisogna sapersi piegare a certi compromessi, percui QMail verra' presto sostituito da un bel Postfix.

Segnamo un altro punto a favore della corruzione degli standard.

Davide
07/03/2011 08:00

biffuz
25-07-2012, 17:45
Ovviaemente la spiegazione non e' garbata a CL che ha cominciato con una filippica allucinante che loro stanno cercando di acquisire il cliente e che la comunicazione e' essenziale e blah blah blah yada yada yada.

Vedi, hai sbagliato, non devi perderti in spiegazioni tecniche con i CL... dovevi solo dirgli che se vuole quel cliente allora dobbiamo spendere 25 k€ per sostituire il nostro sistema :D

marco.r
25-07-2012, 17:51
Che sexchange abbia un approccio per cosi' dire "rilassato" nei confronti delle RFC e degli standard vari non e' che sia una cosa tanto nuova. D'altra parte le RFC stesse specificano che e' consigliabile tenere a mente che, si', esistono dei software bacati che non rispettano i dettami e sarebbe opportuno tentare di cooperare e non stigmatizzare questi cerebrolesi.


Be conservative in what you do, be liberal in what you accept from others.

(Postel's law)

C'e' un motivo se la gente ormai usa postfix piuttosto che qmail.

banryu79
26-07-2012, 09:19
Vedi, hai sbagliato, non devi perderti in spiegazioni tecniche con i CL... dovevi solo dirgli che se vuole quel cliente allora dobbiamo spendere 25 k€ per sostituire il nostro sistema :D
Ciao biffuz, occhio che le storie che posto non sono mie eh! :D
Davide Bianchi è un sysadmin italiano all'estero (in Olanda).
Puoi trovare le sue storie (e altro) sul suo sito personale.
Prova con una ricerca per "Storie dalla sala macchine".

banryu79
26-07-2012, 09:20
Be conservative in what you do, be liberal in what you accept from others.

(Postel's law)

C'e' un motivo se la gente ormai usa postfix piuttosto che qmail.
Sì, io son d'accordo, però vallo a dire a Bernstein (https://en.wikipedia.org/wiki/Daniel_J._Bernstein) :)

banryu79
02-08-2012, 16:57
Sembra impossibile eppure...
---

La Chiave

No, rimettetevi i pantaloni che non stiamo parlando di Tinto Brass.

Alura, un po' di tempo fa' $noicifacciamogliaffarituoi ha messo in piedi il solito sito interdet con CMS incorporato. Roba che oramai e' piu' comune del mal di testa che mi provocano. Dopo numerose bestemmie per via delle varie versioni del foxxuto sito che si incatastavano in continuazione e numerosi cicli di aggiorna, prova, riprova, downgrade, riprova, i pinguini si sono finalmente decisi ad accettare il mio suggerimento di mettere in piedi un sistema di testing basato su un singolo server (virtuale) che faccia sia da web server che da database server. Per i test dovrebbe essere piu' che sufficiente.

Ed infatti dopo un po' di verifiche e prove, la versione in 'test' viene spostata in produzione e sembra funzionare un pelo meglio. Il che significa che invece che inchiodarsi brutalmente e riportare due kili e mezzo di errori ad ogni pagina ne ritorna solo mezzo chilo.

Ma... Ma c'e' un "ma".

Il "ma" in questione e' che ci sono certe cose che funzionano in test e poi, una volta spostate in produzione, o non funzionano o danno dei risultati completamente diversi. Il che mi fa pensare che (come al solito) l'ambiente di 'test' non e' proprio uguale a quello di 'produzione'.

E non sto parlando del fatto che uno dei due ambienti e' composto da due macchine separate per web e db, ma del fatto che evidentemente l'applicazione e' diversa tra le due.

Dopo un altro po' di bestemmie, riesco a convincere i pinguini programmatroti che forse e' il caso di fare un bel dump del server di produzione e "spalmarlo" sul server di test, cosi' che si possa fare i test e verificare che i due ambienti rispondano nello stesso modo. Dopo aver fatto la "spalmatura" scopriamo che l'applicazione continua a rispondere in modo diverso. Ok, il problema e' evidentemnte nei dati del database. A questo punto, CL, membro della premiata ditta $pinguiniprogrammatrotisiamonoi, ha l'illuminazione: quando e' stata fatta l'installazione della nuova versione dell'applicazione e' stato anche caricato un database di prova senza prima zappare via quello esistente, il risultato e' che ci sono dei dati duplicati nel database e questi provocano i problemi.

IO - ...momento quajo'... dati duplicati? Nel database?
CL - Si', sicuramente... Possiamo fare un controllo con un "select questo-e-quello from..."

E la query ritorna 580 righe, mentre (secondo CL) dovrebbe ritornarne solo un terzo.

CL - Ecco il problema, abbiamo dei dati duplicati.
IO - Ma... come cappero si fa' ad inserire dei dati duplicati in un database? Non dovrebbero esserci delle chiavi primarie e cose cosi' per evitarlo?
CL - Huh? Chiavi primarie?

Il tono di CL mi fa' venire i brividi cosi' faccio un rapido controllo nel db e scopro che... Non ci sono chiavi primarie definite in nessuna tabella!!! E quindi non ci sono FK ne' altri meccanismi per forzare un minimo di "coerenza logica" dei dati. In effetti e' possibile inserire qualunque schifezza in questo database. Ed e' stato fatto.

IO - Ma non sarebbe meglio utilizzare una qualche constraint per evitare questi problemi? Voglio dire, come fate a mantenere la coerenza dei dati?
CL - Ah, ci pensa l'applicazione.

Ossignur... Ed il bello e' che questa gente usa Oracle! E lo usano come userebbero una merda come MyS... ehm, Access! Non c'e' limite al peggio (come se non lo sapevo prima).

Davide
28/03/2011 08:00

franksisca
03-08-2012, 09:45
non ci credo...dai non è possibile. anche nei "acces for dummies" da 5€ ci sono le chiavi...questi qui come caxxo si sono diplomati/laureati???

Resto sconcertato

biffuz
03-08-2012, 11:45
non ci credo...dai non è possibile. anche nei "acces for dummies" da 5€ ci sono le chiavi...questi qui come caxxo si sono diplomati/laureati???

Come fanno tutti, dopo aver dato l'esame hanno cancellato tutto dalla memoria con il solito schema mentale "tanto non serve sul lavoro". Ammesso che siano laureati in informatica, certo.

E ormai i programmatroti nemmeno si prendono la briga di leggersi "Pulirsi il sedere for dummies", semplicemente aprono Chrome, scrivono "come leggo una riga dal database" e cliccano sul primo link.

Se vi dicessi in quali genere di aziende e a quali livelli ho visto questo modo di fare, vi verrebbe la pelle d'oca.

Ah, e poi, ovviamente, se tu invece cerchi di studiare un po' e fare le cose per bene, l'unico risultato che ottieni è un cazziatone perché sei lento.

franksisca
03-08-2012, 11:49
Come fanno tutti, dopo aver dato l'esame hanno cancellato tutto dalla memoria con il solito schema mentale "tanto non serve sul lavoro". Ammesso che siano laureati in informatica, certo.

E ormai i programmatroti nemmeno si prendono la briga di leggersi "Pulirsi il sedere for dummies", semplicemente aprono Chrome, scrivono "come leggo una riga dal database" e cliccano sul primo link.

Se vi dicessi in quali genere di aziende e a quali livelli ho visto questo modo di fare, vi verrebbe la pelle d'oca.

Ah, e poi, ovviamente, se tu invece cerchi di studiare un po' e fare le cose per bene, l'unico risultato che ottieni è un cazziatone perché sei lento.

Che amarezza (cit.)

demos88
03-08-2012, 13:32
La verità è che 4 studenti su 5 che escono da un ITIS informatico, sono tipicamente più affidabili e colti informaticamente rispetto a un ingegnere (triennale soprattutto) informatico che ha fatto uno scientifico alle superiori, e questi ultimi sono la maggioranza tipicamente, ma ho visto anche diversi liceali classici e linguistici.
Questo lo sto notando da perito informatico e studente di ingegneria informatica, è una oscenità.

biffuz
03-08-2012, 14:19
La verità è che 4 studenti su 5 che escono da un ITIS informatico, sono tipicamente più affidabili e colti informaticamente rispetto a un ingegnere (triennale soprattutto) informatico che ha fatto uno scientifico alle superiori, e questi ultimi sono la maggioranza tipicamente, ma ho visto anche diversi liceali classici e linguistici.

Esatto, ormai si assume come programmatore chiunque abbia "esperienza" di Visual Basic (una decina di anni fa) o JavaScript (oggi). Ma per fare carriera basta essere bravi a lucidare il posteriore del capo...

franksisca
03-08-2012, 15:02
La verità è che 4 studenti su 5 che escono da un ITIS informatico, sono tipicamente più affidabili e colti informaticamente rispetto a un ingegnere (triennale soprattutto) informatico che ha fatto uno scientifico alle superiori, e questi ultimi sono la maggioranza tipicamente, ma ho visto anche diversi liceali classici e linguistici.
Questo lo sto notando da perito informatico e studente di ingegneria informatica, è una oscenità.
da laureatto triennale in ingegneria informatica (mi mancavano 8 esami alla specialistica) e diplomato geometra mi sento chiamato in causa :O

Anticipando che suppongo tu non faccia di tutta l'erba un fascio, ma mi trovo addirittura costretto a darti ragione, ma è anche vero che il lavoro di ingegnere informatico, almeno dalle mie parti, non esiste proprio. A me, e a molti miei colleghi, capita di essere etichettato come "quello che ne capisce di pc"...e sinceramente a volte mi sento umiliato ad aver passato 10 anni per sbattere la testa sui libri e poi non fare una cippa di quello che ho studiano.
Poi, vorrei che la gente si mettesse in testa, che l'ingegnere informatico non è nè un programmatore nè un "creatore di siti" !!!
Esatto, ormai si assume come programmatore chiunque abbia "esperienza" di Visual Basic (una decina di anni fa) o JavaScript (oggi). Ma per fare carriera basta essere bravi a lucidare il posteriore del capo...

se sei un gran lucidatore non hai bisogno nemmeno del titolo quasi....

demos88
03-08-2012, 17:58
da laureatto triennale in ingegneria informatica (mi mancavano 8 esami alla specialistica) e diplomato geometra mi sento chiamato in causa :O

Anticipando che suppongo tu non faccia di tutta l'erba un fascio, ma mi trovo addirittura costretto a darti ragione, ma è anche vero che il lavoro di ingegnere informatico, almeno dalle mie parti, non esiste proprio. A me, e a molti miei colleghi, capita di essere etichettato come "quello che ne capisce di pc"...e sinceramente a volte mi sento umiliato ad aver passato 10 anni per sbattere la testa sui libri e poi non fare una cippa di quello che ho studiano.
Poi, vorrei che la gente si mettesse in testa, che l'ingegnere informatico non è nè un programmatore nè un "creatore di siti" !!!

Ovvio che è un discorso puramente generale, comunque attualmente i geometri ricevono una preparazione informatica non trascurabile, a detta di chi so che sta facendo tale indirizzo.
Ho anche conosciuto liceali classici che sono diventati dei buoni ingegneri (nel senso che sono consci della loro posizione e delle loro conoscenze non così estese in ambito informatico quanto il loro titolo potrebbe suggerire) mentre altri che si sono un po' troppo montati. Ma il problema non risiede tanto nella persona, quanto nel fatto che ci siano questi corsi così "prestigiosi" (per la stragrande maggioranza delle persone, ancora oggi Ingegnere = "Sa tutto") che di fatto non preparano.
E' anche vero che la figura dell'ingegnere informatico non è esattamente quella del programmatore, è una figura che effettivamente in molte circostanze (piccole aziene di programmazione) non ha molto successo. Si ha una preparazione estesa su molte materie scientifiche e tecniche, ma nessuna approfondita, a meno che non si prosegua con la magistrale. Ma i contenuti dei corsi rimangono sempre molto più astratti rispetto al corso di laurea in informatica (non ingegneria).

DioBrando
03-08-2012, 19:18
La verità è che 4 studenti su 5 che escono da un ITIS informatico, sono tipicamente più affidabili e colti informaticamente rispetto a un ingegnere (triennale soprattutto) informatico che ha fatto uno scientifico alle superiori, e questi ultimi sono la maggioranza tipicamente, ma ho visto anche diversi liceali classici e linguistici.
Questo lo sto notando da perito informatico e studente di ingegneria informatica, è una oscenità.

Senza offesa ma...Non diciamo vaccate dai :)

Quello che impara un perito e come lo impara potrebbe studiarselo con profitto qualsiasi persona mediamente intelligente con le risorse che la Rete o la bibliografia mette a disposizione.

Per altro se uno è un cretino o sprovveduto, lo è da laureato e non.

Se un'azienda cerca espressamente un informatico o un ingegnere informatico, non lo fa perché conosce VB6 o qualsiasi altra tecnologia tu possa citare.


E in ultima battuta, il confronto laureati VS diplomati è ciclico.
Siete off topic, questo è un thread su tutte le disavventure, i "lol" e gli epic fail che capitano a chi lavora in questo settore.
Manteniamolo tale e con uno spirito goliardico.

banryu79
08-08-2012, 09:24
Questa è veramente lol...
---

Ed ecco l'ultima trovata di $noicifacciamogliaffarituoi. Almeno, l'ultima di questa settimana. Come ho gia' detto prima ed ancora prima, i signori hanno messo in piedi un gran po' po' di webapplicascion con CMS incorporato ed hanno scoperto che se l'applicascion e' sviluppata da programmatroti le cose non e' che funzionano in modo tanto decente.

Ma e' da un po' che il concetto pare incominciare a prendere piede nelle teste dei vari UL. Da che lo deduco? Dal fatto che cominciamo a ricevere strane richieste che hanno come oggetto il debugging e/o l'aggiunta di funzionalita' all'applicascion di cui sopra.

Ed io ho la netta sensazione che $noicifacciamo ha deciso che domandare a noi (cioe' a me) una opinione tecnica e/o una possibile soluzione ad un loro problema significa riceverla in un decimo del tempo ed ad un decimo del costo se confrontata con la stessa domanda fatta ai loro programmatroti. Io ho proposto di rivedere i nostri onorari ma l'idea e' stata respinta.

Quindi quando mi e' arrivata una mail con un lungo discorso di importazione automatica delle statistiche non mi sono stupito piu' di tanto.

Allora, vediamo un attimo... questi hanno una qualche societa' di statistica che gli fa' delle statistiche (ovviamente) riguardo a qualche cosa... e vogliono importare questa roba nel loro sito direttamente nel database in una qualche tabella... pare che la societa' di statistica fosse gia' occupata prima con la versione vecchia del sito e adesso vogliono riprendere ad importare questa roba.

Quindi si tratta di aggiungere un utente con diritti di ftp (o meglio SFTP) e fare uno scriptino che prenda sta' roba e la copi nella directory giusta in modo che l'applicazione dei programmatroti possa importarseli. Perche' l'idea di domandare ai programmatroti di aggiungere al famoso CMS la possibilita' di uploadare le statistiche direttamente e' ovviamente scartata a priori. Vabbe', non e' che sia un gran problema. Mi piacerebbe solo che questi "conigli" evitassero di saltare fuori dal cappello sempre all'ultimo secondo.

Aggiungo l'utente, preparo lo script, verifico che funzichi (cioe' che copi i files) poi mando i dati relativi ad utente e password al branco di rintronati e domando da quali IP vogliono accedere al sistema.

Dopo un paio di giorni mi arrivano gli IP da cui questi pinguini vogliono poter uploadare la roba. Ed e' una paccata di reti... sostanzialmente l'intera rete del Gabon (o sarca$$o...). Dopo aver chiesto chiarimenti ed ottenuto un assenso generico da DaBoss apro le saracinesche dell'inferno e vediamo come vanno le cose. Poi (ovviamente) non ne sento piu' parlare per almeno un mese.

Dopo un mesetto (circa) mi becco una telefonata dell'UL di turno che lamenta che la loro "importazione" non funziona. Io faccio un rapido giro sul server e noto che nessuno ha mai uploadato niente, quindi non e' che non funziona, semplicemente non e' usata.

UL - Come non hanno mai uploadato niente?
IO - Cosi' sembra. L'unica login che vedo io e' di oltre un mese fa' e qualche cosa mi fa' pensare che sono io che ho provato a vedere se funzionava.
UL - Ma le statistiche non si aggiornano!
IO - Se non le caricano no. Ovviamente no.

Dopo un po' di babbilamme UL decide che la cosa migliore e' organizzare una bella conference a tre con il pinguino che dovrebbe fare ste' statistiche. Sono quindi 'conferenziato' con UL e CL (il pinguino di cui sopra).

UL - ...e quindi e' essenziale arrivare a far funzionare questa cosa al piu' presto!
IO - Allora, come gia' detto lo script e' a posto e gira ma non ho visto nessuna attivita' sul sistema da oltre un mese, cioe' da quando e' stato messo in funzione.
CL - Ma noi abbiamo provato una volta ma avevamo dei problemi perche' non e' possibile automatizzarlo.
UL - Come non e' possibile automatizzarlo?
CL - Perche' non e' FTP.
IO - E' SFTP, che e' come FTP ma con la crittografia aggiunta. Ed e' possibilissimo automatizzarlo.
CL - Ma mi domanda la password!
IO - E' possibile usare un sistema di chiavi pubbliche/private per l'autenticazione che evita la password o e' possibile fare uno script per fornire la password. Entrambi i modi erano descritti nella mail che ho mandato tempo addietro quando ho comunicato anche l'utente e la password.
CL - Ma noi non possiamo fare script...
UL - Vabbe', degli script ne parliamo dopo, comunque adesso e' importante vedere se il sistema funziona correttamente. Voglio fare una prova "live". Puoi fare un upload manuale di un file adesso cosi' vediamo se viene importato?
CL - Mah... Adesso... Non lo so... Ora devo vedere...

Aggiungete qui' una mezz'ora di tira e molla. Alla fine salta fuori che CL non ha manco piu' la mail in cui io comunicavo i dati relativi all'indirizzo IP, utente e password. Ri-manda la mail al volo (con CC a UL) e fai login sul server e metti in tail -f il log cosi' vedo quando si logga. Dopo un po' vedo CL comparire nel log.

CL - Ah, ecco e poi c'era il problema che la directory non si chiama 'upload'!
UL - Come?
IO - Ho qui' davanti l'ultima mail che ci siamo mandati dove dice chiaramente: "Ok, allora ho cambiato la struttura delle directory per avere una directory 'acc' per l'ambiente di accettazione, una 'prod' per l'ambiente di produzione" eccetera eccetera. Aspetta che te la rimando in copia. Questa mail e' di oltre un mese fa'.
UL - Hu... Ah gia' si' e' vero.. che avevamo deciso poi di fare le cose in questo modo... Allora CL hai anche tu la mail?

Dopo un po' di ravanamenti CL finisce con il caricare finalmente uno di questi foxxuti files (di cui io acchiappo subito una copia), io eseguo a manella lo script di aggiornamento senza aspettare che venga eseguito da Cron e vedo il file trasferito nella directory giusta.

IO - Adesso bisogna vedere quanto ci mette l'applicazione a caricarlo. Io vedo qui' che il loro 'scheduler' e' impostato per eseguire la cosa all'una di notte... solo che non ho idea di quale di questi campi siano i minuti... possiamo domandare a loro o impostarlo per eseguire le cose ad $oradiadesso + 1 ora
UL - Mi sa che aspettare un'ora e' piu' veloce che domandare a loro.

Rischedulo e decidiamo che la conversazione puo' procedere via mail.

Dopo un'ora circa il foxxuto coso gira e mi sputa subito un bell'errore nel log. Mando il tutto ad UL ed in cc a CL. E dopo dieci minuti ri-sono in conferenza con entrambi.

UL - Quindi e' un problema dell'applicazione!
IO - Cosi' pare. Ovviamente pero' se nessuno fa un upload non e' che l'applicazione abbia un gran che da fare.
UL - E come mai l'applicazione non riesce ad importare i dati?
CL - Mah... Dall'errore pare che sia un problema di struttura del file.
UL - E come mai dice "file tal-de-tali non trovato"? D, stiamo mettendo i files nella directory giusta?
IO - Solo un file e' stato uploadato, d'altra parte se vogliamo fare dei test per vedere se la copia funziona, un file e' sufficiente.
UL - Ah ecco... Quindi che cosa ha che non va' la struttura?
CL - Mah.. non so... puo' darsi che loro non stiano usando la struttura giusta. Perche' noi non possiamo cambiare la struttura del file che usiamo, potrebbe anche essere un problema di quante righe vengono analizzate.
UL - Le righe?
IO - Questo file e' un banalissimo file CSV ed e' meno di 100 righe. Se hanno dei problemi ad analizzare un csv di 100 righe... Ma avete discusso della struttura del file con quella gente?

Silenzio di tomba.

IO - Hallo? Nessuno li'?
CL - Si' sono qui.
IO - Ne avete parlato della struttura del file?
CL - Veramente no. Non abbiamo mai discusso della struttura del file da importare.
IO - Hummm... Ed esattamente come hanno fatto quelli a scrivere una procedura di importazione di un file senza avere una minima idea di come e' fatto il file che devono importare?
CL - ...in effetti potrebbe essere un problema...

In effetti potrebbe essere un problema. Discutere.

Davide
02/05/2011 08:00
---
:asd:

franksisca
08-08-2012, 13:17
grazie a dio che esistono queste persone che ci fanno lavorare e ridere al contempo...appena ho tempo devi scrivere anche io 2-3 cosette che mi sono capitate in ufficio

banryu79
21-02-2013, 17:14
Questo non è un aneddotto, come nei post precedenti, ma un paio di "jokes" la cui tematica è attinente al nostro settore.

--

Il Genio.

Un Programmatore sta passeggiando lungo una spiaggia quando ad un certo punto si imbatte in una lampada, mezzo sepolta nella sabbia: la prende e la strofina.
All'improvviso compare un Genio: "Sono il genio più potente del mondo! Posso esaudire un tuo desiderio, uno qualunque. Cosa desideri?"

Il Programmatore tira fuori una mappa, la apre, indica un'area al Genio e gli dice: "Desidero la pace in Medio Oriente".
Il Genio: "Azz, non saprei... Quella gente si scanna da milleni, sono molto potente e posso fare quasi qualunque cosa ma questo... Beh, questo va oltre i miei limiti".

Il Programmatore: "Allora senti, io sono un programmatore, e i miei programmi sono utilizzati da un sacco di persone. Per favore, fa in modo che tutti loro siano soddisfatti delle mie applicazioni e che chiedano modifiche e upgrade ragionevoli e sensati".

Al che il Genio: "Mmm... Err... Fammi vedere di nuovo la mappa..."

---

Real Programmers.

http://imgs.xkcd.com/comics/real_programmers.png

:asd:

marco.r
21-02-2013, 17:19
Confermo la presenza di
C-x M-c M-butterfly
in emacs
anche se io l'ho rimappato a F9

DioBrando
21-02-2013, 17:20
lol@Francesco :asd:

banryu79
21-02-2013, 17:22
Confermo la presenza di
C-x M-c M-butterfly
in emacs
anche se io l'ho rimappato a F9
"Se marco.r preme F9 in Emacs a Malo, a Padova nevica".
-- The brutterfly effect, revised

sottovento
21-02-2013, 20:24
Salto a piedi giunti nel thread perche' sono fermamente convinto che posso battervi tutti, anche se l'episodio che mi accingo a raccontarvi e' vecchio di qualche lustro. Pero' e' (purtroppo) tutto vero.
Ammetto di essere un tipo piuttosto accomodante, anche quando le risposte dovrebbero essere piu' di polso. Giudicate voi.

Quella mattina ero nel mio ufficio e pianificavo di fare lavoro di routine, niente di particolarmente eccitante, quando suona il telefono. Telefonata intercontinentale, dalla Cina.
Si trattava di un cliente, a cui circa 3 anni prima avevamo installato un grosso impianto, ed il sottoscritto aveva scritto una parte del software di automazione.
Il cliente era arrabbiatissimo (lo chiamero' Hong Lei invece del suo vero nome):

Sottovento - cosa sta succedendo?
Hong Lei - il software non funziona piu'!!

Panico! Si tratta di un impianto ad alta produttivita', il fermo di pochi minuti costa parecchie migliaia di euro. Un fermo di ore costa parecchie teste.
Bianco in viso, faccio segno ai miei colleghi che c'e' un grosso problema, e metto in viva voce.

Sottovento - ok, stai calmo, Hong Lei. Dacci i dettagli. Cosa vedi a schermo?
Hong Lei - niente!
Sottovento - come niente? Non c'e' una scritta di errore? Un errore di sistema?
Hong Lei - no!
Sottovento - Puoi vedere se i processi stanno girando correttamente?
Hong Lei - No, non girano!!
Sottovento - Beh, prima di tutto falli ripartire. La produzione deve ripartire, poi possiamo analizzare cos'e' successo.
Hong Lei - Non posso!!
Sottovento - perche'?
Hong Lei - Il sistema non risponde.

Rapida consultazione con i miei colleghi. Il panico si diffonde anche in Europa.
Nessuno ci capisce nulla

Sottovento - Prova a collegarti al sistema
Hong Lei - non posso!
Sottovento - perche' non puoi? Cosa esce a schermo?
Hong Lei - nulla!

Le differenze culturali hanno il loro peso. Per questo motivo, normalmente lasciano parlare il sottoscritto con i cinesi poiche' li capisco di piu', essendo mia moglie del regno di mezzo.
Loro non vanno mai dritti al punto, ma si avvicinano a mo' di spirale. Pero' qui il tempo stringe e sembra che Hong Lei chieda aiuto ma sia molto reticente a fornire informazioni.

Rapida consultazione con i colleghi e decidiamo di provare a fare un restore dell'ultimo backup che abbiamo lasciato a disposizione.

Sottovento - Senti, non riusciamo a trovare il bandolo della matassa. Cosa ne pensi di reinstallare l'ultimo backup?
Hong Lei - va bene.
Sottovento - Ti ho lasciato i dischi di backup nell'armadio che c'e' in computer room. Prendili, per favore.
Hong Lei - non posso
Sottovento - non puoi?
Hong Lei - no
Sottovento - perche'?
Hong Lei - non sono in computer room
Sottovento - in tutto questo tempo non sei mai stato in computer room?
Hong Lei - si (si vuol dire no, che non c'e' mai stato. Parlano al contrario. Fortuna che ci dormo con una di loro :D )
Sottovento - Beh, allora vai in computer room e prendili.
Hong Lei - non posso
Sottovento - perche' non puoi? Come fai a dire che lo schermo e' nero, che non funziona nulla se non puoi nemmeno andare in computer room?
Hong Lei - ....
Sottovento - ....
Hong Lei - C'e' un incendio!
Sottovento - Un incendio?!?!?!
Hong Lei - si, un incendio!
Sottovento - Dove?
Hong Lei - in computer room. Ad essere sinceri, l'incendio si e' propagato per tutto l'impianto. Sono parecchie ore che i pompieri stanno cercando di domarlo, ma ci sono ancora le fiamme alte?

Sottovento - quindi i computer sono bruciati, giusto?
Hong Lei - giusto
Sottovento - anche i monitor/tastiere/unita' centrali/backup/....
Hong Lei - si
Sottovento - tutto fuso, insomma
Hong Lei - si

I cinesi riescono sempre a sorprendermi.
Per la cronaca: a parte il nome del cliente, il resto e' vero :D

banryu79
22-02-2013, 09:41
From:

Sottovento - cosa sta succedendo?
Hong Lei - il software non funziona piu'!!
...

To:

...
Sottovento - quindi i computer sono bruciati, giusto?
Hong Lei - giusto
Sottovento - anche i monitor/tastiere/unita' centrali/backup/....
Hong Lei - si
Sottovento - tutto fuso, insomma
Hong Lei - si


Epic Debug! :O

:asd:

marco.r
22-02-2013, 09:48
Mi ricorda un po' una telefonata che ebbi un po' di anni fa con un cliente

"Dovete mandare subito qualcuno qui (200km, ndr) perche' non va piu' niente!"
"Mi scusi, cosa intende con 'non va piu' niente' ?"
"Ah non lo so, siete voi i tecnici, me lo dovete sapere dire voi !"

shinya
22-02-2013, 09:50
Giusto per folklore a questo punto bisogna tirare fuori la vecchia storia delle mail che non vanno oltre le 500 miglia...
http://www.ibiblio.org/harris/500milemail.html

sottovento
22-02-2013, 12:12
Vi riporto in Cina, fonte inesauribile di ispirazione quando il thread contiene il tag [OT].
Allarghiamo un po' l'orizzonte del debug, per occuparci di problemi piu'... hardware.
Questa pero' l'ho quasi vissuta, nel senso che facevo parte del gruppo, partecipavo alle riunioni ma non era roba di software, quindi non c'entravo.

Insomma, una volta arrivati in Cina, partiamo con l'erection dell'impianto, quindi i montatori montano le parti meccaniche, gli idraulici stendono i tubi e gli elettrici tirano i cavi. Si tratta di impianti di grande potenza (per intenderci, i motori sono grossi come stanze), quindi tutto deve essere calcolato e progettato con grande precisione. Non c'e' molto spazio per l'improvvisazione.
Stavolta, a sbiancare sono stati gli elettricisti: tirando i cavi si sono accordi di un errore di una decina di metri!!!! Ora, non e' che si possono fare le giunte a cavi che portano grosse potenze e a quelli che portano segnali da sensori disegnati apposta per ambienti estremamente difficili. 10 metri in piu' e' un errore madornale.

L'allarme e' subito scattato e questo ha comportato una marea di riunioni fra noi in Cina e la casa madre in Germania. Com'e' stato possibile un errore del genere? Abbiamo controllato tutti i calcoli, sembrava tutto a posto, eppure i cavi non riescono a raggiungere le varie stanze dove erano alloggiate tutti gli equipaggiamenti.

Nessuno voleva prendersi la responsabilita' di parlare col cliente: questa e' troppo grossa, chi aveva il coraggio di confessarla? Si e' pensato quindi di mandare un manager dalla Germania apposta per questa cosa.

Cosi', una volta arrivato 'sto manager, andiamo in riunione, peraltro gia' programmata, per discutere l'avanzamento dei lavori. In questa riunione abbiamo (o meglio, il suddetto manager ha) tirato fuori la verita', dicendo che i cavi non c'arrivano.

Nella sala e' calato il silenzio. Poi e' arrivata la sorprendente reazione del cliente: "ma si, non fa nulla. Prendetevi tempo e cercate una soluzione".
Fra tutte le possibili reazioni, questa era davvero la meno aspettata. Si e' sentito tirare un sospiro di sollievo da parte nostra. Fino a quando... non abbiamo cominciato ad insospettirci: come dicevo, l'errore e' gigantesco ma la reazione del cliente e' stata fin troppo accomodante.

Cosi' qualcuno ha pensato di controllare anche quello che non pensavamo di controllare e... SORPRESA! Il problema non era che i calcoli erano sbagliati, ma che il cliente aveva letto male i disegni ed aveva fatto costruire i vari locali IN POSIZIONI COMPLETAMENTE SBAGLIATE!! I cavi erano giusti, erano le stanze che si erano allontanate!!

E questo e' il primo caso di DEBUG IMMOBILIARE :D

sottovento
22-02-2013, 12:15
From:

To:


Epic Debug! :O

:asd:

Direi proprio di si :D

banryu79
22-02-2013, 13:19
... SORPRESA! Il problema non era che i calcoli erano sbagliati, ma che il cliente aveva letto male i disegni ed aveva fatto costruire i vari locali IN POSIZIONI COMPLETAMENTE SBAGLIATE!! I cavi erano giusti, erano le stanze che si erano allontanate!!
Appena ho letto che i cavi non c'arrivavano ma anche ricontrollando i calcoli non trovavate l'errore la prima cosa che mi è venuta in mente era che l'edificio reale era stato costruito con dimensioni diverse da quelle che vi aspettavate voi :D

Certo, pensarci così, senza essere coinvolti e senza tutta quella pressione adosso è molto facile, ovviamente :)

Comunque gli aneddotti che hai riportato, più che situazioni di Real Life lavorativa sembrano raffinate torture progettate da qualche sadico Torquemada commissionate da satana come inferno personale per qualche anima disgraziata :asd:

sottovento
22-02-2013, 13:35
Comunque gli aneddotti che hai riportato, più che situazioni di Real Life lavorativa sembrano raffinate torture progettate da qualche sadico Torquemada commissionate da satana come inferno personale per qualche anima disgraziata :asd:

Si chiama Cina :D E... fossi in te non riderei poi troppo, perche' nel futuro di ognuno di noi c'e' la Cina. Prima o poi capitera' a tutti di doverci andare.
Cmq a parte questi episodi, in Cina non si sta poi cosi' male. Anzi, ora che sono in Russia mi manca pure....

banryu79
22-02-2013, 14:11
Si chiama Cina :D E... fossi in te non riderei poi troppo, perche' nel futuro di ognuno di noi c'e' la Cina. Prima o poi capitera' a tutti di doverci andare.
Cmq a parte questi episodi, in Cina non si sta poi cosi' male. Anzi, ora che sono in Russia mi manca pure....
Sì, un po' capisco, qualche anno fa ero lettore del blog di Tomcat "Te la do io la Cina" quindi...

Vincenzo1968
22-02-2013, 15:10
Una volta una cliente mi telefonò dicendomi:

"Corra subito qui che ho il video spaccato a metà!".
"E che faccio, le porto il video nuovo?"
"No no non c'è bisogno del video nuovo. Ma non riesco a lavorare col programma di contabilità perché ho il video spaccato a metà".
"E certo, come fa a lavorare senza video? Se è spaccato a metà..."
"No ma io il programma lo visualizzo. Solo che lo visualizzo spaccato a metà"
:confused:
"Vabbé, sto arrivando."

Arrivo e aveva l'applicazione spostata sullo schermo in modo che una parte della finestra fuoriuscisse dallo schermo, tipo così:

http://img341.imageshack.us/img341/1998/schermorotto.jpg

Probabilmente qualcuno le aveva fatto uno scherzo quando s'era allontanata un attimino dalla postazione.

banryu79
22-02-2013, 16:33
Giusto per folklore a questo punto bisogna tirare fuori la vecchia storia delle mail che non vanno oltre le 500 miglia...
http://www.ibiblio.org/harris/500milemail.html
No vabbè, dai! Questa è S-T-E-L-L-A-R-E! :mbe: :uh: :eekk: :sbonk:


It so happens that Sendmail 5--at least, the version that Sun shipped,
which had some tweaks--could deal with the Sendmail 8 sendmail.cf, as most
of the rules had at that point remained unaltered. But the new long
configuration options--those it saw as junk, and skipped. And the
sendmail binary had no defaults compiled in for most of these, so, finding
no suitable settings in the sendmail.cf file, they were set to zero.

Convetions over configuration: lesson learned! :read:


One of the settings that was set to zero was the timeout to connect to the
remote SMTP server. Some experimentation established that on this
particular machine with its typical load, a zero timeout would abort a
connect call in slightly over three milliseconds.

An odd feature of our campus network at the time was that it was 100%
switched. An outgoing packet wouldn't incur a router delay until hitting
the POP and reaching a router on the far side. So time to connect to a
lightly-loaded remote host on a nearby network would actually largely be
governed by the speed of light distance to the destination rather than by
incidental router delays.

Feeling slightly giddy, I typed into my shell:

$ units
1311 units, 63 prefixes

You have: 3 millilightseconds
You want: miles
* 558.84719
/ 0.0017893979

"500 miles, or a little bit more."

:eek: :cry: ... :doh:

banryu79
12-04-2013, 17:11
1801 - Joseph Marie Jacquard uses punch cards to instruct a loom to weave "hello, world" into a tapestry. Redditers of the time are not impressed due to the lack of tail call recursion, concurrency, or proper capitalization.

1842 - Ada Lovelace writes the first program. She is hampered in her efforts by the minor inconvenience that she doesn't have any actual computers to run her code. Enterprise architects will later relearn her techniques in order to program in UML.

1936 - Alan Turing invents every programming language that will ever be but is shanghaied by British Intelligence to be 007 before he can patent them.

1936 - Alonzo Church also invents every language that will ever be but does it better. His lambda calculus is ignored because it is insufficiently C-like. This criticism occurs in spite of the fact that C has not yet been invented.

1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

1957 - John Backus and IBM create FORTRAN. There's nothing funny about IBM or FORTRAN. It is a syntax error to write FORTRAN while not wearing a blue tie.

1958 - John McCarthy and Paul Graham invent LISP. Due to high costs caused by a post-war depletion of the strategic parentheses reserve LISP never becomes popular[1]. In spite of its lack of popularity, LISP (now "Lisp" or sometimes "Arc") remains an influential language in "key algorithmic techniques such as recursion and condescension"[2].

1959 - After losing a bet with L. Ron Hubbard, Grace Hopper and several other sadists invent the Capitalization Of Boilerplate Oriented Language (COBOL) . Years later, in a misguided and sexist retaliation against Adm. Hopper's COBOL work, Ruby conferences frequently feature misogynistic material.

1964 - John Kemeny and Thomas Kurtz create BASIC, an unstructured programming language for non-computer scientists.

1965 - Kemeny and Kurtz go to 1964.

1970 - Guy Steele and Gerald Sussman create Scheme. Their work leads to a series of "Lambda the Ultimate" papers culminating in "Lambda the Ultimate Kitchen Utensil." This paper becomes the basis for a long running, but ultimately unsuccessful run of late night infomercials. Lambdas are relegated to relative obscurity until Java makes them popular by not having them.

1970 - Niklaus Wirth creates Pascal, a procedural language. Critics immediately denounce Pascal because it uses "x := x + y" syntax instead of the more familiar C-like "x = x + y". This criticism happens in spite of the fact that C has not yet been invented.

1972 - Dennis Ritchie invents a powerful gun that shoots both forward and backward simultaneously. Not satisfied with the number of deaths and permanent maimings from that invention he invents C and Unix.

1972 - Alain Colmerauer designs the logic language Prolog. His goal is to create a language with the intelligence of a two year old. He proves he has reached his goal by showing a Prolog session that says "No." to every query.

1973 - Robin Milner creates ML, a language based on the M&M type theory. ML begets SML which has a formally specified semantics. When asked for a formal semantics of the formal semantics Milner's head explodes. Other well known languages in the ML family include OCaml, F#, and Visual Basic.

1980 - Alan Kay creates Smalltalk and invents the term "object oriented." When asked what that means he replies, "Smalltalk programs are just objects." When asked what objects are made of he replies, "objects." When asked again he says "look, it's all objects all the way down. Until you reach turtles."

1983 - In honor of Ada Lovelace's ability to create programs that never ran, Jean Ichbiah and the US Department of Defense create the Ada programming language. In spite of the lack of evidence that any significant Ada program is ever completed historians believe Ada to be a successful public works project that keeps several thousand roving defense contractors out of gangs.

1983 - Bjarne Stroustrup bolts everything he's ever heard of onto C to create C++. The resulting language is so complex that programs must be sent to the future to be compiled by the Skynet artificial intelligence. Build times suffer. Skynet's motives for performing the service remain unclear but spokespeople from the future say "there is nothing to be concerned about, baby," in an Austrian accented monotones. There is some speculation that Skynet is nothing more than a pretentious buffer overrun.

1986 - Brad Cox and Tom Love create Objective-C, announcing "this language has all the memory safety of C combined with all the blazing speed of Smalltalk." Modern historians suspect the two were dyslexic.

1987 - Larry Wall falls asleep and hits Larry Wall's forehead on the keyboard. Upon waking Larry Wall decides that the string of characters on Larry Wall's monitor isn't random but an example program in a programming language that God wants His prophet, Larry Wall, to design. Perl is born.

1990 - A committee formed by Simon Peyton-Jones, Paul Hudak, Philip Wadler, Ashton Kutcher, and People for the Ethical Treatment of Animals creates Haskell, a pure, non-strict, functional language. Haskell gets some resistance due to the complexity of using monads to control side effects. Wadler tries to appease critics by explaining that "a monad is a monoid in the category of endofunctors, what's the problem?"

1991 - Dutch programmer Guido van Rossum travels to Argentina for a mysterious operation. He returns with a large cranial scar, invents Python, is declared Dictator for Life by legions of followers, and announces to the world that "There Is Only One Way to Do It." Poland becomes nervous.

1995 - At a neighborhood Italian restaurant Rasmus Lerdorf realizes that his plate of spaghetti is an excellent model for understanding the World Wide Web and that web applications should mimic their medium. On the back of his napkin he designs Programmable Hyperlinked Pasta (PHP). PHP documentation remains on that napkin to this day.

1995 - Yukihiro "Mad Matz" Matsumoto creates Ruby to avert some vaguely unspecified apocalypse that will leave Australia a desert run by mohawked warriors and Tina Turner. The language is later renamed Ruby on Rails by its real inventor, David Heinemeier Hansson. [The bit about Matsumoto inventing a language called Ruby never happened and better be removed in the next revision of this article - DHH].

1995 - Brendan Eich reads up on every mistake ever made in designing a programming language, invents a few more, and creates LiveScript. Later, in an effort to cash in on the popularity of Java the language is renamed JavaScript. Later still, in an effort to cash in on the popularity of skin diseases the language is renamed ECMAScript.

1996 - James Gosling invents Java. Java is a relatively verbose, garbage collected, class based, statically typed, single dispatch, object oriented language with single implementation inheritance and multiple interface inheritance. Sun loudly heralds Java's novelty.

2001 - Anders Hejlsberg invents C#. C# is a relatively verbose, garbage collected, class based, statically typed, single dispatch, object oriented language with single implementation inheritance and multiple interface inheritance. Microsoft loudly heralds C#'s novelty.

2003 - A drunken Martin Odersky sees a Reese's Peanut Butter Cup ad featuring somebody's peanut butter getting on somebody else's chocolate and has an idea. He creates Scala, a language that unifies constructs from both object oriented and functional languages. This pisses off both groups and each promptly declares jihad.
---
[1] Fortunately for computer science the supply of curly braces and angle brackets remains high.
[2] Catch as catch can (http://www.theregister.co.uk/2006/01/11/exception_handling/) - Verity Stob
---

:D :asd:

Quelle sul C++ e su PHP mi hanno fatto piangere dalle risate!

kwb
12-04-2013, 17:23
1972 - Dennis Ritchie invents a powerful gun that shoots both forward and backward simultaneously. Not satisfied with the number of deaths and permanent maimings from that invention he invents C and Unix.

:asd: Migliore

marco.r
12-04-2013, 22:58
non ci credo...dai non è possibile. anche nei "acces for dummies" da 5€ ci sono le chiavi...questi qui come caxxo si sono diplomati/laureati???

Resto sconcertato

C'e' anche chi esagera in senso opposto.
Ho avuto la fortuna una volta di mettere mano a DB dove alcune tabelle avevano come chiave primaria 7 colonne, di cui 6 colonne di testo e una autoincrementante :mbe:.
La ciliegina sulla torta era che la tabella era in relazione molti a molti con se stessa... ovviamente con una tabella di mapping di 14 colonne :muro:

cdimauro
13-04-2013, 08:18
Mi sento meno solo. :D

Ho avuto a che fare anche con gente che pretendeva di mettere un indice in un campo di DUE soli valori, e in una discussione verbale con tutti i colleghi che guardavano e ascoltavano impietriti visti i toni, mi si arriva a dire: "ma allora mi vuoi dire che non capisco niente di database?". Ho preferito tornare a sedere sulla mia postazione chiudendo il mega flame...

shinya
13-04-2013, 10:30
C'e' anche chi esagera in senso opposto.
Ho avuto la fortuna una volta di mettere mano a DB dove alcune tabelle avevano come chiave primaria 7 colonne, di cui 6 colonne di testo e una autoincrementante :mbe:.
La ciliegina sulla torta era che la tabella era in relazione molti a molti con se stessa... ovviamente con una tabella di mapping di 14 colonne :muro:
Not bad!

Mi sento meno solo. :D

Ho avuto a che fare anche con gente che pretendeva di mettere un indice in un campo di DUE soli valori, e in una discussione verbale con tutti i colleghi che guardavano e ascoltavano impietriti visti i toni, mi si arriva a dire: "ma allora mi vuoi dire che non capisco niente di database?". Ho preferito tornare a sedere sulla mia postazione chiudendo il mega flame...
Beh forse un indice bitmap (mai usati) avrebbe avuto un qualche senso... ma immagino non sia questo il caso :)

cdimauro
13-04-2013, 20:15
No, era un campo varchar che veniva popolato con 2 valori, e che al 99,9999% sarebbero rimasti tali.

Tra l'altro anche se definisci il campo come ENUM per gli engine SQL che lo consentono (ed era quello il caso, visto che usavamo MySQL), pochi usano una struttura raffinata come una bitmap per gli indici definiti su elenco di due soli valori. Idem se al posto del varchar/enum si usasse un BOOLEAN (non supportato da tutti gli engine SQL). Anche perché ci sarebbe da considerare i valori NULL (al che 1 solo bit non basterebbe più, visto che i "valori" sarebbero tre e non due).

Comunque discussioni di questo tipo sono arabo per chi, imparato a eseguire qualche SELECT, INSERT o DELETE, e si sente già un esperto di database. Pensa che in un'azienda non conoscevano nemmeno le foreign key e l'integrità referenziale, pur usando un engine SQL che lo consentiva, e quando c'era da cancellare dei record su una o più tabelle, c'erano pagine di script PHP per simulare a manina il delete a cascata. E parliamo di foreign key: immagina tutto il resto (transazioni, stored procedure, trigger, view).

The_ouroboros
14-04-2013, 10:19
No, era un campo varchar che veniva popolato con 2 valori, e che al 99,9999% sarebbero rimasti tali.

Tra l'altro anche se definisci il campo come ENUM per gli engine SQL che lo consentono (ed era quello il caso, visto che usavamo MySQL), pochi usano una struttura raffinata come una bitmap per gli indici definiti su elenco di due soli valori. Idem se al posto del varchar/enum si usasse un BOOLEAN (non supportato da tutti gli engine SQL). Anche perché ci sarebbe da considerare i valori NULL (al che 1 solo bit non basterebbe più, visto che i "valori" sarebbero tre e non due).

Comunque discussioni di questo tipo sono arabo per chi, imparato a eseguire qualche SELECT, INSERT o DELETE, e si sente già un esperto di database. Pensa che in un'azienda non conoscevano nemmeno le foreign key e l'integrità referenziale, pur usando un engine SQL che lo consentiva, e quando c'era da cancellare dei record su una o più tabelle, c'erano pagine di script PHP per simulare a manina il delete a cascata. E parliamo di foreign key: immagina tutto il resto (transazioni, stored procedure, trigger, view).

:doh: da terzo mondo informatico

P.S:ma, lo stesso, se gli fai notare gli orrori che commettono, certe persone si offendono pure (come facevi notare)

banryu79
19-07-2013, 14:57
E' da un po' che non posto nulla in questo thread, così ne aprofitto per tornare a bomba in modo degno. Stavolta si parla di "orrori" nel campo dell'industria dello sviluppo di videogiochi tripla A.
Per capirci le situazioni descritte sono contestualizzate nel delicato periodo pre-distributivo di un videogioco; strani bug e improbabili glitch che scoppiano in faccia al team di sviluppo proprio quando ormai non c'è quasi più tempo per affrontare l'imprevisto...

La prima storia, ribatezzata: "Hash Clash"

---

Identity Crisis

This scene is familiar to all game developers: It's the day we're sending out the gold candidate for our Xbox 1 game. The whole team is playtesting the game all day long, making sure everything looks good. It's fun, it's solid, it's definitely a go in our minds.

In the afternoon, we make the last build with the last few game-balancing tweaks, and do one last playthrough session when disaster strikes: The game crashes hard! We all run to our workstations, fire up the debugger, and try to figure out what's going on. It's not something trivial, like an assert, or even something moderately hard to track down, like a divide by zero. It looks like memory is garbage in a few places, but the memory reporting comes out clean. What's going on?

One dinner and many hours later, our dreams of getting out on time shattered, we manage to track it down to one data file being loaded in with the wrong data. The wrong data? How's that possible? Our resource system boiled down every asset to a 64-bit identifier made out of the CRC32 of the full filename and the CRC32 of all the data contents. That was also our way of collapsing identical resource files into a single one in the game. With tens of thousands of files, and two years of development, we never had a conflict. Never.

Until now, that is.

It turns out that one of the innocent tweaks the designers had checked in that afternoon made it so a text file had the exact same filename and data CRC as another resource file, even though they were completely different!

Our hearts sank to our feet when we recognized the problem. There's no way we could change the resource indexing system in such a short period of time. Even if we pulled an all-nighter, there was no way to know for sure that everything would be stable in the morning.

Then, as quickly as despair swept over us, we realized how we could fix this on time for the gold candidate release. We opened up the text file responsible for the conflict, added a space at the end, and saved it. We looked at each other with huge grins on our faces and said:

"Ship it!"

- Noel Llopis

---

:)

biffuz
19-07-2013, 15:34
Che ne dite invece di una richiesta urgente per delle statistiche precise basate su un campo data a testo libero, in cui per mesi degli operatori hanno scritto le date nel formato che volevano, incluse date errate, cose a caso perché non sapevano cosa rispondere, o cose tipo "ieri", "dopodomani", "tra una settimana (circa)", o "il mese scorso"?

banryu79
19-07-2013, 15:52
Che ne dite invece di una richiesta urgente per delle statistiche precise basate su un campo data a testo libero, in cui per mesi degli operatori hanno scritto le date nel formato che volevano, incluse date errate, cose a caso perché non sapevano cosa rispondere, o cose tipo "ieri", "dopodomani", "tra una settimana (circa)", o "il mese scorso"?
ROTF!!! Oddio, ho le lacrime agli occhi dalle risate :sbonk:

EDIT: che, avete pensato a Skynet per il parsing di quei campi? :asd:

banryu79
23-07-2013, 13:08
Altra storia dal mondo del game development

---

Driving Under the Influence

I've been tasked with taking care of a system dealing with vehicles, which is a fairly major part of our current game. Fortunately, we were able to grab the majority of the code from another studio. Unfortunately, the code isn't always perfect or well written, as is the perception with most code you don't write personally. I happened to find this nice bit of code that was simply trying to get a variable from the engine loop, but was going about it in the most backward way possible (See Listing 1).

Listing 1: Driving Under the Influence
//**************************************************
// Function: AGameVehicle::Debug_GetFrameCount
//
//! A very hacky method to get the current frame count; the variable is protected.
//!
//! \return The current frame number.
//**************************************************
UINT AGameVehicle::Debug_GetFrameCount()
{
BYTE* pEngineLoop = (BYTE*)(&GEngineLoop);
pEngineLoop += sizeof( Array<FLOAT> ) + sizeof(DOUBLE );
INT iFrameCount = *((INT*)pEngineLoop);
return iFrameCount;
}

The funniest part about this chunk of incredibly gross code is that there was a simple function on that object to get the frame count. Even if there weren't, the person who wrote this code could have easily added one himself! Needless to say, this code was not added to my game, nor to the game this code was taken from, as soon as I pointed it out. If this isn't an example of why code reviews are good, I don't know what is.

- Austin McGee

---

E ho anche uno slogan: aritmetica dei puntatori, se non ne abusi godi solo a metà! :asd:

franksisca
23-07-2013, 14:45
è fantastico!!!

biffuz
23-07-2013, 14:56
UINT AGameVehicle::Debug_GetFrameCount()
{
BYTE* pEngineLoop = (BYTE*)(&GEngineLoop);
pEngineLoop += sizeof( Array<FLOAT> ) + sizeof(DOUBLE );
INT iFrameCount = *((INT*)pEngineLoop);
return iFrameCount;
}


Ringraziando il cielo che non hanno scritto solo

return *((INT*)(((BYTE*)(&GEngineLoop)) + 14));

banryu79
24-07-2013, 15:54
Questa dev'essere leggendaria, nell'ambiente :asd:

---

Meet My Dog, Patches

There's an old joke that goes something like this:

Patient: "Doctor, it hurts when I do this."
Doctor: "Then stop doing it."

Funny, but are these also wise words when applied to the right situation? Consider the load of pain I found myself in when working on a conversion of a 3D third person shooter from the PC to the original PlayStation.

Now, the PS1 has no support for floating point numbers, so we were doing the conversion by basically recompiling the PC code and overloading all floats with fixed point. That actually worked fairly well, but were it fell apart was in collision detection.

The level geometry that was supplied to us worked reasonably well in the PC version of the game, but when converted to fixed point, all kinds of seams, T-Junctions and other problems were nudged into existence by the microscopic differences in values between fixed and floats. This problem would manifest itself by the main character (called "Damp") simply falling through those tiny holes, into the abyss below the level.

We patched the holes we found, tweaking the geometry until Damp no longer fell through. But then the game went into test at the publisher, and suddenly a flood of "falling off the world" bugs were delivered to us. Every day a fresh batch of locations were found with these little holes that Damp could slip through. We would fix that bit of geometry, then the next day they would send us ten more. This went on for several days. The publisher's test department employed one guy whose only job was to jump around the world for ten hours a day, looking for places he could fall through.

The problem here was that the geometry was bad. It was not tight and seamless geometry. It worked on the PC, but not on the PS1, where the fixed point math vastly magnified the problems. The ideal solution was to fix the geometry to make it seamless.

However, this was a vast task, impossible to do in the time available with our limited resources, so we were relying on the test department to find the problem areas for us.

The problem with that approach was that they never stopped finding them. Every day bought more pain. Every day new variants of the same bug. It seemed like it would never end.

Eventually the penny dropped. The real problem was not that the geometry had small holes in it. The problem was that Damp fell through those holes. With that in mind, I was able to code a very quick and simple fix that looked something like:

IF (Damp will fall through a hole()) THEN
Don't do it

The actual code was not really much more complex than that (see Listing 2).

Listing 2: Meet My Dog, Patches

damp_old = damp_loc;
move_damp();
if (NoCollision())
{
damp_loc = damp_old;
}

In one swoop a thousand bugs were fixed. Now instead of falling off the level, Damp would just shudder a bit when he walked over the holes. We found what was hurting us, and we stopped doing it. The publisher laid off their "jump around" tester, and the game shipped.

Well, it shipped eventually. Spurred on by the success of "if A==bad then NOT A", I used this tool to patch several more bugs -- which nearly all had to do with the collision code. Near the end of development the bugs became more and more specific, and the fixes became more and more "Don't do thispreciseandexacthing" (see Listing 3, actual shipped code).

Listing 3: Meet My Dog, Patches

if (damp_aliencoll != old_aliencoll &&
strcmpi("X4DOOR",damp_aliencoll->enemy->ename)==0 &&
StartArena == 6 && damp_loc.y<13370)
{
damp_loc.y = damp_old.y; // don't let damp ever touch the door.. (move away in the x and y)
damp_loc.x = damp_old.x;
damp_aliencoll = NULL; // and say thusly!!!
}

What does that code do? Well, basically there was a problem with Damp touching a particular type of door in a particular level in a particular location, rather than fix the root cause of the problem, I simply made it so that if Damp ever touched the door, then I'd move him away, and pretend it never happened. Problem solved.

Looking back I find this code quite horrifying. It was patching bugs and not fixing them. Unfortunately the real fix would have been to go and rework the entire game's geometry and collision system specifically with the PS1 fixed point limitations in mind. The schedule was initially aggressive, so we always seemed close to finishing, so the quick patch always won over the comprehensive, expensive fix.

But it did not go well. Hundreds of patches were needed, and then the patches themselves started causing problems, so more patches were added to turn off the patches in hyper-specific circumstances. The bugs kept coming, and I kept beating them back with patches. Eventually I won, but at a cost of shipping several months behind schedule, and working 14 hour days for all of those several months.

That experience soured me against "the patch." Now I always try to dig right down to the root cause of a bug, even if a simple, and seemingly safe, patch is available. I want my code to be healthy. If you go to the doctor and tell him "it hurts when I do this," then you expect him to find out why it hurts, and to fix that. Your pain and your code's bugs might be symptoms of something far more serious. The moral: Treat your code like you would want a doctor to treat you.

- Mick West

---

kwb
25-07-2013, 10:45
Divertente! :D

banryu79
25-07-2013, 15:37
Divertente! :D

Colpisco ancora con una short story allora...

---

10-Tative Code

Back at [company X], I think it was near the end of [the project], we had an object in one of the levels that needed to be hidden. We didn't want to re-export the level and we did not use checksum names. So right smack in the middle of the engine code we had something like the following. The game shipped with this in.

if( level == 10 && object == 56 )
{
HideObject();
}

Maybe a year later, an artist using our engine came to us very frustrated about why an object in their level was not showing up after exporting to what resolved to level 10. I wonder why?

- Anonymous

---

biffuz
25-07-2013, 15:47
Ah beh, cose del genere ai programmatori capitano praticamente tutti i giorni :D

franksisca
25-07-2013, 15:51
Ah beh, cose del genere ai programmatori capitano praticamente tutti i giorni :D

la classica frase "ma tanto noi ci abbiamo messo le mani e ce lo ricordiamo..."

biffuz
25-07-2013, 16:06
la classica frase "ma tanto noi ci abbiamo messo le mani e ce lo ricordiamo..."

A volte fanno 'ste cose in librerie condivise che al momento usano solo loro, coinvinti che i progetti precedenti non servano più a nessuno, peccato che poi se lo dimenticano e quando devono fare un altro progetto ne copiano uno vecchio "ma non capisco, prima funzionava!"

kwb
25-07-2013, 16:51
Ma ste storielle da dove le prendete? Perchè alcune mi sembrano veramente impossibili che siano successe..
Cioè, se io facessi il programmatore di professione, mi sentirei moralmente a disagio a fare delle cose del genere ( Ok che ci sono delle scadenze da rispettare, però un po' di pianificazione e rigore nello sviluppo di un'applicazione credo siano assolutamente necessarie ).

franksisca
25-07-2013, 17:12
Ma ste storielle da dove le prendete? Perchè alcune mi sembrano veramente impossibili che siano successe..
Cioè, se io facessi il programmatore di professione, mi sentirei moralmente a disagio a fare delle cose del genere ( Ok che ci sono delle scadenze da rispettare, però un po' di pianificazione e rigore nello sviluppo di un'applicazione credo siano assolutamente necessarie ).

dici questo perchè non hai delle scadenze :fagiano: :fagiano: :fagiano: ho trovato (e scritto) delle porcate assurde che spero nessuno un giorno vada a correggere, per rispettare tempi di consegna e specifiche assurde

biffuz
25-07-2013, 17:17
dici questo perchè non hai delle scadenze :fagiano: :fagiano: :fagiano: ho trovato (e scritto) delle porcate assurde che spero nessuno un giorno vada a correggere, per rispettare tempi di consegna e specifiche assurde

Io sono uno di quelli a cui dicono sempre "sì fai dei bei programmi, ma potresti evitare la prossima volta e cercare solo di essere più veloce?"

kwb
25-07-2013, 19:26
dici questo perchè non hai delle scadenze :fagiano: :fagiano: :fagiano: ho trovato (e scritto) delle porcate assurde che spero nessuno un giorno vada a correggere, per rispettare tempi di consegna e specifiche assurde

Ma dai, la penultima postata da banryu è veramente incredibile. In quel caso o non si conosceva bene il dispositivo su cui si andava a fare il porting ( nel caso, conoscenza a livello hardware della PS1 ) - quindi mancanza del programmatore - oppure le specifiche non sono state date tutte subito all'inizio del progetto - mancanza di chi ha commissionato - perchè altrimenti non si spiega questo approccio.
Se si sapeva fin dall'inizio che la PS1 non funzioanva coi floating point, allora perchè creare un sistema tutto floating point notation?
Se si è saputo dopo, allora inutile accanirsi a risolvere un problema di progettazione entro la data di scadenza, piuttosto spostarla.. ( ok è difficile, però almeno spiegare, a chi ha commissionato, il problema di fondo e del perchè non utilizzando la soluzione migliore andrà a vendere un prodotto che nessuno vorrà perchè penoso ).

Personalmente, in qualunque cosa che faccio, o la faccio bene ( al meglio delle mie possibilità, sfruttando tutte le conoscenze che ho sulla materia ) oppure se mi rendo conto che non si può lascio stare e faccio fare ad altri il lavoro sporco :asd:

wingman87
25-07-2013, 21:37
Il problema è che di persone che hanno le palle e/o la possibilità di dire al cliente che certe cose non si possono fare quando la realtà è che sarebbe troppo oneroso e/o stupido farle non ce ne sono molte.
Nella storia della ps1 chiaramente andava detto sin dal principio che o si riscriveva quella parte di codice come dio comanda o non si poteva procedere. Secondo me.

cdimauro
26-07-2013, 08:01
Infatti il problema più grosso dei programmatori sono i manager/accounter/venditori. Risolvere problemi è una bazzecola paragonato all'effort necessario a far capire a qualcuno di loro una questione come quella di cui si sta parlando.

Ovviamente non sono tutti così. Ho conosciuto manager davanti ai quali si può stendere il tappeto rosso per le conoscenze tecniche che hanno, perché magari hanno fatto la gavetta come programmatori o hanno avuto la possibilità di acquisire know-how in materia.

Comunque quella dell'hidden object è, sì, una dimostrazione di pragmatismo, ma mi fa capire che vale il vecchio detto: "tutto il mondo è paese". Di trovate grossolane e intrinsecamente scorrette ce ne sono anche in ambienti che non ti aspetteresti mai. :D

banryu79
26-07-2013, 09:45
Ma ste storielle da dove le prendete? Perchè alcune mi sembrano veramente impossibili che siano successe..

Tutte queste ultime "storielle" ambientate nel variopinto mondo del game development (e ricordo che parliamo di roba AAA :D o indie ma di un certo spessore) le ho prese direttamente da articoli di Gamasutra :D

Cioè, se io facessi il programmatore di professione, mi sentirei moralmente a disagio a fare delle cose del genere ( Ok che ci sono delle scadenze da rispettare, però un po' di pianificazione e rigore nello sviluppo di un'applicazione credo siano assolutamente necessarie ).
Benvenuto nella realtà: quella che esiste la fuori e che, spesso e volentieri, è diversa da ciò che diamo per scontato o crediamo di sapere del mondo tutto :asd:

banryu79
26-07-2013, 09:54
Questa, a quanto pare, ha proprio "fatto scuola" nell'ambiente.
E visti i tuoi ultimi commenti kwb, probabilmente ti prenderà un colpo :asd:

---

The Programming Antihero

I was fresh out of college, still wet behind the ears, and about to enter the beta phase of my first professional game project -- a late-90s PC title. It had been an exciting rollercoaster ride, as projects often are. All the content was in and the game was looking good. There was one problem though: We were way over our memory budget.

Since most memory was taken up by models and textures, we worked with the artists to reduce the memory footprint of the game as much as possible. We scaled down images, decimated models, and compressed textures. Sometimes we did this with the support of the artists, and sometimes over their dead bodies.

We cut megabyte after megabyte, and after a few days of frantic activity, we reached a point where we felt there was nothing else we could do. Unless we cut some major content, there was no way we could free up any more memory. Exhausted, we evaluated our current memory usage. We were still 1.5 MB over the memory limit!

At this point one of the most experienced programmers in the team, one who had survived many years of development in the "good old days," decided to take matters into his own hands. He called me into his office, and we set out upon what I imagined would be another exhausting session of freeing up memory.

Instead, he brought up a source file and pointed to this line:

static char buffer[1024*1024*2];

"See this?" he said. And then deleted it with a single keystroke. Done!

He probably saw the horror in my eyes, so he explained to me that he had put aside those two megabytes of memory early in the development cycle. He knew from experience that it was always impossible to cut content down to memory budgets, and that many projects had come close to failing because of it. So now, as a regular practice, he always put aside a nice block of memory to free up when it's really needed.

He walked out of the office and announced he had reduced the memory footprint to within budget constraints -- he was toasted as the hero of the project.

As horrified as I was back then about such a "barbaric" practice, I have to admit that I'm warming up to it. I haven't gotten into the frame of mind where I can put it to use yet, but I can see how sometimes, when you're up against the wall, having a bit of memory tucked away for a rainy day can really make a difference. Funny how time and experience changes everything.

- Noel Llopis

---

L'ho ribattezzata: "Truccone spannometrico del nonno"! :D



...



Una chicca, posto un commento presente in calce all'articolo da cui ho estratto questa storiella, pubblicato da un certo Ken Demarest (Wing Commander):

Ken Demarest
Back on Wing Commander 1 we were getting an exception from our EMM386 memory manager when we exited the game. We'd clear the screen and a single line would print out, something like "EMM386 Memory manager error. Blah blah blah." We had to ship ASAP. So I hex edited the error in the memory manager itself to read "Thank you for playing Wing Commander."

:)

Sempre per kwb, tra i commenti ne ho trovata una (di "storiella") che potremmo presentare così: "Bug Driven Game Design" :asd:
Occhio alla genialata:

Maurício Gomes

And I was thinking that only newbies like me shipped those horrendous code... :P

At university there was a team (not related to me, but these guys are the perfect example :P) that made a FPS flash game...

For some bizarre reason, the programmer instead of checking if you was colliding with the wall and not allow you go there, he made the inverse, he checked if there was a wall, and allowed you to move parallel to it...

This sparked a bizarre bug: In crossings, you could not actually cross, only turn to the passage on your left or right.

The deadline was closing, and they had no idea on how to fix it...

Then the team writer fixed the issue! He told the artist to draw a animation of hands touching the walls, and then he wrote in the story that the protagonist was blind and needed to touch the walls to know where he was going.

Signore e signori: Bug Driven Game Design!

franksisca
26-07-2013, 10:18
dai arrivare a cambiare tutto per un bug....EPICO!!!

comuqnue è vero, la realtà è tristemente triste

kwb
26-07-2013, 11:49
The Programming Antihero

I was fresh out of college, still wet behind the ears, and about to enter the beta phase of my first professional game project -- a late-90s PC title. It had been an exciting rollercoaster ride, as projects often are. All the content was in and the game was looking good. There was one problem though: We were way over our memory budget.

Since most memory was taken up by models and textures, we worked with the artists to reduce the memory footprint of the game as much as possible. We scaled down images, decimated models, and compressed textures. Sometimes we did this with the support of the artists, and sometimes over their dead bodies.

We cut megabyte after megabyte, and after a few days of frantic activity, we reached a point where we felt there was nothing else we could do. Unless we cut some major content, there was no way we could free up any more memory. Exhausted, we evaluated our current memory usage. We were still 1.5 MB over the memory limit!

At this point one of the most experienced programmers in the team, one who had survived many years of development in the "good old days," decided to take matters into his own hands. He called me into his office, and we set out upon what I imagined would be another exhausting session of freeing up memory.

Instead, he brought up a source file and pointed to this line:

static char buffer[1024*1024*2];

"See this?" he said. And then deleted it with a single keystroke. Done!

He probably saw the horror in my eyes, so he explained to me that he had put aside those two megabytes of memory early in the development cycle. He knew from experience that it was always impossible to cut content down to memory budgets, and that many projects had come close to failing because of it. So now, as a regular practice, he always put aside a nice block of memory to free up when it's really needed.

He walked out of the office and announced he had reduced the memory footprint to within budget constraints -- he was toasted as the hero of the project.

As horrified as I was back then about such a "barbaric" practice, I have to admit that I'm warming up to it. I haven't gotten into the frame of mind where I can put it to use yet, but I can see how sometimes, when you're up against the wall, having a bit of memory tucked away for a rainy day can really make a difference. Funny how time and experience changes everything.

- Noel Llopis

Questa si chiama prevenzione! :D


Una chicca, posto un commento presente in calce all'articolo da cui ho estratto questa storiella, pubblicato da un certo Ken Demarest (Wing Commander):

:rotfl: :eek:


Sempre per kwb, tra i commenti ne ho trovata una (di "storiella") che potremmo presentare così: "Bug Driven Game Design" :asd:
Occhio alla genialata:

Signore e signori: Bug Driven Game Design!
Non c'è male anche con questa :asd:
Però c'è da dire che c'è da inchinarsi all'idea geniale finale ( anche se il resto dell'approccio al problema è risultato essere non proprio ottimale ).

biffuz
26-07-2013, 13:57
Successo a me.

da una enorme tabella piena di eventi (migliaia di linee al giorno, per anni) bisognava estrarre gli eventi accaduti nei giorni festivi in un dato anno.

Paolo: "Mario, tu che ti intendi di query, puoi fare questa cosa? Io non so dove sbattere la testa. Ah, serve entro domani."

Mario: "Ma è facilissimo Paolo, lo faccio subito, guarda!"

Soluzione di Mario (in pseudocode giusto per rendere l'idea):


result = Query("SELECT * FROM MegaTabella WHERE YEAR(data) = " + anno + " ORDER BY data DESC").execute(); // 1M risultati, svariati minuti su un server Xeon con so quante CPU, 100 MB di risultati
while (result.hasNext()) {
riga = result.next();
data = riga.field("data");
giorno = EstraiGiorno(data);
mese = EstraiMese(mese);
if ((giorno == 1 && mese == 1) ||
(giorno == 6 && mese == 1) ||
(giorno == 25 && mese == 4) ||
(giorno == 1 && mese == 5) ||
(giorno == 15 && mese == 8) ||
(giorno == 25 && mese == 12) ||
(giorno == EstraiGiorno(CalcolaPasqua(anno) && mese == EstraiMese(CalcolaPasqua(anno))) {
FaiIlTuoBelCalcolo(riga);
}
else {
// 99% delle righe finisce qua
}
}



Risultato: la query rallentava tutto il database, a volte andava in timeout o faceva andare in timeout altre query o schiantava la VM per poca RAM.

Paolo: "lo sapevo che quell'imbecille di Mario faceva casino, ma dove ha imparato a programmare, ora sistemo tutto io"

Fix di Paolo:


result = Query("SELECT * FROM MegaTabella WHERE YEAR(data) = " + anno + " ORDER BY data DESC").execute(); // 500k+ risultati, svariati minuti su un server Xeon con so quante CPU, 100 MB di risultati
while (result.hasNext()) {
riga = result.next();
data = riga.field("data");
giorno = EstraiGiorno(data);
mese = EstraiMese(mese);
pasqua = CalcolaPasqua(anno);
giornoPasqua = EstraiGiorno(pasqua);
mesePasqua = EstraiMese(pasqua);
if ((giorno == 1 && mese == 1) ||
(giorno == 6 && mese == 1) ||
(giorno == 25 && mese == 4) ||
(giorno == 1 && mese == 5) ||
(giorno == 15 && mese == 8) ||
(giorno == 25 && mese == 12) ||
(giorno == giornoPasqua && mese == mesePasqua) {
FaiIlTuoBelCalcolo(riga);
}
else {
// 99% delle righe finisce qua
}
}


Risultato: Ovviamente non è cambiato nulla, ma hanno diminuito i crash incrementando la RAM della VM.

Alla fine la palla è passata a me. La mia soluzione:


query = Quey("SELECT <campi che ci servono> FROM MegaTabella LEFT JOIN Festivita ON MegaTabella.data = Festivita.data WHERE YEAR(MegaTabella.data) = $1 ORDER BY MegaTabella.data DESC"); // Nota: la tabella Festivita è sempre esistita
query.setParameter(1, anno);
result = query.execute(); // Pochi secondi, qualche centinaio di righe, pochi kB
while (result.hasNext()) {
FaiIlTuoBelCalcolo(result.next());
}

banryu79
26-07-2013, 14:41
Successo a me.
... snip ...

WTF? + ROLF + OMG! + LOL etc...

Potrebbe essere lo sketch di una qualche serie comica per nerd! :D

banryu79
29-07-2013, 14:34
Questa "storiella" non so bene come classificarla, perchè non ha a che fare con bug e/o tecnicismi vari, rientra piuttosto nella "gestione del personale" e la vedo come una sorta di trucco o hack psicologico :D

---

You Wouldn't Like Me When I'm Angry

I once worked at THQ studio Relic Entertainment on The Outfit, which some may remember as one of the earlier games for the Xbox 360. We started with a PC engine (single-threaded), and we had to convert it to a complete game on a next-gen multi-core console in about 18 months. About three months before shipping, we were still running at about 5 FPS on the 360. Obviously this game needed some severe optimization.

When I did some performance measurements, it became clear that as much as the code was slow and very "PC," there were also lots of problems on the content side as well. Some models were too detailed, some shaders were too expensive, and some missions simply had too many guys running around.

It's hard to convince a team of 100 people that the programmers can't simply "fix" the performance of the engine, and that some of the ways people had gotten used to working to needed to be changed. People needed to understand that the performance of the game was everybody's problem, and I figured the best way to do this is with a bit of humor that had a bit of hidden truth behind it.

The solution took maybe an hour. A fellow programmer took four pictures of my face -- one really happy, one normal, one a bit angry, and one where I am pulling my hair out. I put this image in the corner of the screen, and it was linked to the frame rate. If the game ran at over 30fps, I was really happy, if it ran below 20, I was angry.

After this change, the whole FPS issue transformed from, "Ah, the programmers will fix it." to, "Hmm, if I put this model in, Nick is going to be angry! I'd better optimize this a little first." People could instantly see if a change they made had an impact on the frame rate, and we ended up shipping the game at 30fps.

- Nick Waanders

---

Della serie: emoticons on steroid!

banryu79
30-07-2013, 08:40
Altra storia di bug fixing "by chance", per così dire...

---

This is not the bug you're looking for

Brett Douville, LucasArts

In early 2002, we were readying Star Wars: Jedi Starfighter for submission to Sony. One niggling TCR bug remained, which was that the controller's analog stick functionality would shut off while we were loading our post-mission cutscenes, causing the red light in the center of the controller to go off as well. This bug had shown up when we updated to a library version required by Sony, and the programmer who had originally written both the movie-loading code and the IOP logic for the controller itself had left LucasArts some months before.

In the hopes of narrowing down the problem quickly in code I didn't understand, I inserted seven screen clears in different colors in the code I determined to be the likely source of the problem, hoping that I could at least narrow it down to one or two sections of code by checking what color the screen was when the analog controls turned off. But when I then tried to reproduce the bug, it had disappeared.

It's an old programming adage that if you don't understand the cause, you can't be said to have fixed the bug. But in this case, we were two or three days away from our intended submission date and missing it would have been a big deal. So I changed all the screen clears to black, marked the bug fixed, and called it a day. We shipped on time, with no TCR showstoppers.

---

e questa invece, racconta di un hack della madonna (buffer overflow design!)...

---

(s)elf-exploitation

Jonathan Garrett, Insomniac Games

Ratchet and Clank: Up Your Arsenal was an online title that shipped without the ability to patch either code or data. Which was unfortunate.

The game downloads and displays an End User License Agreement each time it's launched. This is an ascii string stored in a static buffer. This buffer is filled from the server without checking that the size is within the buffer's capacity.

We exploited this fact to cause the EULA download to overflow the static buffer far enough to also overwrite a known global variable. This variable happened to be the function callback handler for a specific network packet. Once this handler was installed, we could send the network packet to cause a jump to the address in the overwritten global. The address was a pointer to some payload code that was stored earlier in the EULA data.

Valuable data existed between the real end of the EULA buffer and the overwritten global, so the first job of the payload code was to restore this trashed data. Once that was done things were back to normal and the actual patching work could be done.

One complication is that the EULA text is copied with strcpy. And strcpy ends when it finds a 0 byte (which is usually the end of the string). Our string contained code which often contains 0 bytes. So we mutated the compiled code such that it contained no zero bytes and had a carefully crafted piece of bootstrap asm to un-mutate it.

By the end, the hack looked like this:

1. Send oversized EULA
2. Overflow EULA buffer, miscellaneous data, callback handler pointer
3. Send packet to trigger handler
4. Game jumps to bootstrap code pointed to by handler
5. Bootstrap decodes payload data
6. Payload downloads and restores stomped miscellaneous data
7. Patch executes

Takeaways: Include patching code in your shipped game, and don't use unbounded strcpy.

---

grigor91
30-07-2013, 15:15
...
Alla fine la palla è passata a me. La mia soluzione:


query = Quey("SELECT <campi che ci servono> FROM MegaTabella LEFT JOIN Festivita ON MegaTabella.data = Festivita.data WHERE YEAR(MegaTabella.data) = $1 ORDER BY MegaTabella.data DESC"); // Nota: la tabella Festivita è sempre esistita
query.setParameter(1, anno);
result = query.execute(); // Pochi secondi, qualche centinaio di righe, pochi kB
while (result.hasNext()) {
FaiIlTuoBelCalcolo(result.next());
}


OT:
Scusa ma non ci dovrebbe essere una INNER JOIN invece che una LEFT JOIN?

biffuz
30-07-2013, 20:06
OT:
Scusa ma non ci dovrebbe essere una INNER JOIN invece che una LEFT JOIN?

Sì, giusto, non è il codice vero d'altronde, non ci ho pensato troppo quando ho scritto il post. Neanche mi aspettavo che qualcuno lo leggesse a fondo :D

banryu79
01-08-2013, 12:57
E per chiudere in bellezza, prima di partire per le vacanze (che faccio rigorosamente off-line) posto questa perla. Quanti di voi conoscono il famoso Dalton allocator per la memoria? :)

---

The Dalton Allocator

Jonathan Adamczewski, Insomniac Games

Toward the end of one project, we discovered that after playing through the game for many hours, movies would not trigger when they were supposed to. Fragmentation within one of our memory allocation heaps had made it impossible to reliably allocate the large blocks of memory that were needed for full-screen movie playback.

We needed to find a way to be sure that we could always get the memory we needed. However, it was too late in the project and too risky to consider defragmentation of the heap, we didn't have enough spare memory available to set aside exclusively for movie playback, and taking space away from other systems at that stage was impractical.

It was clear that when movies were playing, there were many other systems sitting idle, so we gave some consideration to "borrowing" memory from them. However, these other potential sources were either too small, or else also suffered from the same kind of fragmentation problems that we were already seeing. There was plenty of free space available for the GPU, but for various reasons we could not use that for the movie-playback buffers. So we needed another source of space.

While looking into another problem, a particular pattern of memory allocations within our main game-asset heap stood out: When the game started up, a number of assets were loaded from disk, and once in memory were never modified. Some of those assets were very large. None of them were needed while a movie was playing.

This gave us an idea: What if we were to copy the contents of one of the larger asset files to somewhere else in memory? The GPU's memory would work just fine as a place to temporarily stash the asset, and then we could temporarily reuse the space in the asset heap for movie playback, copying the asset data back from GPU memory when the movie finished.

So that's what we did. We chose the largest set of animation clips used for one of the game's heroes (named Dalton). The animation system was switched off, animation clips copied into the GPU's memory space, and the memory handed to the movie-playback system. At the end of the movie, the animation data was copied back to where it belonged, the animation system restarted, and the game proceeded as if nothing horrible had happened. The implementation ended up being fairly straightforward, though the process does span a number of frames to ensure that all the systems involved are safely synchronized with each other through each step of the process.

The memory for the movie system has since been described as coming from "the Dalton Allocator" after the character whose animation clip memory was usurped.

(I've since discovered that there's some history of this kind of thing at the studio -- of both stashing random things in GPU memory, and failing to set aside enough space earlier in the project...)

---

Pare che diversi problemi relativi alla gestione della memoria siano cosa comune; seguono alcuni commenti in calce all'articolo relativi a questa tematica.


Amir Ebrahimi
Re: The Dalton Allocator, I did something similar at Naughty Dog because we had to fit code and art into a 3MB (IIRC) memory block and quite frequently artists would go up to the very limit and us programmers would be scrounging around for every KB to get the level to fit within memory. Frustrating? Yes. How to solve? Mis-report the memory by 256KB :)



Aaron San Filippo
I've heard similar stories before - reserve some "shipping time" memory and don't tell the art team about it. Very efficient solution to the problem ;)



Joseph Moore
Yeah, that's a very common technique. On a DS title I worked on, we reserved a rather sizable chunk of memory on the side as a "just in case" buffer. Whenever a level designer needed a bit more memory for levels, an artist a bit more for textures, or a sound designer a bit more for audio, we could dole it out. (We, of course, made a great show of scrounging and optimizing to obtain the requested memory.) By the end of our development cycle, the buffer was nearly gone.


Brian Schmidt
Joseph--that's funny...
When I was doing Genesis/SNES music and sound, I'd do the same thing, though in reverse. My system was designed to submit a single black-box binary file to the developer. I'd always make sure my first delivery filled up my entire audio budget, even though most of the binary was empty. That way, I could "save the day" by being able to add in sounds late in the game, or by "optimizing" my audio to give some back to the developer...

kwb
01-08-2013, 18:40
Noto che questo "trucco" di mettere da parte della memoria prima di iniziare il progetto è stato molto usato :D
Dite che si fa ancora coi PC/Console di oggi?

banryu79
28-08-2013, 11:11
Jamming the cartridge

Michael A. Carr-Robb-John, Monolith Productions

In 1993 I was finishing off Desert Strike; I was doing the conversion from the 16-bit Mega Drive / Genesis to its humble little brother, the 8-bit Master System. The game was exceeding the desired cartridge size by about 12K, and going to the next size cartridge was out of the question. Today, 12K sounds incredibly small, but back then it was a major deal. During development, I had budgeted and planned all the sound and graphic resources and they were within their limits. The only section I hadn't been so strict on was the code. In those days, games were written in assembly language -- in this specific case, Z80 assembly -- so I had only one option left. I spent a week going through and finding redundant code and rewriting things to use a smaller memory footprint (usually at the cost of being more processor-intensive.)

By the time I had finished, the game fit onto a cartridge with just 98 bytes! The game was burned onto ROM and tested for a few days by the chaps in QA before being submitted to Sega for certification. Unfortunately it didn't pass on the first time, and the required fixes pretty quickly used up those 98 bytes. I think when we did publish, there were only 6 bytes free!

mone.java
29-08-2013, 10:38
Jamming the cartridge

Michael A. Carr-Robb-John, Monolith Productions

In 1993 I was finishing off Desert Strike; I was doing the conversion from the 16-bit Mega Drive / Genesis to its humble little brother, the 8-bit Master System. The game was exceeding the desired cartridge size by about 12K, and going to the next size cartridge was out of the question. Today, 12K sounds incredibly small, but back then it was a major deal. During development, I had budgeted and planned all the sound and graphic resources and they were within their limits. The only section I hadn't been so strict on was the code. In those days, games were written in assembly language -- in this specific case, Z80 assembly -- so I had only one option left. I spent a week going through and finding redundant code and rewriting things to use a smaller memory footprint (usually at the cost of being more processor-intensive.)

By the time I had finished, the game fit onto a cartridge with just 98 bytes! The game was burned onto ROM and tested for a few days by the chaps in QA before being submitted to Sega for certification. Unfortunately it didn't pass on the first time, and the required fixes pretty quickly used up those 98 bytes. I think when we did publish, there were only 6 bytes free!

:eek:

banryu79
30-08-2013, 13:11
Painting sounds

Edward J. Douglas, Flying Helmet Games

I was running cinematics on a long-running racing series. Our scenes were a mix of straightforward startgrids and fancier action sequences. As we iterated on further sequels, our ambitions with the scenes got greater and greater, but our technology iterated at a slower pace.

You see, the cars would be animated by a QA "stunt driver" to get the base motion, then hacked up in a 3D animation program to adjust the timing and placement of the action, and re-exported to our in-game cinematic tool where playback would simulate all the physics and engine behavior. Lots of gameplay data was captured, including gas and brake information from the controller and represented in metadata in the 3D file, then reproduced in-game. The idea was that this would drive the car audio system as well.

The problem came a few sequels down, where our scenes were very complicated, with a mix of hand-animated car action and recorded capture. The old tricks of using the engine metadata to drive simple audio rev samples for our cars wouldn't work anymore -- the data just wasn't there! The audio team couldn't post-process the audio like a movie, because any scene could have any car in it, depending on player's choice and modifications, so the audio needed to be procedural. But by this time, our games had won numerous awards for audio, especially for the car engine sounds, so we were determined to make it work.

Coming on to beta, things were looking dicey, but a combination of ingenuity and madness between our cinematics, audio, and AI engineering teams found the solution. The gas and brake metadata was represented by a float scale on a cube in the 3D scene. If an artist went in and "drew" curves in a keyframe editor like 3DS Max, they could draw in the car engine sounds they wanted. A few members of the audio team rushed to learn 3DS Max, and by using their intuition of how rev patterns should look, they drew in the animation, exported all the scenes, and squeezed it all in in time. It sounded great, but after this last-minute hack, we knew we'd need something more robust if we'd continue with the same tech-base for the next sequel.

...Or so I thought. I left the studio after that game, and a few years later I met an audio guy who had joined that team after I left. It wasn't long before I realized they never upgraded the tech, and he was the "engine rev painter" guy for the latest sequel.