Skip to content

Instantly share code, notes, and snippets.

@slodge
slodge / CurrentTestOutput
Created November 29, 2022 17:01
CurrentTestOutput
Restarting R session...
> devtools::test()
ℹ Loading plumber
ℹ Testing plumber
✔ | F W S OK | Context
✔ | 18 | as_attachment [0.2s]
✔ | 4 | Promise [0.8s]
✔ | 574 | Promise - hooks [13.8s]
✔ | 2 | Promise - multiple hooks can change the value [0.1s]
percent_covid <- 0.01
sensitivity <- 0.67
specificity <- 0.9995
pop <- 10000
num_with_covid <- pop * percent_covid
num_without_covid <- pop * (1 - percent_covid)
lat_flow_positive_with_covid <- sensitivity * num_with_covid
lat_flow_positive_without_covid <- (1 - specificity) * num_without_covid
lat_flow_negative_with_covid <- (1 - sensitivity) * num_with_covid
resp <- httr::GET("https://api.coronavirus.data.gov.uk/v2/data?areaType=nation&metric=newTestsByPublishDate&metric=newCasesByPublishDate&format=json")
text <- httr::content(resp, as="text")
json <- jsonlite::fromJSON(text)
stats <- json$body %>% tibble::as_tibble()
to_plot <- stats %>%
mutate(date = as.Date(date)) %>%
filter(date >= "2020-09-01") %>%
group_by(areaName) %>%
arrange(date) %>%
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BBBCD850-E7CB-4B6C-86D9-CE01F2B1C81C}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
@slodge
slodge / gist:2843a793dc9df4ad4455
Created October 24, 2014 13:33
Where should I log...
There's a bug that VS has had for aaaaaages
If you're in a multi-project solution and you right-click a project in Solution Explorer to run it... then while its building you click on another project or click on an editor pane for a file in another project then VS tries to run the other project.
This often leads to me seeing the "A project with an Output Type of class library cannot be run" message
Where/how should I log this... I'd love it to be solved (has been bugging me since 2006!)
If you've watched any of the N+1 series - http://mvvmcross.wordpress.com/ - then you'll no doubt have seen me writing a lot of repetitive, error-prone layout code like:
var textView = new UITextField(new RectangleF(10, 100, 300, 30));
Add(textView);
textView.InputView = picker;
var label = new UILabel(new RectangleF(10, 130, 300, 30));
Add(label);
All of this repetitive, error-prone layout code was... of course... unnecessary.&nbsp; The problem was that I am a dinosaur and sometimes it takes me time to learn what I should be doing...
public class TextViewImeActionBinding : MvxAndroidTargetBinding
{
private bool subscribed;
private ICommand _command;
protected TextView TextView
{
get { return Target as TextView; }
}
public interface IVisible
{
void IsVisible(bool isVisible);
}
public interface IKillable
{
void KillMe();
}
Mvx.Resolve<IUserInteraction>()
. Confirm("Do you want to delete?", result => {
if (result)
// do deletion
});
if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
EdgesForExtendedLayout = UIRectEdge.None;