Skip to content

Instantly share code, notes, and snippets.

View ashinzekene's full-sized avatar
🎯
Focusing

ashinzekene ashinzekene

🎯
Focusing
View GitHub Profile
// A simple nodeJS express middleware for serving gzip alternatives
// Source: https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a
app.get('*.js', function (req, res, next) {
req.url = req.url + '.gz';
res.set('Content-Encoding', 'gzip');
next();
});
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
plugins: [
...
new BundleAnalyzerPlugin({
analyzerMode: "static",
})
]
import React from "react";
import PropTypes from "prop-types";
export const CustomDatePicker = ({
showIcon, placeholderText, endDate, minDate, maxDate, dateFormat, selected, onChange, monthDropdown, yearDropdown
}) => {
const [dateLoaded, setDateLoaded] = useState(false);
const importDynamic = async () => {
import ("react-datepicker/dist/react-datepicker.css");
// Run this script on this page https://www.worldometers.info/coronavirus/
const c = $$('#main_table_countries_today tr').map(el => ({
country: $(el).find('td:nth-of-type(2)').text(),
totalCases: $(el).find('td:nth-of-type(3)').text(),
testsPerMillion: $(el).find('td:nth-of-type(13)').text(),
tests: $(el).find('td:nth-of-type(12)').text(),
}))
const toNumber = ({ totalCases, tests, testsPerMillion, country }) => ({
country,
{
"compileOnSave": true,
"compilerOptions": {
"baseUrl": "Client",
"composite": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"inlineSources": true,
import { AppConfigurationClient, ConfigurationSettingId } from "@azure/app-configuration";
import FeatureContext from "../Contracts/FeatureFlags/FeatureContext";
import { FeatureName } from "./FeatureNames";
import { IAppConfiguration } from "../Contracts/FeatureFlags/IAppConfiguration";
export class AppConfiguration implements IAppConfiguration {
private connectionString: string;
private environment: string
private client: AppConfigurationClient;

Finding a Middle Edge in Alignment Graph in Linear Space Problem

Find a middle edge in the alignment graph in linear space. Input: A match score m, a mismatch penalty ?, a gap penalty ?, and two DNA strings s and t. Output: The maximum alignment score of s and t followed by an alignment achieving this maximum score.

The quadratic memory required to store the entire alignment matrix can become overly massive for long DNA strings. However, keep in mind that, during the alignment algorithm, we only need two rows (i.e., linear space) at any given time in order to compute the optimal score. It turns out that we can exploit this phenomenon to compute the entire optimal alignment in linear space as well.