Shared posts

16 Jun 02:44

The Australian Capital Makes It Illegal to Throw Objects at Bicyclists

by Hilary Angus

Apparently common decency isn't enough of a motivator.

The post The Australian Capital Makes It Illegal to Throw Objects at Bicyclists appeared first on Momentum Mag.

28 May 07:27

Why Should We Support the Idea of an Unconditional Basic Income?

18 Feb 20:01

Using jspm with Visual Studio 2015 and ASP.NET 5

by scott@OdeTocode.com

If you’ve been following along with the developments for ASP.NET vNext and Visual Studio 2015, you’ve probably seen the JavaScript tooling of choice for File –> New projects is Grunt and Bower.

But, what if you wanted to use more sophisticated and productive tools, like Gulp and jspm?

In this post, we’ll get setup using jspm instead of Bower, and write some ES6 code with CTP5 of Visual Studio 2015.

jspm

In a nutshell: jspm combines package management with module loading infrastructure and transpilers to provide a magical experience. You can write code using today’s JavaScript, or tomorrow’s JavaScript (ES6), and use any type of module system you like (ES6, AMD, or CommonJS). jspm figures everything out. By integrating package management with a smart script loader, jspm means less work for us.

1. Get Started

In VS2015 we’ll start with a minimum set of features by using File –> New Project, selecting “ASP.NET Web Application” and using the “ASP.NET 5 Empty” template. With ASP vNext, the resulting project looks like the following.

ASP.NET 5 Empty Project

Notice the wwwroot folder, which is new for ASP5. The wwwroot folder is the default folder for static assets like CSS and JS files, and is literally the root of the web site. We can create a new default.html file in wwwroot as the entry page for the application.

<html>
<head>
    <meta charset="utf-8" />
    <title>Working with jspm</title>
</head>
<body>
    <div id="output">Testing</div>
</body>
</html>

Pressing Ctrl+F5 should run the application as always, but we’ll need to add /default.html to the URL as the web server won’t find a default file without some extra configuration (see ‘Making default.html the default’ later in this post).

image

2. Get jspm

Once you have both NodeJs and a command line Git client installed, jspm is simple to setup.

npm install –g jspm
jspm init

You’ll want to run jspm init from the root of the project, which is one level above the wwwroot folder.

The init command will ask a series of questions to setup a project.json file (yes, the same project.json that npm uses, unlike Bower which creates it’s own json file). During the questioning you can choose the ES6 transpiler to use. As you can see below I prefer the 6to5 transpiler over Traceur these days, but note that 6to5 was just renamed to Babel last week.

Here’s how to answer:

Package.json file does not exist, create it? [yes]:
Would you like jspm to prefix the jspm package.json properties under jspm? [yes]:
Enter server baseURL (public folder path) [./]: ./wwwroot
Enter project code folder [wwwroot\]:
Enter jspm packages folder [wwwroot\jspm_packages]:
Enter config file path [wwwroot\config.js]:
Configuration file wwwroot\config.js doesn't exist, create it? [yes]:
Enter client baseURL (public folder URL) [/]:
Which ES6 transpiler would you like to use, Traceur or 6to5? [traceur]: 6to5
ok   Verified package.json at package.json
     Verified config file at wwwroot\config.js
     Looking up loader files...
       system.js
       system.src.js
       system.js.map
       es6-module-loader.js
       es6-module-loader.src.js
       es6-module-loader.js.map
       6to5.js
       6to5-runtime.js
       6to5-polyfill.js

     Using loader versions:
       es6-module-loader@0.13.1
       systemjs@0.13.2
       6to5@3.5.3
ok   Loader files downloaded successfully

The most important answer is the answer to the public folder path (./wwwroot). 

We want jspm to work with a package.json file at the root of the project, but store downloaded packages and configuration in the wwwroot folder. This is one way to work with jspm, but certainly not the only way. If there is enough interest, we can look at building and bundling in a future post.

3. Write Some Script

Next, we’ll update the default.html file to bring in System.js, the dynamic module loader installed by jspm, and the config file created by jspm, which tells the loader where to make requests for specific module and libraries.

Inside the body tag, the markup looks like:

<div id="output">Testing</div>

<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>System.import("app/main");</script>

If we refresh the browser we should see some errors in the console that app/main.js couldn’t be loaded. This is  the System.import we requested in the above markup, and the syntax should be somewhat familiar to anyone who has used AMD or CommonJS modules before. The file can’t be loaded, because it doesn’t exist, so let’s create a main.js file in the app folder under wwwroot.

var element = document.getElementById("output");
element.innerText = "Hello, from main.js!";

Simple code, but a refresh of the browser should tell us everything is working.

systemjs running the app

Let’s make the code more interesting by adding a greeting.js file to the app folder in wwwroot.

export default element => {
    element.innerText = "Hello from the greeting module!";
};

Now we can change main.js to make use of the new greeting component (which is just an ES6 arrow function).

import greeter from "./greeting";

greeter(document.getElementById("output"));

The import / export syntax we are looking at is the new ES6 module syntax, which I haven’t covered in my series of ES6 posts, as yet, but we’ll get there. With the magic of System.js and friends, all this code, including the ES6 modules and arrow functions – it all just works.

running with es6 modules

4. Install Some Packages

The beauty of jspm is that we can now swing out to the command line to install new packages, like moment.js

> jspm install moment
     Updating registry cache...
     Looking up github:moment/moment
     Downloading github:moment/moment@2.9.0
ok   Installed moment as github:moment/moment@^2.9.0 (2.9.0)
ok   Install tree has no forks.

ok   Install complete.

 

This is just as easy as installing a package with Bower, but with jspm the package is ready to use immediately. Let’s change greeting.js to use moment:

import moment from "moment";

export default element => {

    let pleasantry = "Hello!";
    let timeLeft = moment().startOf("hour").fromNow();

    element.innerText = `${pleasantry} The hour started ${timeLeft}`;
};

And now the application looks like the following.

running with jspm and moment.js

5. Make default.html the default

In ASP.NET 5 there is no web.config, but modifying the behavior for static files is still fairly easy (not nearly as easy, but easy). Step one is to install the NuGet package for static file processing – Microsoft.AspNet.StaticFiles, then adding the following code to Startup.cs.

public class Startup
{
    public void Configure(IApplicationBuilder app)
    {
        app.UseFileServer(new FileServerOptions
        {
             EnableDefaultFiles = true,
             EnableDirectoryBrowsing = true,                   
        });            
    }
}

It’s really just the EnableDefaultFiles that will make our page appear at the root of the web site, because the static file handler will go looking for a default.html file on such a request.

6. Caveats

While everything shown here works well, the biggest hurdle to using ECMAScript 6 with Visual Studio 2015 is the editor, which doesn’t like ES6 syntax. You’ll want to keep another editor handy to avoid all the red squiggles under the import and export keywords, for example. We’ll have to hope ES6 syntax support is ready to go by RTM, because it is time to start using the new JavaScript.

04 Feb 17:49

Successful game makers share indie biz tips at GDC 2015

Speakers from Double Fine, Ouya, Devolver Digital, TinyBuild, Finji and more will be sharing their lessons learned as successful indie game makers during GDC 2015. ...

02 Feb 19:56

I just want to say thank you, /r/depression.

The past few months have been rough. Between a family death, the start of a new semester, and problems with my ex that eventually led us to breaking up, I've been overwhelmed with a lot of negativity. I've relapsed several times with self harm and had to fight off lots of suicidal thoughts. I have people to talk to, but no one quite understands the way you all do. This is one of the few places I feel fully accepted and supported. I thank you for that. Thanks for helping me deal with my loneliness.

submitted by I_Love_Spiders_AMA
[link] [1 comment]
08 Jan 19:20

I'm looking for a decent automatic cat box

by boo_radley
I know you are not my cat, and that any cat's reaction to a new situation may be terror and refusal. Having said that, I want to make the cat box chore to be less awful and am considering getting an automated cat box to take some of the ick factor out of the work.

Right now we have two cats and two plain old pan cat boxes with Fresh Step clay litter. My cats are terrible about spraying litter around the laundry room, even with a hood and cat box welcome mat in front of the exit. I suspect that's because they want more frequent cleanings than we can do.

In your experience as an automated cat box owner-slash-enthusiast, would having an automated setup reduce the need for constant manual cleanings? How often does one empty out the dunny bin? Is there different litter? Are there other consumables to consider?
05 Jan 21:51

My 'Purity Ring' Helped Me Feel Empowered by Sex

by S.H.I.N.

I have a purity ring.

I got it when I was nearly fifteen years old, accompanied by a lovely ceremony for which I wore a fluffy, beautiful white dress. After waltzing with my father and performing a dance as my talent, I, along with nine other girls, made a promise to not have sex until I was married.

When I turned twenty, that promise was broken. I cried right after the “deed” was done, and my bewildered boyfriend had to console me. I felt like I had failed.  That feeling continued, along with the pleasure from having sex, and I felt conflicted.

I liked sex, but I felt ashamed for having it. That feeling continued as I got older, but it eventually waned and evolved into an entirely different feeling: empowerment.

It was like a light bulb had gone off in my head. One day after “doing it” (Insert teenage girl giggle here), I thought, “Hot damn. I DID that,” and had an amazingly productive day afterwards.  I got through my entire to-do list, enjoyed wonderful memories of the interlude from that morning, and there wasn’t any shame, just an afterglow.   

Sex had become empowering. It was one thing to feel an energy boost, but an entirely different thing to feel as powerful as I did. After the years of looking at my ring and thinking, “My father would kill me if he knew the copious amounts of sex I just had with my boyfriend,” I grew to think of it as a reminder to not feel pressured to have sex (or not have sex).  

The ring now says “It’s YOUR decision.”

wedding ring
Image: Troy B. Thompson via Flickr

It is my decision whether or not I should have sex with whichever partner I choose. It is my decision whether or not I have sex at all.  The choice is mine, and if the other party doesn’t like it, too damned bad.  That outlook has helped me feel more open to explore sex.  There are so many ways to have it that I didn’t truly think of until my thoughts about sex in general changed.

It just so happened that I came into this new way of feeling toward the end of 2014. So in true New Year’s tradition, I made a goal list just for sex. First goal? Learn how to orgasm faster alone.  I’m sure it will bring me a source of pride, in addition to not feeling so pent up. 

The ring isn't all bad. It encouraged me to wait until I was older to have sex.  By the time I had it, I was on birth control, understood the necessity of using protection, and was open enough to talk about it honestly with my doctor.   I'm glad I waited until I was nearly 20. Having sex brought emotions that I know I wouldn't have been able to handle when I was 16 or 17 years old.  It gave me time to be more responsible with my body, and my emotions.

I'm 25 years old, and it took me five years to feel this positive about sex and now that I do, I won't look back.

 

05 Jan 21:45

Almost a T-Bone incident

05 Jan 21:32

What do we expect of a space program? (Synopsis) [Starts With A Bang]

by Ethan

“This Administration has never really faced up to where we are going in space… As a result, NASA is both drifting and lobbying for bigger things — without being able to focus realistically on what it should be doing.”
-
White House staff assistant Clay Thomas Whitehead, February 1971

What should we be doing with respect to our space program? At its peak — the mid-1960s — the US government spent somewhere around 20% of its non-military discretionary spending on NASA and space science/exploration. Today?

Image credit: OMB Historical Budget Tables.

Image credit: OMB Historical Budget Tables.

That number is down to 3%, the lowest it’s ever been. As far as our priorities as a nation go, is this right?

In an enraging talk at the annual American Astronomical Society meeting, John M. Logsdon argued that we should be happy, as a community, that we still get as much funding as we do, despite all the we could (and won’t) accomplish if our funding would increase.

Image credit: NASA / Science@NASA.

Image credit: NASA / Science@NASA.

Needless to say, I think we need to rethink this defeatist point of view. What’s your opinion?

29 Dec 20:05

Rep Cinema This Week: Gone Girl, The Cabinet of Dr. Caligari, and The Case Against 8

by Angelo Muredda

The best repertory and art-house screenings, special presentations, lectures, and limited engagements in Toronto.

At rep cinemas this week: David Fincher’s adaptation of Gillian Flynn’s bestselling mystery thriller, a classic of German Expressionism, and a look at the fight to overturn Proposition 8.


Gone Girl
Directed by David Fincher

Revue Cinema (400 Roncesvalles Avenue)
Showtimes


Early in David Fincher’s Gone Girl, surely the most rancid film about marital discord since Stanley Kubrick’s Eyes Wide Shut, our soon-to-be-beleaguered hero Nick (Ben Affleck) waltzes into the bar he co-owns bearing a new board game, Mastermind. His sister and business partner Go (Carrie Coon) files it away with staples such as Let’s Make a Deal and The Game of Life. You could think of that sly introduction as a moment of foreshadowing, gesturing toward what will happen to Nick once he finds himself charged with the possible murder of the titular missing woman, his wife Amy (Rosamund Pike), famous for her intricate schemes and micromanaging skills, and possibly in the middle of her best game yet. Or you could read it as Fincher’s own none-too-subtle nod to his reputation as a puckish control freak who loves to mess with his audiences as much as his characters—a way of positioning himself as a surrogate for his missing co-lead.

To say much more about Gone Girl—working off a script skillfully and ruthlessly adapted from her own novel by author Gillian Flynn—would risk spoiling its and-another-thing page-turning charm. Suffice it to say, it’s at once one of the most effective pulp thrillers of the year and one of the most uproarious black comedies, carefully attuned to the way bad marriages often play out like sustained delusions shared by two actors working with an increasingly dodgy script.


The Cabinet of Dr. Caligari
Directed by Robert Wiene
20141229cabinetofdrcaligari

TIFF Bell Lightbox (350 King Street West)
Tuesday, December 30, 7 p.m.


Like F.W. Murnau’s Nosferatu, The Cabinet of Dr. Caligari is the sort of film audiences tend to absorb through other works—the loving tributes of Tim Burton’s warped fantasias, or the direct nods in Martin Scorsese’s Shutter Island—before they see it outright. That’s a shame, because Robert Wiene’s horror classic is as psychologically nuanced as it is beautifully designed. It’s both influential, in the fusty old academic sense, and compelling.

As any undergraduate class in film studies is sure to point out, Wiene’s film is the most famous example of the German Expressionism that dominated the 1920s, and perhaps the purest case, years before signature directors such as Fritz Lang took their talents to Hollywood, and longer still before quirky filmmakers such as Burton bent the style to suit their kinder and gentler projects. Thumbing their noses at the codes of realism, expressionist filmmakers refused the burden of representing the world, turning their sets into hyper-aestheticized expressions of their cracked characters’ emotionally heightened states. Few of their works were as successful in that regard as The Cabinet of Dr. Caligari, which amplifies the intensity of the titular quack’s world before pulling back the curtain to reveal that vision as the paranoid fantasy of the straitlaced male lead.

Although a heady modernist streak certainly runs through the movement, you can see why Wiene’s film has proven accessible to such disparate artists over the years. If the deliriously winding roads and geometrically impossible backgrounds, which are painted onto the walls, don’t quite seem real, they nevertheless suggest a heightened form of reality all too recognizable for us paranoid spectators as the stuff of dreams and cinema.


The Case Against 8
Directed by Ben Cotner and Ryan White
20140522caseagainst8

Bloor Hot Docs Cinema (506 Bloor Street West)
Showtimes


Early in The Case Against 8—Ben Cotner and Ryan White’s documentary about the Supreme Court decision that overturned Proposition 8, which banned same-sex marriages in the state of California—attorney and conservative hero turned marriage-equality proponent Ted Olson announces that this is one of the most important civil rights cases in United States history. Perhaps out of a certain reverence for that significance, the film itself is a relatively safe bet, nicely illuminating the case’s behind-the-scenes process and its personal and political significances for the four co-plaintiffs without doing much to rock the boat.

Like most television documentaries about big issues, The Case Against 8 is limited by its form. There’s a TV-ready schmaltz to the filmmakers’ decision to depict the substance of the trial by having its participants read from their own transcripts over a swelling string score. The slickness of the packaging also minimizes a number of interesting points of contention. One comes away, for example, with the not terribly convincing impression that Olson took the case out of the goodness of his heart, and that the gay-rights groups who initially protested his involvement were merely partisan spoilsports, unable to see the forest for the trees. No doubt those activists would tell a different story if they were interviewed.

Whatever its weaknesses as a nuanced piece of LGBT history, the film is indispensable for process wonks curious about the way such human rights cases are assembled. Its tidiness aside, it’s also moving as a portrait of two dedicated couples fighting for their access to a basic human right.

18 Nov 03:59

dontneedfeminism: marinashutup: dontneedfeminism: Is...













dontneedfeminism:

marinashutup:

dontneedfeminism:

Is Complimenting a Woman Sexual Harassment?-Feminist Fridays

>majority of women

[citation needed]

I literally cite the statistic in the video but like why would you even bother watching that.

Y’know, typically when people “cite” things, they give an actual link to the original source so that everyone can review the data themselves and make sure that the presenter (or the data itself) is not biased.

You didn’t give a link, you just spoke. You’ll have to excuse me if I don’t feel like sitting through your video to find out whether or not you actually gave the title of the study/review that you got your data from.

Now if you wanna provide an actual link, we can continue the discussion.

Until then:

[citation needed]

I do give the title of the study with a graphic. It’s not my problem if you can’t be bothered to watch something before critiquing it or do a simple google search on something that would take .5 seconds to look up. Get your arrogance and laziness outta here.

28 Dec 09:58

CN Tower

by Staff
Mark Cidade

Just looking at this photo gives me vertigo.

10 Sep 09:41

People just toss them on the sidewalk like it's nothing.

17 Aug 15:25

Student debt and tuition hikes: destroying the lives of America's children

by Cory Doctorow


In Rolling Stone, Matt Taibbi takes a long, in-depth look at the scandal of student loans and tuition hikes, a two-headed parasite sucking America's working class and middle class dry as they plunge their children into a lifetime of ballooning debt in the vain hope of a better, college-educated future. The feds keep backing student loans, and the states keep cutting university funding, so the difference is made up by cranking up tuition and shifting the burden to future grads. Meanwhile, the laws that prohibit discharging student debt in bankruptcy, combined with ballooning default penalties (your $30K debt can rocket to $120K if you have a heart-attack and are bedridden and can't make payments) and the most ruthless, unsupervised, criminal collection agencies means that tens of millions of Americans are trapped in a nightmare that never ends -- student debt being the only debt that can be taken out of your Social Security check. Matt Taibbi is a national treasure, and Rolling Stone does us all a service by keeping him working.

If this piece moves you and you want to learn more, Don't miss "Generation of Debt," an important pamphlet on the subject from UC students.

They all take responsibility for their own mistakes. They know they didn't arrive at gorgeous campuses for four golden years of boozing, balling and bong hits by way of anybody's cattle car. But they're angry, too, and they should be. Because the underlying cause of all that later-life distress and heartache – the reason they carry such crushing, life-alteringly huge college debt – is that our university-tuition system really is exploitative and unfair, designed primarily to benefit two major actors.

First in line are the colleges and universities, and the contractors who build their extravagant athletic complexes, hotel-like dormitories and God knows what other campus embellishments. For these little regional economic empires, the federal student-loan system is essentially a massive and ongoing government subsidy, once funded mostly by emotionally vulnerable parents, but now increasingly paid for in the form of federally backed loans to a political constituency – low- and middle-income students – that has virtually no lobby in Washington.

Next up is the government itself. While it's not commonly discussed on the Hill, the government actually stands to make an enormous profit on the president's new federal student-loan system, an estimated $184 billion over 10 years, a boondoggle paid for by hyperinflated tuition costs and fueled by a government-sponsored predatory-lending program that makes even the most ruthless private credit-card company seem like a "Save the Panda" charity. Why is this happening? The answer lies in a sociopathic marriage of private-sector greed and government force that will make you shake your head in wonder at the way modern America sucks blood out of its young.

In the early 2000s, a thirtysomething scientist named Alan Collinge seemed to be going places. He had graduated from USC in 1999 with a degree in aerospace engineering and landed a research job at Caltech. Then he made a mistake: He asked for a raise, didn't get it, lost his job and soon found himself underemployed and with no way to repay the roughly $38,000 in loans he'd taken out to get his degree.

Collinge's creditor, Sallie Mae, which originally had been a quasi-public institution but, in the late Nineties, had begun transforming into a wholly private lender, didn't answer his requests for a forbearance or a restructuring. So in 2001, he went into default. Soon enough, his original $38,000 loan had ballooned to more than $100,000 in debt, thanks to fees, penalties and accrued interest. He had a job as a military contractor, but he lost it when his employer ran a credit check on him. His whole life was now about his student debt.

Ripping Off Young America: The College-Loan Scandal [Matt Taibbi/Rolling Stone]

(Image: cooperunion_dec08_DSC_0195, a Creative Commons Attribution Share-Alike (2.0) image from fleshmanpix's photostream)