Diberdayakan oleh Blogger.

Popular Posts Today

Un esempio di Canvas, Multi Touch e SVG su Internet Explorer 10

Written By Kom Limpulnam on Jumat, 16 Agustus 2013 | 15.10

Abbiamo visto in un precedente articolo come sfruttare il supporto SVG per disegnare grafica vettoriale complessa, con annessi filtri grafici accelerati in hardware. Inoltre, abbiamo anche trattato la gestione dei punti di tocco multipli tramite l'API MSPointer ( il riferimento è a questo articolo), compito in realtà abbastanza semplice, che non si discosta molto dalla gestione dei classici eventi del mouse, con l'importante differenza che vengono generati tanti eventi quante sono le dita rilevate dal sensore.

Una volta padroneggiati questi prerequisiti, possiamo mettere insieme le due cose e creare un semplice gioco che combina grafica SVG, interazione multi-touch, e manipolazione di immagini tramite Canvas. Microsoft mette a disposizione degli sviluppatori, tra i meandri della sua sconfinata documentazione MSDN, un progetto d'esempio che ben sintetizza queste tecniche in un classico puzzle game in cui bisogna mettere nell'ordine corretto i vari tasselli in cui è stata scomposta un'immagine.


Fig. 1 Puzzle game d'esempio

Per suddividere l'immagine in piastrelle viene usato il metodo drawImage dell'oggetto Canvas ( si veda anche qui). Questo metodo consente di disegnare una porzione di un'immagine sorgente all'interno un canvas o un'immagine di destinazione. Accetta come parametri l'immagine sorgente, le coordinate e la dimensione del rettangolo da copiare, le coordinate e la dimensione del rettangolo di destinazione. Con un solo metodo, giocando opportunamente con le coordinate e le dimensioni, è possibile disegnare parti di un'immagine traslati e scalati in molti modi.

Questo frammento di codice si occupa di tagliare l'immagine in blocchi e salva i vari pezzi in una tabella temporanea:


//Genera le piastrelle
for (var row = 0; row < NUM_ROWS; row++) {
   for (var col = 0; col < NUM_COLS; col++) {
      ctx.drawImage(image, dx * col, dy * row, dx, dy, 0, 0, dx, dy);
      ctx.strokeRect(0, 0, dx, dy); // Disegna il bordo.
      slicedImageTable.push( _canvas.toDataURL() );
   }
}

// Disegnale, sotto forma di tag <img>
for (var r = 0; r < NUM_ROWS; r++) {
   for (var c = 0; c < NUM_COLS; c++) {
      var img = new Image();
      img.src = slicedImageTable.shift(); // restitusce il primo element e lo rimuove dall'array.       Funziona come il "dequeue" di una coda, oppure il "pop" di uno stack
      document.getElementsByTagName('body')[0].appendChild(img);
   }
document.getElementsByTagName('body')[0].appendChild(document.createElement('br'));
}
 

Per il codice completo, fate riferimento alla pagina di esempio, ricordando di usare l'opzione per mostrare il sorgente della pagina.


15.10 | 0 komentar | Read More

Da Samsung arriva Hennessey, lo smartphone Android a doppio schermo

Annunciato più volte da incessanti indiscrezioni, Samsung Hennessey è apparso finalmente all'interno delle pagine web del portale cinese della società. Il nuovo dispositivo ricorda esteticamente i vecchi telefoni cellulari a conchiglia, con la differenza che si tratta di uno smartphone Android dotato di doppio schermo, di cui uno si trova nella parte esterna del dispositivo e l'altro nella parte interna come "da tradizione".

Samsung Hennessey Flip-Phone

I due display di diagonale di 3,3" sono caratterizzati da una risoluzione di 320x480 e da matrice touchscreen capacitiva. Il dispositivo fa uso di Android 4.1 e di una CPU quad-core da 1,2GHz. Sulla parte esterna spiccano i tre tasti a sfioramento per poter gestire le funzioni basilari del sistema operativo di Google.

La batteria integrata è da 1.500mAh, mentre la memoria interna è espandibile tramite scheda microSD. Sul fronte fotografico avremo un sensore da 5MP, mentre il dispositivo supporterà Wi-Fi, Bluetooth e sarà dotato di modulo GPS. Come tanti dispositivi proposti per il mercato cinese, è previsto il funzionamento di due SIM contemporaneamente con il supporto alle reti CDMA e GSM.

Non sono ancora noti i dettagli riguardo alla data di rilascio o al raggiungimento di mercati diversi rispetto a quello cinese, ma il supporto alle reti GSM dovrebbe fare pensare ad una potenziale esportazione del prodotto anche in altre regioni del mondo.


15.10 | 0 komentar | Read More

Google Chrome 29

scheda aggiornata 1 ora fa

Valutazione

Media Voti

         

su 0 votazioni

Google Chrome è un browser web sviluppato da Google con tecnologia WebKit e basato su una nuova Java script Virtual machine denominata V8. Una delle caratteristiche principali del prodotto è la gestione delle singole schede aperte in processi separati: in caso di crash di un singolo tab non sarà necessario riavviare l'intera applicazione


15.10 | 0 komentar | Read More

How to prevent lice when kids head back to school

Written By Kom Limpulnam on Kamis, 15 Agustus 2013 | 23.23

DUNWOODY, Ga. -- As kids head back to school, they can become vulnerable to head lice since the tiny insects spread quickly from one head of hair to another.

Eileen Fishman, the founder of the head lice removal company Elimilice, shared five things parents need to know to protect their children.

1) Make head checks part of your routine. Fishman said she checks her daughters at least once a week.

"There are certain areas of the head where you want to look where the head lice are more likely to lay they're eggs, known as nits," Fishman said. "They're the warmest areas of the head: the nape of the neck, around the ears, the top of the head and above the forehead."

2) Make sure you know what to look for.

"If they're a viable nit, meaning they're something you need to worry about, they're darker in color," Fishman explained. "It's an egg inside a protein sheath, and they're dark."

She said they're also very small, like a poppy seed.

3) Consider buying a terminator comb that costs about $15, and use it once a week.

"You will preempt a full case of head lice if you comb thoroughly with this comb every seven days or less," Fishman said. "It pulls the bugs out of the hair. This comb gets every bug and a lot of the nits."

4) For girls or boys with long hair, pull it back in a bun, a braid or  ponytail.

"Anything that keeps their hair from being loose on the head will help because head lice pass from head-to-head contact," she added.

Fishman also suggests spraying the hair will a repellent, like a mint spray.

5) Don't share hats or helmets or even brushes or combs.

Fishman suggests giving every family member their own hair care basket.

"When my children first got head lice, we were sharing the same brush," she said. "So guess who else got head lice? Me."

Fishman said her family has been lice-free since she began prevention efforts four years ago. She started her company at about the same time.


23.23 | 0 komentar | Read More

Andrea Sneiderman will not testify in her defense - WATCH LIVE

DEKALB COUNTY, Ga. -- Andrea Sneiderman told the court Thursday morning she will not testify in her defense.

The defense rested its case as well Thursday morning.

The prosecution says it will offer no rebuttal witnesses.

Closing arguments will begin shortly.  Each side will have one hour to conclude its case.

MORE | Gavel-to-gavel live continuing coverage of Andrea Sneiderman perjury trial

READ| Judge Adam's funny sayings in the courtroom

PHOTO GALLERY| Inside the Sneiderman trial


23.22 | 0 komentar | Read More

Wis. Walmart employee arrested for shooting coworker

NEENAH, Wis. -- Police have identified the suspect in the Walmart shooting Wednesday as Justine Boyd, 46, of Greenville.

Police Chief Kevin Wilkinson said Boyd was booked into the Winnebago County Jail on a charge of attempted first-degree intentional homicide. He said both Boyd and the 56-year-old Neenah woman she shot are Walmart employees, and the two were working when the shooting occurred in the liquor section of the store at 1155 W. Winneconne Ave.

The victim, a clerk in the liquor section, was taken by ambulance to Theda Clark Medical Center. Lt. John Karner said she was shot once in the torso.

"We're still very concerned for the victim," Wilkinson said. "We're obviously all hoping and praying for the best for her."

Police and Theda Clark Medical Center will hold a joint press conference at 10 a.m. Thursday at the hospital.

Wilkinson said investigators have not determined what led to the shooting shortly before 11:15 a.m.

"We're digging around trying to get that information," he said, "but so far, at least, there hasn't been a simple explanation. The whole thing is really weird."

Boyd has no record of criminal convictions in Wisconsin, according to the state's circuit court access website.

Both women were cashiers, Walmart spokeswoman Dianna Gee told Post-Crescent Media.

(Post-Crescent Media, Appleton, Wis.)


23.22 | 0 komentar | Read More

Gold Dome area to get a makeover

ATLANTA -- The state government is planning a dramatic makeover of Georgia's Capitol Square complex to provide visitors a more welcoming vibe.

The Georgia State Financing and Investment Commission issued a request for qualifications Wednesday seeking a design firm to develop plans to turn one side of the square into a public plaza and close off a street along another side to traffic.

According to the RFQ, the Capitol Plaza project calls for demolishing a 59-year-old parking deck across Capitol Avenue from the historic gold-domed Capitol building and creating an open plaza on the site "suitable for public gatherings, rallies and exhibitions."

An assessment in 2011 found that because substantial work would have to be done to repair the deteriorating garage, the state should consider replacing it.

A new parking deck, also across from the Capitol, is due to open in November 2014.

The second part of the project envisions closing to traffic the block of Mitchell Street south of the Capitol between Washington Street and Capitol Avenue and converting it into a "pedestrian-friendly" plaza.

Regulars at the Capitol frequently complain about the dangers of crossing the busy one-way street that separates the Capitol from the Coverdell Legislative Office Building, where many lawmakers have their offices.

Preliminary estimates put the cost of the new plaza at $3.3 million, while the work associated with closing Mitchell Street to traffic is expected to cost $3 million.

The Georgia Building Authority has hired Atlanta-based architectural firm Stevens & Wilkinson to provide the finalists among the companies responding to the RFQ conceptual drawings showing how the projects could be incorporated into the Capitol Hill complex.

Interested firms have until Aug. 29 to submit bids. Finalists will be notified on Sept. 5, with design work due to start by early October.

(Atlanta Business Chronicle)


23.22 | 0 komentar | Read More

Heavy rains set to drench area this weekend

ATLANTA - Heavy rains are expected across the state through the weekend, as both a stationary front continues to sit across parts of the Southeast, and a tropical weather system looms in the Caribbean.

11Alive Meteorologist Chesley McNeil says heavy rain is expected across parts of Georgia each day, and that with the already saturated ground, people should be alert for falling trees.

RELATED | 11Alive Weather Information Zone
PHOTOS | Stormy Atlanta Weather - Aug. 12

There is a tropical system off of the Yucatan peninsula in the western Caribbean, which over the weekend is expected to move into the warm waters of the Gulf of Mexico. Storm forecast tracks indicate that the disturbance will likely become a tropical storm, but will either move into northeastern Mexico or south Texas.

Moisture from the storm may reach Georgia at some point next week.

A second tropical system, Tropical Storm Erin, has formed off of the Cape Verde Islands in the far eastern Atlantic Ocean.


23.22 | 0 komentar | Read More

5-year-old Lealand Hill found safe

CARROLLTON, Ga. (WXIA) -- Carrollton Police have reported that 5-year-old Lealand Hill has been found safe, and that a suspect has been taken into custody.

They said the vehicle they were looking for was pulled over on Highway 113. 

Police had been looking for little Lealand, and said that he had been abducted at 5 a.m., Thursday from the home of his grandmother on Cottage Court in Carrollton.

Police told 11Alive's Rebecca Lindstrom that Lealand's grandmother has legal custody of Lealand and his brother, and that Christopher Fields, the boys' father, had spent the night.

Investigators said that in the early hours Thursday, Fields awakened and took Lealand from the home. A deputy spotted a car matching the description of Fields' on Highway 113 at Northside Drive in Carrollton and pulled it over without incident.

Fields, little Lealand and an unidentified woman were in the car.

Investigators said Fields has a drug habit, which boosted their concern for Lealand's safety.

RELATED STORIES:
-8-month-old safe at home following abduction
-Gallery: Missing Georgia Children
-Gallery: 8-month-old William Kaidyn Stover home safe


23.22 | 0 komentar | Read More

Death toll from Egypt violence rises to 525

Residents walk through debris and rubble inside the burnt down mosque of Rabaa al-Adawiya on August 15, 2013 in Cairo, Egypt. (Getty Images)

CAIRO - Supporters of ousted president Mohamed Morsi called for a protest march in Cairo on Thursday after government assaults on two protests camps sparked conflict nationwide, killing hundreds of people.

At least 525 people were killed across the country Wednesday including 43 police, the Health Ministry said. Most of the deaths occurred after security forces advanced on two pro-Morsi sit-ins in the capital. More than 3,700 people were wounded, the ministry said.

PHOTOS | Dozens dead in new Egyptian unrest

Banks and the stock exchange on Thursday were closed and museums and archaeological sites are sealed indefinitely, the government said. Much of the nation is living under a one-month state of emergency with overnight curfews. The U.S. Embassy in Cairo was shut to the public and consular services were suspended.

Meanwhile, the interim government formed after Morsi's ouster by the military July 3 is coming unhinged.

Sources told Ahram Online, a local news publication, that deputy prime ministers Ziad Bahaa El-Din and Hossam Eissa will submit their resignations. On Wednesday, interim Vice President Mohamed ElBaradei resigned from his post, saying he disagreed with the assaults.

Tamarod, the youth group behind the mass anti-Morsi protests that preceded the coup, said ElBaradei was dodging his responsibility at a time when his services were needed.

Most of the deaths were at two sit-ins that Morsi supporters had been holding onto for days to demand his reinstatement but many deaths happened outside the capital where members of Morsi's Muslim Brotherhood were accused of attacking opponents. Christian churches were also attacked and burned.

Near the site of one of the smashed encampments in the eastern Nasr City district were dozens of blood soaked bodies stored inside a mosque. The bodies were wrapped in sheets and still unclaimed by families.

Relatives at the scene were uncovering the faces in an attempt to identify their loved ones.

Victims' names were scribbled on white sheets covering their bodies, some of which were charred. Posters of Morsi were scattered on the floor.

Security forces had cleared the two protest camps positioned on opposite sides of town, firing tear gas, using live ammunition and tearing down posters and tents in operations that started early Wednesday.

Protesters at the Nahda Square sit-in outside Cairo University were dispersed well before midday. But clashes between security and protesters outside the Rabaa Al-Adawiya mosque continued until dusk as the site went up in flames.

After weeks of political stalemate between the military-backed government and the Muslim Brotherhood and its Islamist allies, the violence may have crushed any prospects of mediation between Morsi's opponents and supporters.

"There was a slight glimmer of hope for some mediation process or negotiation before yesterday's events," said Shadi Hamid, director of research for the Brookings Doha Center. "All of that is pretty much mute at this point."

A pro-Morsi alliance called on Egyptians to join mourning prayers in mid afternoon at the Al-Iman mosque in Cairo's Nasr City. The Brotherhood, which propelled Morsi to power, planned for a march from the mosque to protest, according to a statement.

The only real option for Morsi supporters is to stage more protests to put pressure on the government, Hamid said. If the Brotherhood stops protesting repression would continue and the military would move to dismantle the organization, he said.

Since the military ousted Morsi, Brotherhood leaders have been arrested and their assets frozen. The Interior Ministry, which supervises the police, said 200 protesters, many from the Muslim Brotherhood, are under arrest for the protests.

A mass police funeral - with caskets draped in the white, red and black Egyptian flag - was held in Cairo for some of the 43 security troops killed in Wednesday's clashes.

Interior Minister Mohammed Ibrahim led the mourners. A police band played funerary music as a somber funeral procession moved with the coffins placed atop red fire engines.

Cairo, a city of 18 million people, was uncharacteristically quiet Thursday, with only a fraction of its usually hectic traffic and many stores and government offices shuttered. Many people hunkered down at home for fear of more violence.

The latest events in Egypt drew widespread condemnation from the Muslim world and the West, including the United States, Egypt's main foreign backer for over 30 years. Some Egyptians said though that the growing protest camps had to be removed. The leaders of Morsi's Muslim Brotherhood called it a "massacre."

Interim Prime Minister Hazem el-Beblawi said in a televised address to the nation that it was a "difficult day" and that he regretted the bloodshed but offered no apologies for moving against Morsi's supporters, saying they were given ample warnings to leave and he had tried foreign mediation efforts.

Backed by helicopters, police fired tear gas and used armored bulldozers to plow into the barricades at the two protest camps on opposite ends of Cairo. Morsi's supporters had been camped out since before he was ousted by the military, which acted after mass protests by millions of Egyptians demanding that Morsi step down.

The protesters then accused Morsi of acting as a dictator, and focusing more on trying to foce more Islamist laws on Egypt than improving an awful economy.

The smaller camp - near Cairo University in Giza - was cleared of protesters relatively quickly, but it took about 12 hours for police to take control of the main sit-in site near the Rabaah al-Adawiya Mosque in Nasr City that has served as the epicenter of the pro-Morsi campaign and had drawn chanting throngs of men, women and children only days earlier.

After the police moved on the camps, street battles broke out in Cairo and other cities across Egypt. Government buildings and police stations were attacked, roads were blocked, and Christian churches were torched, Interior Minister Mohammed Ibrahim said.

At one point, protesters trapped a police Humvee on an overpass near the Nasr City camp and pushed it off, according to images posted on social networking sites that showed an injured policeman on the ground below, near a pool of blood and the overturned vehicle.

Morsi has been under house arrests at an undisclosed location. Other Brotherhood leaders have been charged with inciting violence or conspiring in the killing of protesters.

In his televised address, el-Beblawi said the government could not indefinitely tolerate a challenge to authority that the 6-week-old protests represented.

"We want to see a civilian state in Egypt, not a military state and not a religious state," he said.

Sheik Ahmed el-Tayeb, the powerful head of Al-Azhar mosque, Sunni Islam's main seat of learning, also sought to distance himself from the violence. He said in a statement he had no prior knowledge of the action.


23.22 | 0 komentar | Read More
techieblogger.com Techie Blogger Techie Blogger