Skip to content

Instantly share code, notes, and snippets.

package com.setfive.demo.apiheaderdemo.filter;
import com.setfive.demo.apiheaderdemo.entity.ApiKey;
import com.setfive.demo.apiheaderdemo.repository.ApiKeyRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.filter.GenericFilterBean;
import javax.servlet.FilterChain;
function followBot(params) {
return new Promise(async (resolve, reject) => {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
await page.goto('https://mobile.twitter.com/login');
await page.waitFor('[name=\'session[username_or_email]\']');
await page.$eval('[name=\'session[username_or_email]\']', (el, params) => el.value = params.username, params);
let k = "";
for(let i = 0; i < 5; i++){
setTimeout(() => {
console.log("k was " + k);
k = "hi".repeat(1 + i);
}, 1000 * i);
};
setInterval(() => {
getWordCloudCounts(reviews: string[]): {} {
const words = {};
const numReviews = reviews.length;
const wordCounts: IWordCount[] = [];
const stopWords = StopWords.get();
for (let i = 0; i < numReviews; i++) {
reviews[i] = reviews[i].toString();
const splitter = reviews[i].toLowerCase().split(' ');
export class Wordcloud {
public getWordCloudCounts(reviews: Review[]): IWordCount[] {
const wordsWithCounts: IWordCount[] = new Array();
const numReviews = reviews.length;
wordsWithCounts.push({
word: 'ThisIsAPlaceHolderThatWillBeRemoved',
count: 0,
});
const arrayOfStrings2: string[] = [];
let charCounter2 = 0;
arrayOfStrings2.push('hello');
charCounter2 += 'hello'.length;
arrayOfStrings2.push('world');
charCounter2 += 'world'.length;
arrayOfStrings2.push('how are');
charCounter2 += 'how are'.length;
arrayOfStrings2.push('you');
charCounter2 += 'you'.length;
const arrayOfStrings: string[] = [];
arrayOfStrings.push('hello');
arrayOfStrings.push('world');
arrayOfStrings.push('how are');
arrayOfStrings.push('you');
let charCounter = 0;
for (let i = 0; i < arrayOfStrings.length; i ++) {
for (let k = 0; k < arrayOfStrings[i].length; k++) {
charCounter++;
SELECT Count(*) AS cnt
FROM user_study
LEFT JOIN user_question
ON user_question.user_study_id = :user_study_id
AND user_question.question_group_id = '673'
AND user_question.id = (SELECT MAX(id) FROM user_question WHERE question_group_id = 673 AND user_study_id = :user_study_id)
LEFT JOIN user_question_response
ON user_question_response.user_question_id = user_question.id
AND user_question_response.question_id = '6118'
WHERE user_study.id = :user_study_id
/*
* Copyright (c) 2011-2014 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*
/*
* Copyright (c) 2011-2014 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*