Skip to content

Instantly share code, notes, and snippets.

View SH4DY's full-sized avatar

Ramon SH4DY

View GitHub Profile
@SH4DY
SH4DY / setBetween.java
Created May 31, 2015 19:27
Given an integer n and two indexes i, j s.t. i >= j. return a integer where all the bits between positions i and j (both inclusive) are set to 1. The bits outside of this range shall not be modified.
/*
Given an integer n and two indexes i, j s.t. i >= j.
return a integer where all the bits between positions i and j (both inclusive)
are set to 1. The bits outside of this range shall not be modified.
*/
//Comments assuming 8 bit numbers
//Goal is to make a mask with 1's at positions j through i
public static int setBetween(int n, int i, int j){ //n = 00010000, i = 3, j = 1
import AppDispatcherInstance = require('../dispatcher/AppDispatcher');
import Events = require('events');
import React = require('react');
import AppDispatcher = require("../dispatcher/AppDispatcher");
//This is just an alias for the interface AppDispatcher.AppPayload
import Payload = AppDispatcher.AppPayload
import ActionIdentifier = AppDispatcher.ActionIdentifier
import Interfaces = require('../Tree/Interfaces')
version: 0.2
env:
secrets-manager:
SONAR_TOKEN: prod/sonar:SONAR_TOKEN
SONAR_HOST_URL: prod/sonar:SONAR_HOST_URL
variables:
SourceBranch: ""
DestinationBranch: ""
IMAGE_REPO_NAME: "app-container-repo"
IMAGE_TAG: "Latest"