Source:
/* | |
* Enhances 'require' from RequireJS with Promises API while preserving its original semantics. | |
*/ | |
(function() { | |
if (!Promise || !require) { | |
return; | |
} |
http://jsfiddle.net/GuQaV/show/ |
function [J, grad] = costFunctionReg(theta, X, y, lambda) | |
%COSTFUNCTIONREG Compute cost and gradient for logistic regression with regularization | |
% J = COSTFUNCTIONREG(theta, X, y, lambda) computes the cost of using | |
% theta as the parameter for regularized logistic regression and the | |
% gradient of the cost w.r.t. to the parameters. | |
% Initialize some useful values | |
m = length(y); % number of training examples | |
% You need to return the following variables correctly |
Following the AngularJS PARIS meetup (25/2 à 19h à Paris with @sampaccoud @dzen @_kemar @tchack13 @vinz et @revolunet)
Here's our best AngularJS ressources : twitter, github, articles & blogs. Please comment and add your good stuff !
- AngularJS VS jQuery : http://stackoverflow.com/questions/14994391/how-do-i-think-in-angularjs-if-i-have-a-jquery-background/15012542#15012542 (MUST READ for beginners)
- What are the nuances of scope prototypal / prototypical inheritance in AngularJS? : http://stackoverflow.com/questions/14049480/what-are-the-nuances-of-scope-prototypal-prototypical-inheritance-in-angularjs (MUST READ)
- twitter list maintained here: https://twitter.com/revolunet/angularjs
- must see vidéos :http://egghead.io (MUST SEE)
/** | |
* Using default click events in touch-supported devices | |
* incurs a delay (in order to determine if the user is performing a gesture). | |
* | |
* Detecting for touchstart events using the foloowing, we can replace the default 'clicks' | |
* for touch events, making a snappier experience for mobile/touch devices. | |
* Use wisely as this could prevent some gestures from happening. If there are scrolling | |
* issues try swap out 'touchstart' for 'touchend' | |
* | |
*/ |
Some MacOS users have very cluttered Docks & wish they could organize them without removing any App icons from the mix.
This snippet will add an empty "spacer" that you can drag around and use to separate icons into groups! See example.
Paste this into your Terminal. Run the command for additional placeholders!
It's great that Gistlog makes it easy to write Gist-powered, Markdown-formatted, blog posts. But what if you want to use it as your entire blogging platform? We're working on it, and here's a first step: user landing pages.
Any Github user that has any public gists that contain a file named gistlog.yml
now have a landing page on Gistlog at http://gistlog.co/your-user-name
. So, since I have (more than) one, you can view my landing page at gistlog.co/mattstauffer. It's very simple right now, but we have a ton of ideas to improve it over time. So go check it out.
How do you get your own Gistlog landing page?
- Create a new Gistlog Gist (or edit an old one)
- Create two files: one for the markdown (I recommend
blog.md
for the name) and one for the Gistlog settings (which must be namedgistlog.yml
) - Write your blog post in
blog.md
- Since there are no actual settings being parsed from
gistlog.yml
yet, just create it with the fol
let callback: CGEventTapCallBack = { (tapProxy, eventType, event, refcon) -> Unmanaged<CGEvent>? in | |
debugPrint("we are monitoring the mouse event here") | |
return nil | |
} | |
let eventMask = (1 << CGEventType.leftMouseDown.rawValue) | (1 << CGEventType.leftMouseUp.rawValue) | |
let machPort = CGEvent.tapCreateForPid(pid: 40529, place: .tailAppendEventTap, options: .defaultTap, eventsOfInterest: CGEventMask(eventMask), callback: callback, userInfo: nil)! | |
let runLoopSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, machPort, 0) |
# virsh create rhel7.xml | |
error: Failed to create domain from rhel7.xml | |
error: Network not found: no network with matching name 'default' | |
# virsh net-list --all | |
Name State Autostart Persistent | |
---------------------------------------------------------- | |
default active no yes | |
# virsh net-define /dev/stdin <<EOF |