Wednesday, April 28, 2010

pt noi

#include
#include

//structura cu parametrii fiecarui fir

typedef struct {
int x[30]; // stocare vector
int n; // numar maxim de elemente
} Parametri;

int x[30];
int n;

///// Functia primului fir
///// CITIREA

void* Citire(void *param )
{
int i; // contor

printf("\n Dati numaru de elemente a vectorului: ");
scanf("%d",&n);

for (i=0;i {
printf("\n Dati element: %d=", i+1);
scanf("%d", &x[i]);
}

printf("\n");

return NULL;
}


//// functia ce va fi executata de cel de-al doilea fir.\
//// SORTAREA SI AFISAREA

void* Afisare(void )
{

int i, aux;

printf("\n Sortare vector ... \n");

for (i=0;i {
if x[i]>x[i+1]
{
aux=x[i];
x[x]=x[i+1];
x[i+1]=aux;
}

printf("\n Sortare incheiata. ");

printf("\n Afisare - vectorul este :\n");
for (i=0;i {
printf(" %d ",x[i]);
}
printf("\n");

return NULL;
}


///// functia efectuata de firul 3
///// media valorilor

void* Suma(void * param)
{
int i,med,a,b,nr;
long S;
S=0;

for (i=0;i S=S+x[i];

printf("\n Suma elementelor este %ld",S);

med=S/n;

printf("\n Media elem. vectorului este: %d ",med);
printf("\n Dati intervalele a, b ");
printf("\n a= ");
scanf("%d", &a);
printf("\n b=");
scanf("%d", &b);
for (i=0;i if ((x[i]>=a) && (x[i]<=b))
nr++;
printf("\n in intervalul [a,b], sunt%ld",S);

return NULL;
}


int main()
{

pthread_t f1,f2,f3; //declararea firelor

int rc,status;

pthread_attr_t attr;
Parametri sp;

//// crearea primului fir

pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
rc = pthread_create(&f1, &attr, &Citire, (void *) &sp);

/// se asteapta incheierea executiei primului fir

pthread_attr_destroy(&attr);

rc=pthread_join(f1, (void **)&status);

///se creaza al doilea fir

pthread_create(&f2, &attr, Afisare, (void *) &sp);
rc=pthread_join(f2, (void **)&status);

/// se creaza al treilea fir

pthread_create(&f3, &attr, Suma, &sp);
rc=pthread_join(f3, (void **)&status);


return 0;
}

Tuesday, January 15, 2008

Venturi Fétish High End Electric Supercar Sports Car

Just when you figure you’ve seen everything, something comes around that sets you back on your heels. Such is life in the world of advanced technology vehicles.

This is especially so when it comes to electric cars. By most accounts in recent years, the battery electric vehicle had died an untimely death. Green Car Journal editors didn’t believe it then and we don’t now. But realistically, in the eyes of most folks there wasn’t much going on to dispute this. That view is turned on its ear by the Venturi Fétish, an unlikely and curvaceous example that epitomizes what the ultimate electric supercar should be.
The Venturi Fétish made its U.S. debut earlier this year in Los Angeles and then followed suit in Monaco, showings that followed an appearance in Paris. Here, it was eye-opening even by car-crazed California standards, with a sleek body drawn by French designer Sacha Lakic and engineering handled by Gérard Ducarouge of Lotus Formula 1 fame. It is assembled in California, where this elegant carbon fiber bodyshell is wrapped around a carbon aluminum honeycomb monocoque chassis, creating a 2,424 pound sports car that’s as aesthetically pleasing as any of the high-end exotics plying the roads of Hollywood or Beverly Hills.
But this car isn’t all looks. A 300 horsepower, 14,000 rpm AC Propulsion electric motor propels the rear-drive Fétish from 0 to 60 mph in less than 5 seconds, achieving a top speed above 100 mpg. A T-shaped battery pack incorporating 770 pounds of lithium-ion batteries provides the power, a configuration similar to that of the nickel-metal-hydride battery design in GM’s EV1 electric car. This 58 kilowatt-hour Li-Ion pack reportedly allows the car a single-charge driving range of 200 miles. Regenerative braking recaptures energy during deceleration or braking and feeds electricity back to the batteries. Unlike most electric cars, the amount of regeneration is driver-adjustable at the dash. The car rides on Michelin Pilot Sport tires wrapped around aggressive 18 inch alloy wheels up front, with Michelins over 19-inch alloys at the rear.

Inside, Venturi offers its buyers a choice of leather or neoprene upholstery, form-fitting racing style seats, a thickly-wrapped steering wheel, and digital instrumentation. A wide array of advanced electronics is at a driver’s fingertips including an Apple Mini i-Pod MP3 player and an Alpine touch-screen multimedia station, which includes GPS navigation and DVD.

Sunday, January 13, 2008

Vectrix VX-FCe Hydrogen Fuel Cell-Electric Hybrid Scooter

Fuel cell-powered vehicles have been getting a lot of attention, but these efficient and fast two-wheeled runabouts have a lot to gain from this zero-emission propulsion system, too. Case in point: The Vectrix VX-FCe fuel cell-electric hybrid scooter shown here. By adding a small 500 watt fuel cell to its battery-powered electric scooter, Vectrix has been able to double this two-wheeler’s range and forgo the need to recharge at a power outlet. The fuel cell supplies a continuous trickle of charge to the battery, while the battery provides varying bursts of power to the electric motor as required by driver input. The VX-FCe has a 150 mile range at 25 mph, a top speed of just over 60 mph, and accelerates from 0-50 mph in 6.8 seconds. With recent investment from industrial and aerospace systems company Parker Hannifin, Vectrix says the VX-FCe will be set to go on sale in select U.S. and European cities in the next two to three years for around $9,000. And here’s another: Intelligent Energy, a British company that recently relocated to Los Angeles, is hoping its ENV motorcycle will go on sale in 2006 for $6,000. If that happens, this fuel cell-powered motorcycle will be the first production fuel cell vehicle on the market. The ENV features what the company calls CORE, a fully detachable 1 kW fuel cell that could potentially be used to power other appliances when the motorcycle is not in use. Installed in the vehicle beneath the seat, the fuel cell is aided by a battery pack to give the ENV a top speed of 50 mph – which it reaches in 12 seconds from a stop – and a driving range of about 100 miles or 4 hours of continuous use.

Adds By Google