Skip to content

Instantly share code, notes, and snippets.

View prem0862's full-sized avatar
🎯
Focusing

Prem Singh prem0862

🎯
Focusing
View GitHub Profile
def detect_cycle(node, graph, visited, parent):
visited.add(node)
for neigh in graph[node]:
if neigh not in visited:
cycle = detect_cycle(neigh, graph, visited, node)
if cycle == True:
return True
else:
if parent != neigh:
return True
@prem0862
prem0862 / react-bind.md
Created September 24, 2020 16:45 — forked from fongandrew/react-bind.md
Explaining why we bind things in React

Start With This

Before getting to React, it's helpful to know what this does generally in Javascript. Take the following snippet of code. It's written in ES6 but the principles for this predate ES6.

class Dog {
  constructor() {
# Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
from collections import deque
class Solution:
# @param A : root node of tree
class Solution:
def is_row_safe(self, board, num, row):
return False if num in board[row] else True
def is_col_safe(self, board, num, col):
for row in board:
if row[col] == num:
return False
return True
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@prem0862
prem0862 / bobp-python.md
Created July 4, 2019 09:09 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
# Load the Pandas libraries with alias 'pd'
import pandas as pd
file_name = "filename"
# Read data from file 'filename.csv'
# (in the same directory that your python process is based)
# Control delimiters, rows, column names with read_csv (see later)
data = pd.read_csv(file_name)
#print(data.head)
data_frame1 = data[['ID', 'A', 'B', 'C', 'D']]
data_frame2 = data[['DateTime']]
package edu.utah.ece.async.sboldesigner.boost;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.util.Set;
import org.json.JSONException;
import org.json.JSONObject;
import org.sbolstandard.core2.ComponentDefinition;
status-code: 500 ... Invalid number of input arguments!
at gov.doe.jgi.boost.client.BOOSTClient.submitJob(BOOSTClient.java:488)
at gov.doe.jgi.boost.client.BOOSTClient.dnaVerification(BOOSTClient.java:335)
at edu.utah.ece.async.sboldesigner.boost.BOOSTOperations.dnaVerification(BOOSTOperations.java:69)
at edu.utah.ece.async.sboldesigner.boost.DNAVerificationDialog.actionPerformed(DNAVerificationDialog.java:90)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_67
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_31
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_2
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_40
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_60
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_77
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_37
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_50
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_56
https://boost.jgi.doe.gov/TetR_InverterSequence_sequence_difference_10