-
how to fetch data: https://www.robinwieruch.de/react-fetching-data
-
how to fetch data with hooks: https://www.robinwieruch.de/react-hooks-fetch-data
This file contains hidden or 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
// Scripted Resolver: getTestInformation | |
(function process(/*ResolverEnvironment*/ env) { | |
var test = new GlideRecord("sys_atf_test"); | |
var sys_id = env.getArguments().id; | |
if(test.get(sys_id)){ | |
return ATFGraphQLAPI.atfTestToJson(test); | |
} | |
return; | |
})(env); |
This file contains hidden or 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
schema { | |
query: Query | |
} | |
type Query { | |
atfTest(id: String!): atfTest | |
} | |
type atfTest { | |
active: Boolean |
This file contains hidden or 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 csv | |
import pandas as pd | |
import random | |
import re | |
file_path = 'C:/Users/Jenny/Desktop/BU COM/Fall 2019/EM 855 Comp Assisted Text Analysis/Research Project/Data/Cursing_Lexicon_05.11.17.txt' | |
file_export = 'C:/Users/Jenny/Desktop/BU COM/Fall 2019/EM 855 Comp Assisted Text Analysis/Research Project/Data/Cursing_Lexicon_in_one_line.txt' | |
uncivil_dictionary = open(file_path, 'r') | |
dictionary = open(file_export, 'w+') |
This file contains hidden or 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
""" | |
CSCI-E90 HW6: publisher.py | |
""" | |
# std library | |
# custom packages | |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8" ?> | |
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> | |
<g:evaluate var="jvar_models" object="true"> | |
var gr = new GlideRecord("cmdb_hardware_product_model"); | |
gr.addEncodedQuery("cmdb_model_category=b9eb7414c3031000b959fd251eba8fe5"); // category is ipphone | |
gr.query(); | |
gr; | |
</g:evaluate> | |
<j:while test="${jvar_models.next()}"> | |
<j:if test="${jvar_models.getValue('description')!=''}"> |
This file contains hidden or 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
(function executeRule(current, previous /*null when async*/) { | |
if (current.end_date < current.start_date) { | |
gs.addErrorMessage('End date must be later than start date!'); | |
current.setAbortAction(true); | |
} | |
var today = new GlideDateTime((new GlideDate().getValue()) + " 23:59:59"); | |
if(today.after(new GlideDateTime(current.start_date))) { | |
gs.addErrorMessage('Start date must be after today'); | |
current.setAbortAction(true); | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8" ?> | |
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> | |
<g:evaluate var="jvar_models" object="true"> | |
var gr = new GlideRecord("cmdb_hardware_product_model"); | |
gr.addEncodedQuery("cmdb_model_category=b9eb7414c3031000b959fd251eba8fe5"); // category is iphone | |
gr.query(); | |
gr; | |
</g:evaluate> | |
<j:while test="${jvar_models.next()}"> | |
<j:if test="${jvar_models.getValue('description')!=''}"> |
This file contains hidden or 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 numpy as np | |
>>> matrixA = np.matrix([ | |
... [0, 0, 0, 0, 1, 0, 1, 0, 0, 0], | |
... [0, 0, 0, 0, 0, 0, 1, 0, 1, 0], | |
... [0, 0, 0, 0, 0, 0, 0, 1, 0, 1], | |
... [0, 0, 0, 0, 1, 0, 0, 0, 1, 0], | |
... [1, 0, 0, 1, 0, 0, 0, 0, 0, 0], | |
... [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
... [1, 1, 0, 0, 0, 0, 0, 1, 0, 0], |
This file contains hidden or 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
def getPossibilities(startingPosition, turns): | |
""" | |
calculates the total number of uniques paths from the starting position in N turns for the transition matrix | |
""" | |
# edge case: if turns is 0, total number of unique paths is 1 | |
if turns == 0: | |
return 1 | |
# edge case: if starting position is 5 and turns is not 0, total number of unique paths is always 0 |