factors affecting happiness

Full Definition of HAPPY

1
:  favored by luck or fortune :  fortunate <a happycoincidence>
2
:  notably fitting, effective, or well adapted :  felicitous <ahappy choice>
3
:  enjoying or characterized by well-being and contentment<is the happiest person I know> <a happy childhood>

:  expressing, reflecting, or suggestive of happiness <ahappy ending>

:  gladpleased <I’m happy to meet you>

:  having or marked by an atmosphere of good fellowship : friendly <a happy office>

4
:  characterized by a dazed irresponsible state <a punch-happy boxer>

:  impulsively or obsessively quick to use or do something<trigger-happy>

:  enthusiastic about something to the point of obsession : obsessed <education-conscious and statistic-happy — Helen Rowen>

The Happiness Factor—Scientists know that positive people are happier,
period. Tapping into your bright side is easier than you’d guess.
By Nancy Kalish, Prevention

Here are four habits that longevity experts say are at the heart of a sunny disposition—and that you
can adopt, too.
1. THEY WORK THEIR CELL PHONES
Perhaps your neighborhood gossip is on to something: All that chitchat keeps her plugged into a
thriving social network—and people who socialize at least once a week are more likely to live longer,
keep their brains sharp, and prevent heart attacks. One reason: “Just talking on the phone to a friend
has the immediate effect of lowering your blood pressure and cortisol levels,” says Teresa Seeman,
PhD, a professor of medicine and epidemiology at UCLA.
“Our research shows that having good long-term relationships provides as many physical benefits as
being active or a nonsmoker.” Make the effort to connect with the friends you already have. Call now,
and before you hang up, schedule a lunch date—personal contact is even better.
2. THEY EXPRESS GRATITUDE (WITHIN REASON)
Buoy your spirits by recording happy events on paper, your computer, or a PDA. People who write
about all the things they are thankful for are optimistic about the upcoming week and more satisfied
overall with their lives, according to a University of California, Davis, study. They also feel physically
stronger.
“It’s hard to be bitter and mad when you’re feeling grateful,” says Sonja Lyubomirsky, PhD, author of
the upcoming book, “The How of Happiness: A Scientific Approach to Getting the Life You Want.” But
don’t overdo it. Women who kept a gratitude journal only once a week got a bigger boost in
happiness than those asked to record their good fortune three times a week. Find the frequency that
works for you – giving thanks shouldn’t feel like a chore.
3. THEY’RE RANDOMLY KIND
Do you perform five acts of kindness in any given day? That’s the number of good deeds that boosts
your sense of well-being and happiness, according to research by Lyubomirsky. Your karmic acts can
be minor and unplanned – giving up your seat on the bus; buying an extra latte to give to a

coworker. You’ll find that the payback greatly exceeds the effort. “You see how much you’re
appreciated and liked by others,” she says. Be sure to keep up the good work: When Lyubomirsky
asked her study subjects to space their five good deeds over the course of a week, the actions
started to seem routine and lost some of their therapeutic effects. But don’t fret if you can’t make the
quota daily. “Being spontaneously kind also delivers rewards,” she says.
4. THEY REAPPRAISE THEIR LIVES
Yes, you can rewrite history—and feel better about yourself in the bargain. Set aside a little time
each week to write about or record—or even just mentally revisit—an important event in your past.
Reflecting on the experience can reshape your perception of it, as well as your expectations for the
future, says Robert N. Butler, MD, president of the International Longevity Center-USA in New York
City. When creating this “life review,” you get to list all your accomplishments—an instant self-esteem
booster. Organize your historical review by epochs: your postcollege years, early marriage, career,
motherhood. Subdivide each section into triumphs, missteps, and lessons for the future.
It’s helpful to look at the bad times as well as the good. Perhaps now that a few years have passed,
you’ll be able to see how that breakup or failed job opportunity opened other doors and finally
forgive yourself—and your ex-boyfriend or would-be boss. “Even if a memory is painful, it’s good to
work through it,” says Butler. “If you can come to terms with past events, you’ll be better able to
handle tough times down the road.” So be honest, but also go easy on yourself. Remember: You are
the heroine in this tale.
The Best Kind of Pessimist
If you’re an irritable sort who thinks of your eternally cheery neighbor as a delusional Pollyanna, are
you doomed to poor health? Not if you’re an active pessimist, a feisty spirit who loves to complain,
criticize, and generally mix it up with others—but then takes action. “Active pessimists do battle with
life. Being that engaged is actually good for them and can provide some of the same benefits that
optimists enjoy,” says Toni Antonucci, PhD, director of the Life Course Development Program of the
Institute for Social Research at the University of Michigan.

The 10 Happiest (and Saddest) Cities in the U.S.

Bigger isn’t necessarily best when it comes to quality of life. In a Gallup survey released this week of the U.S. cities rated highest for overall well-being, New York City, Los Angeles, and Chicago all failed to crack the top 50. By contrast, nine of the top 10 spots in the survey went to mid-size cities, with the Boulder, Colorado metro area grabbing the top overall spot. The only big city that cracked the top 10 was the Washington, D.C. area.

Where to get your happy on:

The 10 Happiest Cities (Overall Ranking)
1. Boulder, CO
2. Lincoln, NE
3. Fort Collins-Loveland, CO
4. Provo-Orem, UT
5. Honolulu, HI
6. Madison, WI
7. Cedar Rapids, IA
8. Gainesville, FL
9. Bridgeport-Stamford-Norwalk, CT
10. Washington-Arlington-Alexandria, DC-VA-MD-WV

At the other end of the spectrum, among the 188 metropolitan areas Gallup focused on, these regions turned up the least-contented residents:


The 10 Saddest Cities in America
179. Utica-Rome, NY
180. Prescott, AZ
181. Lake Havasu City-Kingman, AZ
182. Spartanburg, SC
183. Hickory-Lenoir- Morganton, NC
184. Fort Smith, AR-OK
185. Redding, CA
186.Beaumont-Port Arthur, TX
187. Youngstown-Warren- Boardman, OH-PA
188. Huntington-Ashland, WV-KY-OH

Here’s how the rankings went among the largest cities in the country, defined as being those with one million or more residents (for the record, among the country’s biggest metro areas, Los Angeles grabs bragging rights at 62nd overall, followed by Chicago at 80th, and the New York metro area at 90th).

The 10 Happiest Large Cities
1. Washington-Arlington-Alexandria, DC-VA-MD-WV
2. Austin-Round Rock, TX
3. San Jose-Sunnyvale-Santa Clara, CA
4. Seattle-Tacoma-Bellevue, WA
5. San Francisco-Oakland-Fremont, CA
6. Minneapolis-St.Paul-Bloomington, MN-WI
7. Boston-Cambridge-Quincy, MA-NH
8. San Diego-Carlsbad-San Marcos, CA
9. Raleigh-Cary, NC
10. Hartford-West Hartford-East Hartford, CT
And for good measure, here are the rankings for the smallest cities in the country, defined as those with less than 300,000 residents.

The 10 Happiest Small Cities
1. Burlington-South Burlington, VT
2. Olympia, WA
3. Bellingham, WA
4. Bremerton-Silverdale, WA
5. Topeka, KS
6. Barnstable Town, MA
7. Charlottesville, VA
8. Kennewick-Pasco-Richland, WA
9. Medford, OR
10. Amarillo, TX
How You Doin’? 
To come up with its rankings, Gallup conducted daily interviews throughout 2010 with a total of 352,840 Americans (about 1,000 interviews a day), and asked them a series of questions grouped into six broad categories:

  • Life Evaluation. The big question here was to rate your current life on a scale of 0-10 (10 being the best) and then imagine your life five years out and give another rating. (Honolulu was #1 in this category.)
  • Physical Health: Respondents were asked to weigh in on whether they had any health issues that prevented them from doing any age-appropriate stuff and how many days over the past month had they been ill enough that it messed up their plans . They were also queried on current physical ailments — such as high cholesterol, diabetes, and heart conditions — and whether they had a cranky neck, back, knee, or leg in the past year that had caused chronic pain. (Boulder was #1 in this category)
  • Healthy Behavior: The usual suspects here: the survey asked about cigarette smoking, the number of weekly workouts (at least 30 minutes long), and how many days out of the week respondents managed to eat five or more servings of fruits and veggies. (Salinas, CA — think Monterey/Carmel — was #1 in this category)
  • Emotional. Questions included: Were you treated with respect all day yesterday? (the survey did not provide breakout data on respondents with teenage kids), did you smile or laugh a lot yesterday?, and did you learn or do something interesting yesterday? (Honolulu was #1 in this category)
  • Work: Among the questions in this section: Are you satisfied/dissatisfied with your job?, do you get to use your strengths so you can do what you do best?, does your supervisor behave like a boss or a partner?, and does your supervisor create a trusting and open work environment?(Gainesville, Fla was #1 in this category.)
  • Basic Access. This section was a bit of the kitchen sink variety. Medical-related questions included whether respondents had been to a dentist in the past year, have a personal doctor, and have health insurance. It also included a series of questions about general satisfaction/dissatisfaction with the city/region, the availability of fresh fruits and vegetables, and how safe it feels to walk alone at night. (Holland-Grand Haven, Mich. was #1 in this category.)

Administrative History of Chicago Federation of Settlements and Neighborhood Centers

The Chicago Federation of Settlements and Neighborhood Centers (CFSNC) was founded at Hull-House in 1894 by representatives from Hull-House, Northwestern University Settlement, Maxwell Street Settlement, University of Chicago Settlement, Epworth House and Chicago Commons. The Federation brought together settlement workers, social work professionals, and supporters of the settlement house movement from all around the City of Chicago. As part of its mission, the CFSNC provided settlement workers with a forum to share objectives and ideas, organized and conducted studies of local economic conditions, planned charitable events, coordinated activities of area settlements, and cooperated with outside social service agencies.

From 1894-1921, the Federation grew to include thirty-six members and opened an office in downtown Chicago. In 1922, the Chicago Federation of Settlements was incorporated by the State of Illinois. The charter named six prominent Chicago settlement workers as directors: Jane Addams, Hull-House; Harriet E. Vittum, Northwestern University Settlement; Lea D. Taylor, Chicago Commons; Ruth Austin, Gad’s Hill Center; Mrs. Beryl T. Gould, House of Happiness; and Winifred Salisbury. The enumerated objectives of the Federation were: “to act as a clearing house for information about settlements and their work; a placement bureau for settlement workers; to provide information and advice regarding training and to co-ordinate the activities of the settlement houses of the City of Chicago.”

The bulk of the CFSNC Collection chronicles the years between 1961-1980 during the Executive Directorship of Clarence W. Boebel. During Boebel’s tenure the CFSNC expanded the national Volunteers in Service to America (VISTA) program, founded pre-Kindergarten education programs (i.e. Head Start and Day Care), and created the United Settlement Appeal as a fund-raising mechanism for social service agencies. The CFSNC also cooperated with outside social service agencies such as the National Federation of Settlement and Neighborhood Centers, Welfare Council of Metropolitan Chicago, Chicago Committee on Urban Opportunity, the Model Cities project, and the Illinois Commission on Children.

Though the Federation served as an umbrella organization for the settlement movement, Boebel’s leadership style privileged local autonomy over centralized decision-making. In 1980, Boebel reflected on his career and the necessity for social workers to continue to settle in Chicago’s lower-income neighborhoods. Boebel instructed the next generation of social workers: “The only [approach] that really worked was the simplest one. That was: regardless of your culture or ethnic differences, you settled in the neighborhood and said – What is it we can do together?”

Supporting Boebel was a cadre of staff including: Mary De Johnette, Director of Education services; Gladys Hilton, Coordinator of Social Action; Mattie Wright, Director of Finance, and Althea Murray, Director of the summer youth employment program. Hilton served as Director of the Social Education and Action committee (SEA) that lobbied state and city legislators to improve child care and welfare policymaking. De Johnette helped found Head Start and Day Care programs in Chicago in the early 1960s. In 1980, De Johnette replaced Boebel as Executive Director of the CFSNC.

Return to Table of Contents »


Scope and Contents

This collection reflects the history, activity, leadership, and mission of the CFSNC and its relationship with outside service agencies, government bodies, and the public. The bulk of the collection consists of material about social work in Chicago between the years 1960-1980. The collection illustrates the CFSNC’s efforts to improve child care, education, housing, and access to health care in lower-income neighborhoods in the City of Chicago. The files contain correspondence, photographs, newsletters, articles, brochures, professional journals, newspaper clippings, legal publications, handbooks, meeting minutes, and annual reports.

The collection is divided into four series reflecting the administrative organization of the CFSNC. The committee file series illustrates the day-to-day operations of the CFSNC through meeting minutes, budget reports, and correspondence. The reference file series reveals the myriad community issues that Chicago social workers addressed from 1960-1980 and consists of reports, surveys, and studies conducted by local, state, and national social service agencies. The member agency series includes organizational records of over thirty Chicago settlements and neighborhood centers between the years 1950-1970. The member agency photograph series contains photographs of Chicago area settlements between the years 1905-1975.

 

Advertisements

Esri enriches maps with Tweets and the Streaming API

New Idea

On March 11, 2011, a 9.0 magnitude earthquake struck near the east coast of Honshu, Japan. As the news broke, many turned to Twitter to get the latest updates from people on the ground who experienced the disaster first hand. Within hours of learning about the devastating event, the @Esri team used Twitter to launch an interactive map that combined trusted sensor data with Tweets and other social feeds like Flickr and YouTube. The team layered Tweets over an information-rich map that showed earthquake location, a shakemap, and aftershocks from USGS. The resulting product helped the world understand the impact of the earthquake and resulting tsunami.

Adding Tweets to mapping technology gives insights into what people are saying and where they are saying it. It can highlight spatial trends in the conversation. Combining a Twitter conversation with authoritative data sources, like 911 calls, insurance claims, demographics, weather reports, and earthquake feeds, can provide a human perspective on the situation. By adding social intelligence to its mapping and analyzing the Twitter conversations, Esri visualizes the most engaging Tweets over space and time to get a better understanding of how a crisis event spreads and where resources are needed. Esri maps can even help predict the weather, just take a look below.

Implementation

@Esri‘s proof of concept uses public Tweets to tell the story of what is happening on the ground in real-time. This has been hugely successful and has allowed the team to generate more projects that use Twitter in decision making platforms for retail, public safety, and insurance customers.

Esri’s Twitter mapping work began with the Twitter Search API. Although the API provided a low barrier of entry for accessing geo-tweets filtered by topic, Esri quickly realized that the quantity of information available through the Search API could not facilitate decision making. Esri turned to Twitter’s data partner Gnip to provide a source of data that they combined with their spatial analysis engine. Esri has prototyped and will switch to using the Streaming API to find Tweets for all pubic facing applications on Esri.com, like this Severe Weather Map.

Impact

The Japan earthquake map was picked up by news organizations including CNN, ABC, Al Jazeera, and Wired resulting in over 500,000 page views to the application on Esri.com in the days following the event. Typical page views for Esri.com disaster response pages are around 5,200 per week. Esri customers and partners have also had great success implementing Twitter in their maps. Esri’s Spain’s map of the 2011 elections, combining demographics, polling locations, and social conversation, received 4 million requests per hour at its peak and was linked from the home page of Spain’s largest media organization.

As a side note, Esri built the Pubic Information Map application featured in the maps in this case, and encourages readers to go to ArcGIS.com to download the code and begin exploring social media mapping for workflows.

Using the Twitter Search API

Limitations

  • The Search API is not complete index of all Tweets, but instead an index of recent Tweets. At the moment that index includes between 6-9 days of Tweets.
  • You cannot use the Search API to find Tweets older than about a week.
  • Queries can be limited due to complexity. If this happens the Search API will respond with the error:{"error":"Sorry, your query is too complex. Please reduce complexity and try again."}
  • Search is focused in relevance and not completeness. This means that some Tweets and users may be missing from search results. If you want to match for completeness you should consider using the Streaming API instead.
  • The near operator cannot be used by the Search API. Instead you should use the geocode parameter.
  • Queries are limited to 1,000 characters in length, including any operators.
  • When performing geo-based searches with a radius, only 1,000 distinct subregions will be considered when evaluating the query.
  • In API v1.1, the Search API requires some form of authentication — either OAuth 1.0A or app-only auth
  • Recent Enhancements

    • API v1.1’s Search methods return tweets in the same format as other REST API methods.
    • Classic pagination is not offered in API v1.1. You must use since_id and max_id to naviagte through results.
    • The user IDs returned in the Search API now match the user IDs utilized in the Twitter REST & Streaming APIs. You no longer need to maintain a mapping of “search IDs” and “real IDs.”
    • In v1, use include_entities=true to have Tweet Entities included for mentions, links, media, and hashtags.
    • in_reply_to_status_id and in_reply_to_status_id_str are now included with @replies, allowing you to know the replied-to status ID, which can be looked up using GET statuses/show/:id.

    Rate Limits

    Rate Limiting on API v1.1’s search/tweets

    The GET search/tweets is part of the Twitter REST API 1.1 and is rate limited similarly to other v1.1 methods. See REST API Rate Limiting in v1.1 for information on that model. At this time, users represented by access tokens can make 180 requests/queries per 15 minutes. Using application-only auth, an application can make 450 queries/requests per 15 minutes on its own behalf without a user context.

    Rate Limiting on deprecated search.twitter.com

    The Rate Limits for the legacy Search API are not the same as for the REST API. When using the Search API you are not restricted by a certain number of API requests per hour, but instead by the complexity and frequency.

    As requests to the Search API are anonymous, the rate limit is measured against the requesting client IP.

    To prevent abuse the rate limit for Search is not published. If you are rate limited, the Search API will respond with an HTTP 420 Error. {"error":"You have been rate limited. Enhance your calm."}.

    PUTTING TWEETS ON THE MAP: LESSONS LEARNED AND THE WAY FORWARD

    On July 20, 2012 by Nate Ricklin

    Twitter Big Data + Geolocation = Massive Insight

    It’s a simple idea: Twitter + Geo.  What are people saying and where are they saying it?  These are basic questions, but getting the answers is surprisingly difficult.  In this blog post I’ll talk about some of the shortcomings with the Geo layer in Twitter’s API offerings, and what we built to get the functionality that we needed.

    At first glance using Twitter’s built-in “geo” functionality seems pretty straightforward, but dive into it and you’ll soon realize that there’s a lot to be desired.  In fact, Talking with my good buddy Charles at GNIP, catching a stream of tweets coming from a geographic area is notoriously difficult, and there’s no clear good way to do it yet.

    Twitter’s Built-in Geo-tags

    The first thing you might try when trying to put tweets on the map is looking at the “geo” field in tweets returned from the Twitter Search API.  Go ahead, try it out:  http://search.twitter.com/search.json?q=blue%20angels .  Look at the “geo” fields in the returned results, and you’ll see that exactly zero tweets have embedded geotags.  In our own internal testing, we typically see that only about a quarter to a half a percent of tweets actually have embedded geotags.  I’ve never seen it above 1%.  That’s a lot of data flying around without a home.

    Search API Location Information

    Twitter’s search API allows you specify a location (in lat/lng) and a radius that those tweets should originate within, and it goes by both actual embedded geotags in tweets as well as the “location” field that people fill out in their Twitter profiles in free-form fashion.  Problem solved, right?

    Well, not quite.  There are still a couple of problems with this:

    If you’re monitoring many keywords, the number of searches you need to perform (number of keywords you care about times the number of locations you care about) starts to really add up and you quickly run into API limits trying to track it all.

    The second problem is that Twitter’s Search API location search has been, and remains buggy and inconsistent.  Here are a few links to some of the issues that I’ve been following on this front:

    https://dev.twitter.com/discussions/3360 – General Location Bugginess

    https://dev.twitter.com/discussions/4004 – Geocode search results fall out of specified radius

    https://dev.twitter.com/issues/98 – Issue #98: Geocode search results fall out of specified radius (allegedly fixed as of 2012-05-17)

    https://dev.twitter.com/discussions/4003 – Geocode search volume lower than expected

    https://dev.twitter.com/issues/141 – Issue #141: Geocode search volume lower than expected (not resolved)

    But check this out: Perform this geo-search out in the Nevada desert:

    Streaming API Location Information

    Well maybe the Twitter Streaming API offers a solution? The main problem with the Streaming API is that you can filter by keywords OR filter by location, but not both at the same time.  Here’s the official word from the Twitter documentation:

    http://tomnod.com/2012/07/20/putting-tweets-on-the-map-lessons-learned-and-the-way-forward/

mapping with twitter APIs

How To Use The New Twitter API

About

@Tweereal is the map of twitter users activity in real-time. Animation on the map include only tweets containing geo-tags. There are two types of tweets on a map: with the exact coordinates and the coordinates determined with an accuracy of 1 degree (more transparent). Based on Twitter Streaming API and Google Maps Javascript API.

For live testing: be sure that your “test tweet” contains geotag (coordinates). Even with coordinates your tweet could be rate limited by Twitter API (see “Twitter API flow quality” field and try to tweet several times) or dropped by our filter as tweet with low precision.

http://tweereal.com/

http://www.codecademy.com/zh/courses/ruby-intermediate-en-rUwFe/0/1?curriculum_id=5122d5f811fbdb5456005922

 

 

In today’s tutorial we will create an interactive Google map using the geocoding service. Using the Twitter API we will retrieve the user’s location, and then display the profile picture on the map. We will also add the click action, after which we will retrieve the user’s 5 latest tweets.

THE MARKUP

At the beginning let’s write some simple HTML code.

<div id="map"></div>
<div class="twitter">
    <div class="inside"></div>
</div>
<div class="posts"></div>
<div class="get">
    <input type="hidden" value="marcinmobily" />
    <input type="hidden" value="codrops" />
    <input type="hidden" value="onextrapixel" /> 
    <input type="hidden" value="smashingmag" />          
    <input type="hidden" value="umutm" />
    <input type="hidden" value="1stwebdesigner" />   
    <input type="hidden" value="chriscoyier" />  
    <input type="hidden" value="marcofolio" />           
</div>   

Let’s examine the code line-by-line. The first “div” will display a Google map. Another “div” is the place where we store the description, name and profile picture of the Twitter users. Next, we create a “div” which will display the last 5 tweets.

At the end of the block, we store the Twitter user name, which will be used to download the location. If this is already done, we can proceed to write the JavaScript code.

THE JAVASCRIPT

At the beginning we should define the global variables.

1
var map, geocoder, marker, ey, my, mouseDown = false;

Then we create the main object that will incorporate all functions used by us. The most important function in this object is the ‘init’ function.

1
2
3
4
5
6
7
var map, geocoder, marker, ey, my, mouseDown = false;
var o = {
    init: function(){
        // in this place we will call all needed functions
    }
}
$(function(){ o.init(); }  

Let’s create a new object called “map” in the main “o” object. It is an object, where the function initiating a Google Map will be placed. The first function in this object is the “size” function, where we draw the current window size. This is what we need in order to display the map in full screen. Then we create the object entitled “data” with the parameters: “zoom”, “center” and “mapTypeId”. When the DOM is ready we call the init function.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var map, geocoder, marker, ey, my, mouseDown = false;
var o = {
    init: function(){
        this.map.init();
    },
    map: {
        size: function(){
            var w = $(window).width(),
                h = $(window).height();
            return { width: w, height: h }
        },
        data: {
            zoom: 3,
            center: new google.maps.LatLng(52, 23),
            mapTypeId: google.maps.MapTypeId.ROADMAP
        },
        init: function(){
            var size = o.map.size();
            $('#map').css({ width: size.width, height: size.height });
            map = new google.maps.Map(document.getElementById('map'), o.map.data),
            geocoder = new google.maps.Geocoder();
            google.maps.event.addListener(map, 'dragstart', function(){
                $('.posts').hide();
            });
        }
    }
}
$(function(){ o.init(); }  

The next step is to create an object, where we will retrieve the Twitter user data such as name, description, location and the path to the profile picture. First, we create a function where we will retrieve the value of the ‘input’ fields and we will store it in the array. The next stage is another function where every element of previously created tables is looped. Thus, by using the Twitter API, we can extract the user’s location and using a geocoding service we can convert it to geographic coordinates. At the end, we show the user in the right place on the map and put the name, description and user picture to a blank ‘div’ just called ‘twitter’ 😉

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
var map, geocoder, marker, ey, my, mouseDown = false;
var o = {
    init: function(){
        this.map.init();
        this.twitter.show();
        this.twitter.click();
    },
    twitter: {
        get: function(){
            var arr = new Array;
            $('.get').find('input').each(function(i){
                var t = $(this),
                    val = t.val();
                arr[i] = val;              
            });
            return arr;
        },
        show: function(){
            var users = o.twitter.get(),
                arr = new Array;
            for (i in users){
                var user = users[i];
                $.getJSON('http://twitter.com/users/show/'+user+'.json?callback=?', function(data) {
                    var img = data.profile_image_url,
                        screen_name = data.screen_name;
                    geocoder.geocode({ address: data.location }, function(response, status){
                        if (status == google.maps.GeocoderStatus.OK) {
                            var x = response[0].geometry.location.lat(),
                                y = response[0].geometry.location.lng();
                            marker = new google.maps.Marker({
                                icon: img,
                                map: map,
                                title: screen_name,
                                position: new google.maps.LatLng(x, y)
                            });
                            arr.push('<div>');
                            arr.push('<p><a href="#" rel="'+screen_name+'"><img src="'+img+'" alt="" /></a></p>');
                            arr.push('<div>');
                            arr.push('<a href="#" rel="'+screen_name+'">'+data.name+'</a>');
                            arr.push('<p>'+data.description+'</p>');
                            arr.push('<p><a href="'+data.url+'" target="_blank">'+data.url+'</a></p>');
                            arr.push('<p>Followers: '+data.followers_count+', Following: '+data.friends_count+'</p>');
                            arr.push('</div>');
                            arr.push('</div>');
                            var html = arr.join('');
                            arr = [];
                            $('.twitter').find('.inside').append(html);
                            google.maps.event.addListener(marker, 'click', function(){
                                o.twitter.open(this.title);
                            });
                        }
                    });
                });
            }
        },
        click: function(){
            $('.twitter').find('.open').live('click', function(){
                var t = $(this), rel = t.attr('rel');
                o.twitter.open(rel);
            });
        },
        open: function(user){
            var posts = $('.posts'), arr = new Array;
            $.getJSON('http://twitter.com/status/user_timeline/'+user+'.json?count=5&callback=?', function(data) {
                $.each(data, function(i, post){
                    arr.push('<div>');
                    arr.push(post.text);
                    arr.push('</div>');
                });
                var html = arr.join('');
                posts.html(html).fadeIn();
            });
        }
    },
    map: {
        size: function(){
            var w = $(window).width(),
                h = $(window).height();
            return { width: w, height: h }
        },
        data: {
            zoom: 3,
            center: new google.maps.LatLng(52, 23),
            mapTypeId: google.maps.MapTypeId.ROADMAP
        },
        init: function(){
            var size = o.map.size();
            $('#map').css({ width: size.width, height: size.height });
            map = new google.maps.Map(document.getElementById('map'), o.map.data),
            geocoder = new google.maps.Geocoder();
            google.maps.event.addListener(map, 'dragstart', function(){
                $('.posts').hide();
            });
        }
    }
}
$(function(){ o.init(); }  

Lastly, we will add a ‘scroll’ object that has a function called ‘init’ which is responsible for scrolling the ‘.twitter’ div vertically.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
var map, geocoder, marker, ey, my, mouseDown = false;
var o = {
    init: function(){
        this.map.init();
        this.twitter.show();
        this.twitter.click();
    },
    twitter: {
        get: function(){
            var arr = new Array;
            $('.get').find('input').each(function(i){
                var t = $(this),
                    val = t.val();
                arr[i] = val;              
            });
            return arr;
        },
        show: function(){
            var users = o.twitter.get(), // retrieve all users which are stored in html
                arr = new Array;
            for (i in users){
                var user = users[i];
                $.getJSON('http://twitter.com/users/show/'+user+'.json?callback=?', function(data) {
                    var img = data.profile_image_url,
                        screen_name = data.screen_name;
                    geocoder.geocode({ address: data.location }, function(response, status){
                        if (status == google.maps.GeocoderStatus.OK) {
                            var x = response[0].geometry.location.lat(),
                                y = response[0].geometry.location.lng();
                            marker = new google.maps.Marker({
                                icon: img,
                                map: map,
                                title: screen_name,
                                position: new google.maps.LatLng(x, y)
                            });
                            arr.push('<div>');
                            arr.push('<p><a href="#" rel="'+screen_name+'"><img src="'+img+'" alt="" /></a></p>');
                            arr.push('<div>');
                            arr.push('<a href="#" rel="'+screen_name+'">'+data.name+'</a>');
                            arr.push('<p>'+data.description+'</p>');
                            arr.push('<p><a href="'+data.url+'" target="_blank">'+data.url+'</a></p>');
                            arr.push('<p>Followers: '+data.followers_count+', Following: '+data.friends_count+'</p>');
                            arr.push('</div>');
                            arr.push('</div>');
                            var html = arr.join('');
                            arr = [];
                            $('.twitter').find('.inside').append(html);
                            google.maps.event.addListener(marker, 'click', function(){
                                o.twitter.open(this.title);
                            });
                        }
                    });
                });
            }
        },
        click: function(){
            $('.twitter').find('.open').live('click', function(){
                var t = $(this), rel = t.attr('rel');
                o.twitter.open(rel);
            });
        },
        open: function(user){
            var posts = $('.posts'), arr = new Array;
            $.getJSON('http://twitter.com/status/user_timeline/'+user+'.json?count=5&callback=?', function(data) {
                $.each(data, function(i, post){
                    arr.push('<div>');
                    arr.push(post.text);
                    arr.push('</div>');
                });
                var html = arr.join('');
                posts.html(html).fadeIn();
            });
        }
    },
    map: {
        size: function(){
            var w = $(window).width(),
                h = $(window).height();
            return { width: w, height: h }
        },
        data: {
            zoom: 3,
            center: new google.maps.LatLng(52, 23),
            mapTypeId: google.maps.MapTypeId.ROADMAP
        },
        init: function(){
            var size = o.map.size();
            $('#map').css({ width: size.width, height: size.height });
            map = new google.maps.Map(document.getElementById('map'), o.map.data),
            geocoder = new google.maps.Geocoder();
            google.maps.event.addListener(map, 'dragstart', function(){
                $('.posts').hide();
            });
        }
    },
    scroll: {
        mouse: function(e){
            var y = e.pageY;
            return y;
        },
        check: function(y){
            var all = $('.twitter').height(),
                inside = $('.twitter').find('.inside').height();
            if (y < (all - inside)) {
                y = all - inside;
            } else if (y > 0) {
                y = 0;
            }
            return y;
        },
        update: function(e){
            var y = o.scroll.mouse(e),
                movey = y-my,
                top = ey+movey;
                check = o.scroll.check(top);
            $('.twitter').find('.inside').css({ top: check+'px' });
        },
        init: function(){
            $('.twitter').find('.inside').bind({
                mousedown: function(e){
                    e.preventDefault();
                    mouseDown = true;
                    var mouse = o.scroll.mouse(e);
                        my = mouse;
                    var element = $(this).position();
                        ey = element.top;
                    o.scroll.update(e);
                },
                mousemove: function(e){
                    if (mouseDown)
                        o.scroll.update(e);
                    return false;
                },
                mouseup: function(){
                    if (mouseDown)
                        mouseDown = false;
                    return false;
                },
                mouseleave: function(){
                    if (mouseDown)
                        mouseDown = false;
                    return false;
                }
            });
        }
    }
}
$(function(){ o.init(); }  

THE CSS

First, we will embed our reset.css that will reset all the basic styles, and we’ll define some main properties:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@import url("reset.css");
html, body {
    margin:0;
    padding:0;
}
body {
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    color:#333;
    line-height:18px;
}
a {
    text-decoration:none;
    color:#fff;
}

Next, we will define the styles for the map, Twitter posts and descriptions.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.twitter {
    position:fixed;
    left:0;
    bottom:0;
    background:#000;
    background:rgba(0, 0, 0, .7);
    width:100%;
    height:180px;
    color:#fff;
    overflow:hidden;
}
.twitter .inside {
    position:absolute;
    top:0;
    left:0;
    cursor:n-resize;
}
.twitter .item {
    float:left;
    width:280px;
    padding:20px;
}
.twitter .item .img {
    float:left;
    width:48px;
}
.twitter .img img {
    -moz-box-shadow:0 0 5px #000;
    -webkit-box-shadow:0 0 5px #000;
    box-shadow:0 0 5px #000;
}
.twitter .item .entry {
    float:right;
    width:215px;
    height:140px;
    color:#eee;
    font-size:11px;
    position:relative;
}
.twitter .item .count {
    position:absolute;
    left:0;
    bottom:-10px;
    font-size:10px;
    text-transform:uppercase;
}
.twitter .item .title {
    font-size:13px;
    font-weight:bold;
    color:#fff;
}
.twitter .item .url a {
    text-decoration:underline;
}
.twitter .item p {
    margin-bottom:5px;
}
.posts {
    display:none;
    position:absolute;
    left:50%;
    margin-left:-310px;
    width:580px;
    bottom:180px;
    background:#fff;
    color:#fff;
    background:#000;
    background:rgba(0, 0, 0, .7);
    padding:20px;
}
.posts .post {
    float:left;
    clear:both;
    width:100%;
    margin-bottom:20px;
    font-size:12px;
    font-weight:bold;
}

CONCLUSION

In today’s tutorial you learned how to use a geocoding service and how to use the Twitter API. An important fact to remember is that Google has imposed some limits to its geocoding service. Maximum number of requests in one day from a single IP address is 2500. Also, Twitter will rate limit the IP address from which the request was made.

http://tympanus.net/Tutorials/InteractiveGoogleMapTwitter/

 

What makes a city happy? BY LEWIS MITCHELL

Here is a research of what are the factors that makes a city happy.  and this research is originally done by Lewis Mitchell.

A number of people wondered how variations in happiness relate to different underlying social and economic factors. To try to answer this question, they took data from the 2011 census (all helpfully available online on the Census Bureau’s American FactFinder website) and correlated it with their measure of happiness. Surprisingly, happiness generally decreases with the number of tweets per capita in a city (this doesn’t mean that tweeting more will make people less happy, it’s only a correlation):

Next, they grouped covarying demographic characteristics obtained from the census, and looked at how these clusters varied with happiness. For example, it might not surprise people that cities with a larger percentage of married couples also contain a larger percentage of children – this is what they mean by covarying demographics.  And people might or might not be surprised that more marriage is positively correlated with happiness.  There’s plenty of scatter but the connection is there:

the research group used an automated algorithm to bin the census data for us into eight groups and then compared the happiness of those groups, leading to the following figure:

Each point represents a characteristic from the census (for example, the % married/happiness plot above is now represented by one point in this figure), with the horizontal groupings representing covarying demographic characteristics. A point’s position on the vertical axis shows how that characteristic varies with happiness across all cities. A positive value means that happiness is higher in cities where that characteristic is higher, while a negative value means that happiness is lower in cities where that characteristic is higher. For example, the figure shows that as the percentage of married couples in a city increases, so does the average happiness of that city (no causality is implied).

A more interesting question might be how word usage varies with different demographics – to do this we correlated each word with each demographic characteristic across all 373 cities in our dataset, leading to a lot of data to sift through! (And you can too, by following the link in the above paragraph.) As an example, take a look at how the word “cafe” varies with the percentage of population with a college degree:

Each point in the figure represents one city, and broadly the trend is that the more “college-y” the city is, the more people talk about cafes online. (You can decide for yourself whether that’s surprising or not). The top 10 emotive words whose usage went up as percentage of population with a college degree went up turned out to be:

  1. cafe
  2. pub
  3. software
  4. yoga
  5. grill
  6. development
  7. emails
  8. wine
  9. art
  10. library

And the emotive words which went up as college degrees went down?

  1. me
  2. love
  3. my
  4. like
  5. hate
  6. tired
  7. sleep
  8. stupid
  9. bored
  10. you

Umapper, tool to map tweets

The UMapper plugin is a universal mapping platform that makes it a snap to create engaging maps and add them to your blog posts.

Microsoft Bing, Google Maps, Yahoo, OpenStreet and CloudMade are all supported by this truly universal plugin.

Home page of Umapper: http://www.umapper.com/

The latest from UMapper.com (@umapper). The easiest way to create, distribute, track, monetize online maps. See http://wwww.umapper.com for more info.

UMapper

UMapper is a universal map authoring application, which allows users to create interactive maps and distribute them online. UMapper works with map providers such as OpenStreetMap, Microsoft Virtual Earth, Google and others.

The current version supports points, lines, polygons as well as geonames and Wikipedia search.

UMapper is built using proprietary mapping API UMap. Saved maps can be exported as KML or ActionScript 3.0.

UMapper map authoring application is available as a plugin for WordPress.

Read more: http://www.crunchbase.com/company/umapper#ixzz2eecGff9t

http://wordpress.org/plugins/umapper/

how does twitter work

Twitter is undeniably useful as a standalone service, but it becomes so much more fun when you start factoring in all the cool tools and awesome apps available.

We’ve previously brought you various Twitter visualization services, but now we’re taking a look at mapping tools that work with the microblogging site.

Whether you want to see where you’ve tweeted from in the past, what others around you are saying, or get a global overview of a hashtag, read on for some fun tools that can help.

1. TrendsMap

This service offers real-time mapping of Twitter trends across the world. They are displayed as hashtags, @mentions or keywords superimposed over a world map. You can click on any word to see a real-time stream of relevant tweets to, in the words of the site, “see what the global, collective mass of humanity are discussing right now.”

This is a really nice visual version of looking at Twitter’s trending topics but if you want to go into more detail, you can select to view trends from various cities, or focus in on a trending topic to see where in the world it’s being mentioned.

http://trendsmap.com/

2. Tweography

The fantastically-named Tweography has an interesting function — it maps where your tweets have been sent from. If you have a geo-location-enabled Twitter account, you can sign in to see your tweets plotted on a map, which will probably be more interesting for jet-setters than anyone who stays within a few miles of home. If you’re signed into the service, you can do the same for other Twitter users’ recent tweets to see where they’ve been of late.

3. TwitterMap.tv

Similar to the excellent TwitterVision site, TwitterMap.tv gives you a real-time global view of tweets across the world. However, if you’d prefer to see region-specific tweets, you can head toTwitterMap.us for America or TwitterMap.eu for Europe.

All its sites work the same way. To use the service on its most basic setting, just hit “play” to see random tweets pop up across the map. There are also more advanced options. If you search via keyword, you can see all its related tweets play out automatically across the region map, or even narrow it down to a city. You can also search for a Twitter name to see all its mentions.

The service provides a nice level of detail — as tweets pop up, you can see the profile pic of the tweeter as well as basic info about him or her, such as location and follower/following counts

4. Stweet

This experimental service mashes up Twitter with Google Street View, providing a location-based look at neighborhood tweets. You can look at certain cities across the globe from the drop-down menu or enter a location into the search bar. Then just sit back and wait as the page reloads with tweets and Street Views (the satellite view pop up when street views are unavailable). It’s not a full-fledged offering just yet, but it’s worth a glance next time you’ve got a few spare minutes to explore.

5. MMMeeja’s Twitter Google Map

Ever wonder what your Twitter contacts look like mapped out? MMMeeja’s Google Maps mashup will show you the people you follow on Twitter (if they have supplied their locations) as points on a map. You can zoom in and hover over the pins to see who is where, which is quite fascinating if you haven’t thought of a particular person tweeting from a geographical context. The service is available as an embed, so you can add it to a blog, site, etc., to share with others.

http://mashable.com/2010/08/06/twitter-mapping-tools/