import requests | |
import re | |
import os | |
import xml.etree.ElementTree as ET | |
import matplotlib.pyplot as plt | |
def fetch_lint_rules() -> tuple[dict[str, tuple[str, int]], list[tuple[str, int]]]: | |
""" | |
Fetch the lint rules and severities from the android lint sample website: |
// 业务A | |
@Transactional | |
public void doTransactionA(Some some) { | |
Data data = queryData(); | |
data.some(some); | |
save(data); | |
saveLogA(data); | |
} | |
//业务B |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<templates> | |
<template autoinsert="true" context="java-statements" deleted="false" description="assertThat(actual, is(expected));" enabled="true" name="atis">${import:importStatic('org.junit.Assert.*', 'org.hamcrest.Matchers.*')} | |
assertThat(${actual}, is(${expected}));</template> | |
<template autoinsert="true" context="java-members" deleted="false" description="Simple should" enabled="true" name="sho">@${testType:newType(org.junit.Test)} | |
public void should_${testName}() throws Exception { | |
}</template> | |
<template autoinsert="true" context="java-members" deleted="false" description="Should and GivenWhenThan" enabled="true" name="shogwt">@${testType:newType(org.junit.Test)} | |
public void should_${testName}() throws Exception { | |
// Given |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<templates> | |
<template autoinsert="true" context="java-statements" deleted="false" description="assertThat(actual, is(expected));" enabled="true" name="atis">${import:importStatic('org.junit.Assert.*', 'org.hamcrest.Matchers.*')} | |
assertThat(${actual}, is(${expected}));</template> | |
<template autoinsert="true" context="java-members" deleted="false" description="Simple should" enabled="true" name="sho">@${testType:newType(org.junit.Test)} | |
public void should_${testName}() throws Exception { | |
}</template> | |
<template autoinsert="true" context="java-members" deleted="false" description="Should and GivenWhenThan" enabled="true" name="shogwt">@${testType:newType(org.junit.Test)} | |
public void should_${testName}() throws Exception { | |
// Given |
configurations.all { configuration -> | |
configuration.resolutionStrategy { ResolutionStrategy componentSelection -> | |
componentSelection.componentSelection { rules -> | |
rules.all { ComponentSelection selection, ComponentMetadata metadata -> | |
boolean accepted = metadata.status == 'release' | |
if (!accepted) { | |
selection.reject("Component status ${metadata.status} rejected by release") | |
} | |
} | |
} |
#!/bin/sh | |
retry_count=3 | |
rm out/*.xml out/*.html | |
robot --log none --report none --outputdir out --output output.xml . | |
result=$? |
(by @andrestaltz)
So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.