Skip to content

Instantly share code, notes, and snippets.

View chirag-v's full-sized avatar

Chirag Vora chirag-v

View GitHub Profile
@chirag-v
chirag-v / filter-even-numbers.py
Last active December 14, 2015 08:09
How to filter( ) even numbers from a given range ( ) of numbers.
def even(x):
return x % 2 == 0
list(__builtin__.filter(even, range(10)))
@chirag-v
chirag-v / list-comprehension-even-numbers.py
Created February 28, 2013 11:42
list comprehension method to get even numbers from a range.
def even(x):
return x % 2 == 0
[num for num in range(10) if even(num)]
package com.myurl.myapp;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
%alias:
Define an alias for a system command.
%alias_magic:
%alias_magic [-l] [-c] name target
%autocall:
Make functions callable without having to type parentheses.
%automagic:
Make magic functions callable without having to type the initial %.
%bookmark:
Manage IPython's bookmark system.