Last class?

Aside

Our last class will meet December 19, a week after CUNY students graduate. We’ll wrap up our assignments Dec 12, so we want to hear from you: what should we do with our last class.

We can bring in a speaker (is there someone you’d like to hear from?) or dig in to an advanced tool like R, d3, High Charts or TileMill.

Use the comments here to brainstorm and we’ll vote on Nov 14.

Using jQuery with Hype

Why use jQuery with Hype? JQuery provides commands for fade-ins, fade-outs, and other animated effects. So, you can bypass much of the clumsy handiwork in Hype creating animations, and dealing with keyframes and timelines by using jQuery. But you can still use Hype to layout your design.

JQuery is a popular, and powerful, JavaScript library that makes it easy to select elements on an HTML document and create animations, effects, and transitions. JQuery isn’t a separate language–it’s simply a set of well-written JavaScript code that groups together commands to make it easier to do things. For example, if you were to write (hypothetical) code in JavaScript to open a door, you might have to write several lines of instruction:
1. Step up to the door
2. Grab the handle
3. Turn clockwise
4. Push

In jQuery, all of these commands might be grouped together in a single function called, Open Door. This saves you a lot of time and effort. Follow these steps to create a simple example that uses jQuery to fade out an object.

1. In Hype 1.6.0, edit the Head section of the HTML document. Select the Document inspector tab, and click on the “Edit Head HTML…” button.

2. In between the <head> and </head> tags, add this script:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

The <script> tag tells the browser to download the jQuery library from Google, which hosts the code.

3. Return to the Hype stage. Select the element you want to animate with jQuery. In the Identity inspector (the far right tab), provide a Unique Element ID. For this example, add an image and give it the unique name, obamaheadshot. It may say “Automatically Generated”, but put your cursor inside the field to enter your own.

4. Create an interaction that will trigger a jQuery effect. In this example, assign an On Mouse Click event to the image. For Action, choose “Run JavaScript…”, and for Function: choose “New Function”. An untitledFunction() appears as your new function.

5. In the untitledFunction() page that appears, you can add your own JavaScript (or jQuery) code. In between the curly braces of the function, add this statement.

$("#obamaheadshot").fadeOut();

 

The dollar sign, parentheses, and quotation marks, $(“”), is the jQuery syntax to select something in the HTML document. The pound sign is a CSS way of indicating that the thing is a unique element. So, the statement selects the item marked as obamaheadshot, and applies the fadeOut() command to it. The fadeOut() command makes it fade from 100% opacity to 0% opacity.

6. Try the entire interactivity out here, or below. Click on the image of Obama. The photo fades out using a single jQuery command, with no timeline animation necessary.

Download the completed Hype file. Learn about other jQuery effects. Try starting with these:

fadeIn();
fadeOut();
fadeToggle();
hide();
show();
slideDown();
slideUp();
slideToggle();

A word about Dropbox: Although Hype makes it easy to publish directly to your Dropbox public folder, Dropbox is really meant for storage and file sharing, and not for web hosting. Performance isn’t the greatest from Dropbox, so upload your published files to your own server.

 

Clanging Bells and Ramadan Crowds: Where and When do New Yorkers Complain about Houses of Worship?

The 311 system is a goldmine for learning what gets on New Yorkers’ nerves. In a word: Noise. Loud parties, construction, amped-up ice cream trucks—these and other offenders have garnered over 173,000 noise complaints since 2010.

Making their own contribution are the city’s myriad houses of worship. They are a tiny sliver of the cacophony, drawing less than two percent of all noise complaints. Still, the concentration of complaints—and the top “offenders”–may surprise you. The map below shows the concentration of noise complaints by zip code from January 2010 to December 2012, with major individual sources of noise complaints indicated with green arrows.







What did the Church of the Holy Name of Jesus do to land the top spot? According to Penny Ryan, District Manager for Manhattan’s Community Board 3, the church drew heavy complaints in 2011 for its annual street fair on West 97th Street. That same year, newly restored church bells began to chime every 15 minutes, 24-7.The church’s Upper West Side neighbors did not hold back in venting their annoyance.

The Union Temple in Brooklyn, another top offender, was subject to a 2011 lawsuit from the board of a nearby luxury apartment building, whose residents complained about all-night parties in the temple’s Grand Ballroom.

Noise complaints may reflect the ire of a single disgruntled neighbor or simply an increased crankiness due to the weather. The Islamic Cultural Center on the Upper East Side drew 34 complaints on a single day this past Ramadan, which fell on August.  August is consistently the biggest month for house of worship noise complaints, dispelling any preconceptions you may have about round-the-clock Christmas carols.

One more caveat on this data: New York’s 311 system only accepts complaints about houses of worship that take place outside a religious service. If you happen to live by a church that celebrates midnight mass with loudspeakers and a horn section, 311 can do nothing for you.

Calling 311 to complain about noise may be a futile gesture in any case. Peggy Ryan notes that Holy Name has cut back on the bell-ringing, and there hasn’t been a single complaint about the church since 2012. But the changes did not come because of 311; the church fixed the problems only after neighbors complained directly to their community board.

Project Snow Job: Does Money Talk When the Snowplows Roll in NYC?

 By Jane Sasseen and Kevin R. Convey

Forty-four years ago this February, the so-called “Lindsay Snowstorm” sparked complaints that the administration of Mayor John Lindsay had left poorer areas of the city unplowed while it lavished attention on Manhattan.

Ever since, successive administrations have had to deal with the suspicion that when it comes to snow clearance in New York City – as in so many other areas – money talks.

But is it true?

As temperatures drop, winter settles in and the first big snowstorm of the season looms, we decided to take a look at the data to try to find out.

The so-called “Snowmageddon” storm of Dec. 26-27, 2010, was our test case. We thought that if any storm would reveal a socio-economic bias in the city’s snow-clearance method, it would be the sixth-worst in the city’s history, the monster that buried New York in almost two feet of snow and paralyzed much of the city for a week.

Moreover, the city’s response, like that of the Lindsay administration decades before, was an epic failure, provoking a blizzard of snarky tweets:

And a very unusual public mea culpa from the normally unapologetic Mayor Michael Bloomberg:

 First, we gathered data on snow-related problems from the city’s 311 complaint-line. If the suspicions of socio-economic bias were true, we hypothesized, there should be a higher number of complaints coming from poorer communities than from their better-heeled neighbors.

We filtered the data to include only residential street-clearing complaints beginning Dec. 26, the day the storm began, and ending two weeks later. Knowing that there were no additional storms during that period, we figured that slice would capture all complaints related to Snowmageddon. We wound up with 2,341 complaints.

(Unsurprisingly, the city employs a variety of Orwell’s newspeak in its complaint protocol. Almost none are classified as street or intersection “unplowed.” Instead, nearly all are designated as “replow” requests.)

Next we added to the map community district and neighborhood designations as well as total population, median family income and total complaints. To create an “apples-to-apples” comparison, we calculated how many complaints occurred per 100,000 residents in each of the city’s 59 community districts. Then, using the Google fusion map wizard, we overlayed the snowmageddon complaint locations.

Snowmageddon 2010: Where the Complaints Were

Uh-oh. Even a cursory glance at the map shows that our initial hypothesis doesn’t hold water.

Take Manhattan, for instance: Complaints per 100,000 residents in, say, lower-income Harlem (0) and East Harlem (1.6) were in the same range as on the toney – and residentially similar — Upper East Side (1.36).

Perhaps Manhattan, with its wide avenues, heavy traffic, and position as a transport and financial hub, is an anomaly among the boroughs when it comes to socioeconomic disparities in snow clearance.

Yet there’s no apparent correlation between wealth and number of complaints in the outer boroughs either. In Brooklyn, for example, the highest number of complaints (319 per 100,000 residents) came from the neighborhoods of Canarsie/Marine Park/Mill Basin, a high-to-middle income area. That was 10 times the rate of nearby low-income Brownsville, which recorded just 31 complaints per 100,000

A look at complaints per 100,000 residents for all city neighborhoods by ascending median family income yields little discernible pattern.

 

 If anything, wealthier and middle class neighborhoods seem to generate marginally more complaints, not fewer, than poorer neighborhoods. >

 So what does account for the disparity in complaints, if not wealth? Living along the southern tier of the city seems to be the determining factor.

If we draw a line on the map from the neighborhood of Rosedale in southeast Queens west and south to the northern tip of Staten Island, the highest density of complaints lies below it. These communities also happen to be among the furthest from Manhattan, home of the mayor, seat of city government, capital of the world.

So, is this yet another example of the New York City’s (and Bloomberg’s) Manhattan-centric nature? Is the distance from Manhattan the determinant for speedy and efficient snow clearing? Is it less “money talks” than “out of sight, out of mind”?

Marty Markowitz, the president of the borough of Brooklyn, which generated the second-greatest number of complaints per 100,000 residents (42) and more than half the total complaints, says yes.

“The main priority always seems that Manhattan gets the fastest and most complete snow removal,” Markowitz says, “and the further from the mother ship, the less the priority to remove snow.

“It may be due to the fact that just about every mayor in recent history is a resident of Manhattan,” Markowitz said, “and has not (directed) Sanitation to pay equal attention to how large snowfalls impact residents and businesses in both Brooklyn and Staten Island and of course Queens.”

But James P. Molinaro, borough president of Staten Island – which logged the largest number of number of complaints per 100,000 residents (68) – disagrees.

“I don’t think it’s Manhattan against the outer boroughs,” he said. “One big thing you have to remember is that the further out you get, the thinner the public transportation gets, until you get out to Staten Island, where you don’t have any at all.

“If all you have to do is walk a few blocks to the subway to get to work, you’re not going to complain,” Molinaro said. “But if you’re on Staten Island, where five percent of New York’s population owns 18 percent of the city’s cars, you can’t to work unless you’re plowed out.’’

Molinaro’s explanation is persuasive enough for his borough, but it doesn’t explain why a remote neighborhood such as, say, Bayside, Queens — where subway stops are non-existent and residents tend to be car owners — generated so many fewer complaints per 100,000 residents (23). Or why southern-tier towns such as Brooklyn’s Flatbush or Sheepshead Bay, where subway lines are copious, generated a like number of complaints

Other non-geographical explanations fail just readily. Lack of equipment? Nearly every community district in the city has a sanitation barn with snow-clearing equipment assigned to it. Twisting, narrow streets? The streets of Park Slope (16 complaints per 100,000) are no more difficult to navigate than those of East New York (98). Variation in snowfall? The difference between the accumulation in Central Park and in the southern tier overall wasn’t more than a couple of inches.

For its part, the city’s investigation blamed its own failure to declare a snow emergency, a failure to salt roads in the early hours of the storm, the breakdown of traction chains on many plows and their subsequent immobilization, recent sanitation-worker layoffs and the difficulty some workers had in reaching their job sites.

But these are issues that affected the entire city more or less evenly. Though we cannot know what the motivation is, our map ratifies Markowitz’ observation. When it comes to snow clearance in New York City, geography – in the form of distance from Manhattan – appears to be destiny.

This year’s first big snow storm may prove that once and for all.