Skip to content

Instantly share code, notes, and snippets.

View shikhar's full-sized avatar
🐒

Shikhar Bhushan shikhar

🐒
View GitHub Profile
@shikhar
shikhar / gist:5f94ca4955fb893814fdeccee7e37151
Created November 6, 2022 00:30
twitter auth error page stacktrace
Error: Failed to find request token in session
at SessionStore.get (/rbd/pnpm-volume/463b6737-3f01-4ee0-b330-e2d2c368212e/node_modules/passport-twitter/node_modules/passport-oauth1/lib/requesttoken/session.js:13:44)
at Strategy.OAuthStrategy.authenticate (/rbd/pnpm-volume/463b6737-3f01-4ee0-b330-e2d2c368212e/node_modules/passport-twitter/node_modules/passport-oauth1/lib/strategy.js:214:33)
at Strategy.authenticate (/rbd/pnpm-volume/463b6737-3f01-4ee0-b330-e2d2c368212e/node_modules/passport-twitter/lib/strategy.js:87:40)
at attempt (/rbd/pnpm-volume/463b6737-3f01-4ee0-b330-e2d2c368212e/node_modules/passport/lib/middleware/authenticate.js:369:16)
at authenticate (/rbd/pnpm-volume/463b6737-3f01-4ee0-b330-e2d2c368212e/node_modules/passport/lib/middleware/authenticate.js:370:7)
at Layer.handle [as handle_request] (/rbd/pnpm-volume/463b6737-3f01-4ee0-b330-e2d2c368212e/node_modules/express/lib/router/layer.js:95:5)
at next (/rbd/pnpm-volume/463b6737-3f01-4ee0-b330-e2d2c368212e/node_module
import org.apache.flink.api.common.state.ValueState;
import org.apache.flink.api.common.state.ValueStateDescriptor;
import org.apache.flink.api.common.typeutils.base.LongSerializer;
import org.apache.flink.streaming.api.windowing.triggers.Trigger;
import org.apache.flink.streaming.api.windowing.triggers.TriggerResult;
import org.apache.flink.streaming.api.windowing.windows.Window;
import java.io.IOException;
/**
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Gnuplot not found, using plotters backend
Benchmarking ser/sr.json
Benchmarking ser/sr.json: Warming up for 3.0000 s
Benchmarking ser/sr.json: Collecting 100 samples in estimated 5.0007 s (26M iterations)
Benchmarking ser/sr.json: Analyzing
public class RateLimiter {
private final double permitsPerSecond;
private long nextAvailabilityNanos;
public RateLimiter(final double permitsPerSecond) {
this.permitsPerSecond = permitsPerSecond;
}

Keybase proof

I hereby claim:

  • I am shikhar on github.
  • I am shikhrr (https://keybase.io/shikhrr) on keybase.
  • I have a public key whose fingerprint is 3CD0 5142 94CD 4537 103D 463E 8157 6E19 CAEB 9212

To claim this, I am signing this object:

import org.apache.flink.streaming.api.functions.AssignerWithPeriodicWatermarks
import org.apache.flink.streaming.api.watermark.Watermark
import scala.concurrent.duration.FiniteDuration
/**
* Implements a TimestampExtractor that treats a static delta from the last timestamp as the current watermark.
*
* @param baseExtractor
* @param toleranceThreshold
All benchmarking was done on a Macbook Pro with a 2.4GHz Intel Core i7, SSD, and 16GB RAM using luceneutil against WIKI_MEDIUM_10M.
baseline = trunk
patched = https://github.com/shikhar/lucene-solr
ser = as is
par = parallelism hacked in to IndexSearcher constructor with a ForkJoinPool <https://gist.github.com/anonymous/7048089>
# ser vs ser
import java.time.Clock;
import java.util.concurrent.atomic.AtomicLong;
public class ClockedMonotonicCounter {
// sign_bit_unused | 42_bits_epochTimeMs | 21_bit_counter
private static final int TIME_SHIFT = 21;
private static final int COUNTER_MASK = (1 << TIME_SHIFT) - 1;
object TenPinBowling {
/**
* Returns the score for each frame of a 10-pin bowling game.
*
* @param rolls
* List of pins knocked down by each roll
* @return
* List of scores for each frame
*/
package com.fivepumpkins.common;
import android.content.res.Resources;
public class ResourceByName {
private final String pkg;
private final Resources res;
public ResourceByName(String pkg, Resources res) {