Faceți căutări pe acest blog

7.3.08

Cum trebuie sa vina barbatii acasa


doar de 8 martie :)

Licitatia vietii

model-view-controller (MVC) pattern for Web applications

ASP.NET MVC provides a framework that enables you to easily implement the model-view-controller (MVC) pattern for Web applications. This pattern lets you separate applications into loosely coupled, pluggable components for application design, processing logic, and display. ASP.NET MVC also greatly facilitates test -driven development (TDD).



http://www.hanselman.com/blog/ASPNETMVCPreview2ScreencastTutorials.aspx

3.3.08

26.2.08

uite cine voteaza

Nivelul erectiei in Romania


Menopauza de lucru

String.Format("{0}", "formatting string"};

http://idunno.org/archive/2004/14/01/122.aspx
http://blog.stevex.net/index.php/string-formatting-in-csharp/

One of the painful things about good old ASP was string formatting, VBScript simply didn't have anything useful. C# (and VB.Net) do, but MSDN doesn't provide a quick reference to the formatting options. So here's a quick reference.

To compare string formatting in C# to those in C lets have an example,

char szOutput[256];
sprintf(szOutput, "At loop position %d.\n", i);


sprintf takes an output buffer, a format string and any number of arguments to substitute into the format string.

The C# equivalent for sprintf is String.Format, which takes a format string and the arguments. It returns a string, and because you're not passing in a buffer there's no chance of a buffer overflow.

string outputString = String.Format("At loop position {0}.\n", i);

So why doesn't have the format argument have parameters specifying what data type you're formatting? The CLR objects have metadata which informs the CLR what the objects are, and each object has a standard ToString() method which returns a string representation of that object. Much nicer than C where if you passed the wrong type of variable into sprintf everything could come crashing down.

The ToString method can accept a string parameter which tells the object how to format itself. In the call to String.Format , the formatting string is passed after the position, for example, "{0:##}". The text inside the curly braces is {argumentIndex[,alignment][:formatString]}. If alignment is positive, the text is right-padding to fill the specified field length, if it's negative, it's left-padded.

formatting strings

There's not much formatting that can be applied to a string. Only the padding / alignment formatting options can be applied. These options are also available to every argument, regardless of type.

example output
String.Format("--{0,10}--", "test"); -- test--
String.Format("--{0,-10}--", "test"); --test --

formatting numbers

Number formatting is culture dependant. For example, formatting a currency string on my laptop will return a result like £9.99, formatting a currency on a machine set for the US region would return $9.99.

specifier type format output
(double 1.2345)
output
(int -12345)
c currency {0:c} £1.23 -£12,345.00
d decimal
(whole number)
{0:d} System.FormatException -12345
e exponent / scientific {0:e} 1.234500e+000 -1.234500e+004
f fixed point {0:f} 1.23 -12345.00
g general {0:g} 1.2345 -12345
n number {0:n} 1.23 -12,345.00
r round trippable {0:r} 1.23 System.FormatException
x hexadecimal {0:x4} System.FormatException ffffcfc7

custom number formatting

specifier type format output
(double 1234.56)
0 zero placeholder {0:00.000} 1234.560
# digit placeholder {0:#.##} 1234.56
. decimal point placeholder {0:0.0} 1234.6
, thousand separator {0:0,0} 1,235
% percentage {0:0%} 123456%

In addition there is the group separator; this is useful for varying the format, depending on the value of the parameter passed. For example

String.Format("{0:£#,##0.00;(£#,##0.00);Nothing}", value);

This will output "£1,240.00" if passed 1243.56. It will output the same format bracketed if the value is negative "(£1,240.00)", and will output the string "Nothing" if the number is zero.

date formatting

Date formats are very dependant on the culture information passed. The examples below are shown using the UK culture.

specifier type output
(June 8, 1970 12:30:59)
d Short Date 08/06/1970
D Long Date 08 June 1970
t Short Time 12:30
T Long Time 12:30:59
f Full date and time 08 June 1970 12:30
F Full date and time (long) 08 June 1970 12:30:59
g Default date and time 08/06/1970 12:30
G Default date and time (long) 08/06/1970 12:30:59
M Day / Month 8 June
r RFC1123 date string Mon, 08 Jun 1970 12:30:59 GMT
s Sortable date/time 1970-06-08T12:30:59
u Universal time, local timezone 1970-06-08 12:30:59Z
Y Month / Year June 1970

custom date formatting

specifier type output
(June 8, 1970 12:30:59)
dd Day 08
ddd Short Day Name Mon
dddd Full Day Name Monday
hh 2 digit hour 12
HH 2 digit hour (24 hour) 12
mm 2 digit minute 30
MM Month 06
MMM Short Month name Jun
MMMM Month name June
ss seconds 59
tt AM/PM PM
yy 2 digit year 70
yyyy 4 digit year 1970
: seperator, e.g. {0:hh:mm:ss} 12:30:59
/ seperator, e.g. {0:dd/MM/yyyy} 08/06/1970

There are others, including time zone formatting and so on, but the ones above are the most commonly used.

culture information

string.format also provides a method which accepts a CultureInfo argument, as an IFormatProvider. This is important when trying to write portable and localisable code, as, for example, month names will change according to the local culture of the machine you are running on. Rather than simply call the standard String.Format you should consider always calling the overloaded culture method. If you don't need to specify a culture you can use the System.Globalization.CultureInfo.InvariantCulture. This will then default your formatting to English, as opposed to the culture of the current thread.

25.2.08

Oscar 2008

Cea de-a 80-a noapte a Oscarurilor:

Cel mai bun film: "Atonement"; "Juno"; "Michael Clayton"; "No Country for Old Men"; "There Will Be Blood".

Cel mai bun regizor: "The Diving Bell and the Butterfly" - Julian Schnabel; "Juno" - Jason Reitman; "Michael Clayton" - Tony Gilroy; "No Country for Old Men" - Joel Coen si Ethan Coen; "There Will Be Blood" - Paul Thomas Anderson.

Cel mai bun actor în rol principal: Daniel Day-Lewis - "There Will Be Blood"; George Clooney - "Michael Clayton"; Johnny Depp - "Sweeney Todd The Demon Barber of Fleet Street"; Tommy Lee Jones - "In the Valley of Elah"; Viggo Mortensen - "Eastern Promises".

Cel mai bun scenariu original: "Juno"; "Lars and the Real Girl"; "Michael Clayton"; "Ratatouille"; "The Savages".


Cel mai bun documentar: "No End in Sight"; "Operation Homecoming: Writing the Wartime Experience"; "Sicko"; "Taxi to the Dark Side"; "War/Dance".

Cel mai bun documentar - scurtmetraj: "Freeheld"; "La Corona"; "Salim Baba"; "Sari's Mother".

Cea mai bună coloană sonoră: "Atonement"; "The Kite Runner"; "Michael Clayton"; "Ratatouille"; "3:10 to Yuma".

Cea mai bună imagine: "The Assassination of Jesse James by the Coward Robert Ford"; "Atonement"; "The Diving Bell and the Butterfly"; "No Country for Old Men"; "There Will Be Blood".

Cea mai bună melodie originală: "Falling Slowly"("Once"); "Happy Working Song" ("Enchanted"); "Raise It Up" ("August Rush"); "So Close" ("Enchanted"); "That's How You Know" ("Enchanted").

Cel mai bun film străin: "Beaufort" ( Israel ); "The Counterfeiters" ( Austria ); "Katyn" ( Polonia ); "Mongol" ( Kazakhstan ); "12" ( Rusia ).

Cel mai bun montaj: "The Bourne Ultimatum"; "The Diving Bell and the Butterfly"; "Into the Wild"; "No Country for Old Men"; "There Will Be Blood".

Cea mai bună actriţă în rol principal: Cate Blanchett - "Elizabeth: The Golden Age"; Julie Christie - "Away from Her"; Marion Cotillard - "La Vie en Rose"; Laura Linney - "The Savages"; Ellen Page - "Juno".

Cel mai bun mixaj de sunet: "The Bourne Ultimatum"; "No Country for Old Men"; "Ratatouille"; "3:10 to Yuma"; "Transformers".

Cel mai bun montaj de sunet
: "The Bourne Ultimatum"; "No Country for Old Men"; "Ratatouille"; "There Will Be Blood"; "Transformers".


Cel mai bun scenariu adaptat: "Atonement"; "Away from Her"; "The Diving Bell and the Butterfly"; "No Country for Old Men"; "There Will Be Blood".

Cea mai bună actriţă în rol secundar: Cate Blanchett - "I'm Not There"; Ruby Dee - "American Gangster"; Saoirse Ronan - "Atonement"; Amy Ryan - "Gone Baby Gone"; Tilda Swinton - "Michael Clayton".

Cel mai bun scurtmetraj de animaţie: "I Met the Walrus"; "Madame Tutli-Putli"; "Meme Les Pigeons Vont au Paradis (Even Pigeons Go to Heaven)"; "My Love (Moya Lyubov)"; "Peter & the Wolf".

Cel mai bun scurtmetraj: "At Night"; "Il Supplente (The Substitute)"; "Le Mozart des Pickpockets"; "Tanghi Argentini"; "The Tonto Woman".

Cel mai bun actor in rol secundar: Casey Affleck - "The Assassination of Jesse James by the Coward Robert Ford"; Javier Bardem - "No Country for Old Men"; Philip Seymour Hoffman - "Charlie Wilson's War"; Hal Holbrook - "Into the Wild"; Tom Wilkinson - "Michael Clayton".

Cea mai bună regie artistică: "American Gangster"; "Atonement", "The Golden Compass"; "Sweeney Todd The Demon Barber of Fleet Street"; "There Will Be Blood".

Cele mai bune efecte vizuale
: "The Golden Compass"; "Pirates of the Caribbean: At World's End"; "Transformers".


Cele mai bune costume
: "Across the Universe"; "Atonement"; "Elizabeth: The Golden Age"; "La Vie en Rose"; "Sweeney Todd The Demon Barber of Fleet Street".

Cel mai bun film de animaţie: "Persepolis"; "Ratatouille"; "Surf's Up".

Cel mai bun machiaj: "La Vie en Rose"; "Norbit"; "Pirates of the Caribbean: At World's End".


Versiunea cu link:
Iata lista castigatorilor premiilor Oscar 2008

Cel mai bun film - No Country for Old Men

Cel mai bun regizor - Joel Coen si Ethan Coen

Cel mai bun actor in rol principal - Daniel Day-Lewis

Cea mai buna actrita in rol principal - Marion Cotillard

Cel mai bun actor in rol secundar - Javier Bardem

Cea mai buna actrita in rol secundar - Tilda Swinton

Cel mai bun scenariu original - Diablo Cody

Cel mai bun film strain - Die Falscher

Cel mai bun scenariu adaptat - Joel Coen si Ethan Coen

Cel mai bun film de animatie - Ratatouille

Cea mai buna imagine - There Will Be Blood

Cea mai buna coloana sonora - Atonement

Cele mai bune efecte vizuale - The Golden Compass

Cel mai bun cantec original - Falling Slowly din Once

Cele mai bune costume - Elizabeth: The Golden Age

Cel mai bun machiaj - La Vie en Rose

Cele mai bune efecte vizuale - The Golden Compass

Cea mai buna regie artistica - Sweeney Todd

Cel mai bun scurtmetraj - Le Mozart des Pickpockets

Cel mai bun scurtmetraj de animatie - Peter & the Wolf

Cel mai bun montaj de sunet - The Bourne Ultimatum

Cel mai bun mixaj de sunet - The Bourne Ultimatum

Cea mai buna coloana sonora - Atonement

20.2.08

Programatorii pot câştiga pe internet mai mult decât la patron

Cele mai importante platforme

www.elance.com
Este o platformă prin intermediul căreia firmele scot la licitaţie diferite proiecte pentru a găsi cei mai buni furnizori din lume, la cel mai convenabil preţ. Compania a fost fondată în anul 1999 şi are sediul central în Mountain View, California. Pe acest site se poate licita pentru proiecte din domeniul IT, pentru creare de planuri de afaceri, scriere de articole, traduceri, servicii juridice sau realizarea de proiecte de inginerie. Această platformă poate fi foarte utilă şi companiilor autohtone care doresc să găsească furnizori de servicii. Firma din România care a câştigat cel mai mult pe acest site este Spectra IT, cunoscută prin brandul Cratima. În ultimii trei ani, compania a obţinut contracte în valoare de peste 400.000 de dolari, din care 150.000 numai în 2007. O altă firmă autohtonă foarte activă este EnySoftware, care a obţinut contracte în valoare de aproape 328.000 de dolari în ultimii ani.

www.guru.com
Este un site mai puţin folosit de români. Cu toate acestea, are 4.614 membri din ţara noastră, cei mai mulţi fiind înregistraţi la secţiunea de programare (1.590) iar cei mai puţini, la cea de design/multimedia (702). Potrivit reprezentantei companiei, Bethany Fricker, persoana din România care a câştigat cei mai mulţi bani prin acest site (78.660 de dolari) este Cristiana Bard.

www.rentacoder.com
Este un site pe care românii sunt foarte activi. În luna ianuarie 2008, conaţionalii noştri s-au clasat pe locul trei la numărul de proiecte câştigate, după americani şi indieni. Într-un clasament al celor mai apreciaţi programatori din lume care lucrează prin intermediul acestui site, locul patru este deţinut de Mihai Pop din Craiova, prin firma Software Pop Service Electronic, iar locul trei, de o firmă denumită SoftMania. Ian Ippolito, fondatorul site-ului rentacoder.com, a mărturisit pentru revista Capital că firmele care pun proiecte la licitaţie sunt foarte mulţumite de modul în care lucrează românii, pentru că „sunt foarte muncitori, atenţi la detalii şi au abilităţi foarte bune de relaţionare cu clienţii“.

15.2.08

Zeitgeist (Spiritul Epocii)

Versiunea in limba romana:
http://video.google.com/videoplay?docid=9072119975796993477



Zeitgeist, produs de Peter Joseph, a fost creat ca o exprimare filmica nonprofit pentru a inspira pe oameni sa priveasca lumea dintr-o ... all » perspectiva mai critica si pentru a intelege ca deseori lucrurile sunt diferite de cum par pentru cea mai mare parte a populatiei.

Speranta mea este ca oamenii nu vor lua ce este spus in acest film ca fiind adevarul, ci il vor afla singuri, pentru ca adevarul nu este spus, este realizat.


Zeitgeist (pronounced [ˈt͡saɪtgaɪst] ) is originally a German expression that means "the spirit of the age", literally translated as "time (Zeit) spirit (Geist)". It describes the intellectual and cultural climate of an era. In German, the word has more layers of meaning than the English translation, including the fact that Zeitgeist can only be observed for past events.

Zeitgeist has achieved a unique status among German loanwords in other languages, having found an entrance into English, Spanish and Japanese.