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
open class TransparentBackgroundDialogFragment : DialogFragment() { | |
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | |
setStyle(STYLE_NO_TITLE, R.style.AlertDialogStyle) | |
return super.onCreateDialog(savedInstanceState) | |
} | |
} |
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
class SnappingLinearLayoutManager(val context: Context) : LinearLayoutManager(context) { | |
override fun smoothScrollToPosition(recyclerView: RecyclerView?, state: RecyclerView.State?, position: Int) { | |
val smoothScroller = object : LinearSmoothScroller(context) { | |
override fun getVerticalSnapPreference(): Int = SNAP_TO_START | |
override fun computeScrollVectorForPosition(targetPosition: Int): PointF | |
= this@SnappingLinearLayoutManager.computeScrollVectorForPosition(targetPosition) | |
} | |
smoothScroller.targetPosition = position | |
startSmoothScroll(smoothScroller) | |
} |
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
abrev | desc | |
---|---|---|
A | ampère(s) | |
a | are(s) | |
A | argônio | |
a | assinado(a) | |
Å | decimilimícron(s), ångström | |
A. | aceite | |
A. | alto (música) | |
a. | arroba(s) | |
a. | assinado(a) |
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 scrapy | |
import re | |
class AbreviaturasScraper(scrapy.Spider): | |
name = 'AbreviaturasScraper' | |
start_urls = ['https://pt.wikipedia.org/wiki/Lista_de_abreviaturas'] | |
def parse(self, response): |
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
# -*- coding: utf-8 -*- | |
# Define here the models for your scraped items | |
# | |
# See documentation in: | |
# https://doc.scrapy.org/en/latest/topics/items.html | |
import scrapy | |
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 os | |
import sys | |
src_dir = sys.argv[1] | |
tgt_dir = sys.argv[2] | |
src_fix_dir = f'fix_{src_dir}' | |
tgt_fix_dir = f'fix_{tgt_dir}' | |
src_files = os.listdir(src_dir) |
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 sys | |
import os | |
in_file = sys.argv[1] | |
try: | |
os.makedirs('source') | |
except: | |
pass | |
with open(in_file, 'r') as f: |
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 numpy as np | |
def GENP(A, b): | |
''' | |
Gaussian elimination with no pivoting. | |
% input: A is an n x n nonsingular matrix | |
% b is an n x 1 vector | |
% output: x is the solution of Ax=b. | |
% post-condition: A and b have been modified. | |
''' |