Skip to content

Instantly share code, notes, and snippets.

View ashinzekene's full-sized avatar
🎯
Focusing

ashinzekene ashinzekene

🎯
Focusing
View GitHub Profile

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.

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;
{
"compileOnSave": true,
"compilerOptions": {
"baseUrl": "Client",
"composite": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"inlineSources": true,
// 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,
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
plugins: [
...
new BundleAnalyzerPlugin({
analyzerMode: "static",
})
]
// 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 CompressionPlugin = require('compression-webpack-plugin');
module.exports = {
plugins: [new CompressionPlugin()],
};
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");
import React from "react";
import PropTypes from "prop-types";
import DatePicker from "react-datepicker";
import "./_custom-date-picker.scss";
export const CustomDatePicker = ({
showIcon, placeholderText, endDate, minDate, maxDate, dateFormat, selected, onChange, monthDropdown, yearDropdown
}) => (
<div className={showIcon ? "custom-date-picker custom-date-picker--show-icon" : "custom-date-picker"}>
<DatePicker
var (
// Match assets with hashes eg. main.347845.js, button.9029893.css
hashedPatternRegex = regexp.MustCompile(`[\w-/]\.[0-9,a-z]{20}\.(js|css)$`)
isHashedAsset = hashedPatternRegex.MatchString
)
func CacheHeaders(staticPath string) gin.HandlerFunc {
return func(c *gin.Context) {
r := c.Request.URL.Path
// Set a max age of 1-year for js and css with hashes