Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
usage_message = ''' | |
Usage : | |
python email.py company 'firstname1 lastname1' 'firstname2 lastname2' .... | |
''' | |
def get_email_address_permutations(first_name, last_name, company): | |
first_name = first_name.lower() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
class Atom: | |
def __init__(self,line): | |
self.pdb_line=line | |
self.number=int(line[6:11]) | |
self.name=line[12:16].strip() | |
self.residue_name=line[17:20].strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "formula" | |
class UniversalBrewedPython < Requirement | |
satisfy { archs_for_command("python").universal? } | |
def message; <<-EOS.undent | |
A build of GDB using a brewed Python was requested, but Python is not | |
a universal build. | |
GDB requires Python to be built as a universal binary or it will fail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C++ includes used for precompiling -*- C++ -*- | |
// Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
// | |
// This file is part of the GNU ISO C++ Library. This library is free | |
// software; you can redistribute it and/or modify it under the | |
// terms of the GNU General Public License as published by the | |
// Free Software Foundation; either version 3, or (at your option) | |
// any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Partition an array with 0s and 1s */ | |
void partition(int* v, int n) { | |
int i=0, k=n; | |
while(i<k) { | |
if(v[i] == 0) i++; | |
else swap(v[i], v[--k]); | |
} | |
} | |
/* Partition step in Quicksort algorithm */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As we are not experts on STL iterators, Never ever modify (insert or remove something) in a data structure when you are traversing a STL container (with iterators). YOU DONT WANT TO WASTE TIME DEBUGGING | |
We don't want to go into the implementation details about invalidating iterators of various containers in different standards of C++ (03, 11 and more in future) | |
To just give you a rough idea, to simply put it... as a beginner, let us just remember as - 'Iterator of the modified STL container becomes invalidated - means it becomes invalid, erroneous'. | |
Actually, it doesn't occur in all cases of modification. | |
To be more technical and precise : | |
As per the standard : for STL set | |
The insert members shall not affect the validity of iterators and references to the container, and the erase members shall invalidate only iterators and references to the erased elements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Importing a file into my local phpmyadmin | |
sumanth@harekrsna:~$ mysql --local-infile -h localhost -u root -p project | |
Enter password: asd | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 262 | |
Server version: 5.5.40-0ubuntu0.14.04.1 (Ubuntu) | |
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*developed from the pseudo code from cormen page - 926 | |
easy picturied intuition can be seen at | |
http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/kmpen.htm */ | |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<string.h> | |
NewerOlder