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
$ g++ test.cpp && ./a.out | |
Min = 5 | |
Max = 77 |
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
Check if two numbers are equal without using arithmetic operators or comparison operators. |
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
#include <iostream> | |
void F(int* A, int* B, int N) { | |
// B[i] = product of... | |
for (int i=0; i<N; ++i) { | |
int product = 1; | |
// ...all A[j], j!= i | |
for (int j=0; j<N; ++j) { | |
if (j == i) continue; | |
else { |
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
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
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
#!/bin/bash -e | |
#------------------------------------------------------------------------------- | |
# Default values | |
#------------------------------------------------------------------------------- | |
: ${GCC_VERSION:=$1} | |
: ${GCC_LANGUAGES:=c,c++,fortran} | |
: ${MPFR_HOME:=} | |
: ${MPFR_VERSION:=} | |
: ${GMP_HOME:=} |
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
#!/bin/bash -x | |
#------------------------------------------------------------------------------- | |
# Set defaults | |
#------------------------------------------------------------------------------- | |
: ${MPC_VERSION:=$1} | |
: ${MPFR_HOME:=} | |
: ${MPFR_VERSION:=} | |
: ${GMP_HOME:=} | |
: ${GMP_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
#!/bin/bash -e | |
# | |
# Usage: ./install-boost <version: x.xx.x> | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <version: 1.39.0>" | |
exit 1 | |
fi | |
VERSION="$1" |
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
#!/bin/bash | |
: ${DO_EVERYTHING:="yes"} | |
: ${DO_UPDATE:="no"} | |
: ${DO_BUILD:="no"} | |
: ${DO_RM_BUILD:="no"} | |
: ${DO_CONFIGURE:="no"} | |
: ${DO_MAKE:="no"} | |
: ${DO_INSTALL:="no"} |
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
' Input Range: Select a cell reference | |
Sub HighlighJanuaryInColumn() | |
' Save the workbook before performing any actions so we can roll back by quitting without saving | |
ThisWorkbook.Save | |
On Error Resume Next | |
Set targetRange = Application.InputBox(prompt:="Select a range", Title:="Select First Date in Column", Type:=8) | |
If targetRange = False Then | |
MsgBox "Canceling Macro" | |
Exit Sub |
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
# Install most things needed to compile ROSE | |
apt-get --assume-yes install \ | |
git wget vim \ | |
g++-4.8 gfortran-4.8 clang-3.5 \ | |
libtool automake cmake flex bison \ | |
default-jdk \ | |
python3-dev \ | |
doxygen graphviz-dev \ | |
libqt4-dev qt4-dev-tools \ | |
libgraphicsmagick-dev libreadline-dev libmagic-dev \ |
NewerOlder