- Fill N
- Flatten
- Remove duplicates
- Convert an NodeList to Array
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
const Activity = require('../../models/OnTheJobTraining/Activity') | |
const MemberActivity = require('../../models/OnTheJobTraining/MemberActivity') | |
const MemberActivityHours = require('../../models/OnTheJobTraining/MemberActivityHours') | |
const ActivityMedia = require('../../models/OnTheJobTraining/ActivityMedia') | |
const mongoose = require('mongoose'); | |
/** | |
* List all the activities | |
* @param req | |
* @param res |
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 | |
import random | |
random.seed(5) | |
def sigmoid(x): | |
return 1 / (1 + math.exp(-x)) | |
for x in range(3): | |
random_num = random.randint(0,3) |
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
main .content-section { | |
padding: rem(80) 0; | |
} | |
main .content-section .tabset ul.tabs { | |
padding: 0; | |
margin: 0; | |
list-style: none; | |
} | |
main .content-section .tabset ul.tabs li { | |
font-family: 'Mont-Regular'; |
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
1. SELECT SUM(ConsumerCount) FROM(SELECT bc.BeverageName, bc.ConsumerCount FROM Beverages_Consumers_Internal AS bc RIGHT OUTER JOIN Beverages_Branches_Internal AS bb ON (bc.BeverageName=bb.BeverageName AND bb.BranchName='Branch1')) totalConsumer; | |
2. SELECT DISTINCT bc.BeverageName, SUM(bc.ConsumerCount) OVER (PARTITION BY bc.BeverageName ORDER BY bc.BeverageName ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS totalCount FROM Beverages_Consumers_Internal AS bc RIGHT OUTER JOIN Beverages_Branches_Internal AS bb ON bc.BeverageName=bb.BeverageName WHERE bb.BranchName='Branch1' ORDER BY totalCount DESC LIMIT 10; | |
3. SELECT DISTINCT bb.BranchName, bc.BeverageName, SUM(bc.ConsumerCount) OVER (PARTITION BY bc.BeverageName ORDER BY bc.BeverageName ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS totalCount FROM Beverages_Consumers_Internal AS bc RIGHT OUTER JOIN Beverages_Branches_Internal AS bb ON bc.BeverageName=bb.BeverageName WHERE bb.BranchName IN ('Branch1', 'Branch2') ORDER BY total |
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
#!/usr/bin/python | |
import sys | |
from operator import itemgetter | |
# using a dictionary to map words to their counts | |
current_word = None | |
current_count = 0 | |
word = None | |
# input comes from STDIN | |
for line in sys.stdin: | |
line = line.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
#!/usr/bin/python | |
import sys | |
# Word Count Example | |
# input comes from standard input STDIN | |
for line in sys.stdin: | |
# remove leading and trailing whitespaces | |
line = line.strip() | |
# split the line into words and returns as a list | |
words = line.split() | |
for word in words: |
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
def find_max_min_sales(min_max_sold_index): | |
foodItemIndex = ['Burger', 'Pizza', 'Coke','Fries', 'Cake'] | |
try: | |
index = foodItemIndex[min_max_sold_index] | |
except IndexError: | |
pass | |
return index | |
file = open("sales_data-sales_data.csv", "r") | |
data = file.readlines() |
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.
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
add_action( 'all', create_function( '', 'var_dump( current_filter());' ) ); |
NewerOlder