Skip to content

Instantly share code, notes, and snippets.

View marcorei's full-sized avatar

Markus Riegel marcorei

View GitHub Profile
06-12 15:15:53.194 1909-1910/? E/ANDR-PERF-OPTSHANDLER: Warning: Resource [2, 0] not supported for core 1. Instead use resource for core 0
06-12 15:15:53.197 1909-1910/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 2, 0]
06-12 15:15:53.353 660-15495/? E/audio_hw_primary: start_input_stream: pcm_prepare returned -1
06-12 15:15:53.369 660-15495/? W/audio_hw_primary: start_input_stream: exit: status(-1)
06-12 15:15:53.392 1909-1910/? E/ANDR-PERF-OPTSHANDLER: Warning: Resource [2, 0] not supported for core 1. Instead use resource for core 0
06-12 15:15:53.393 1909-1910/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 2, 0]
06-12 15:15:53.553 660-15495/? E/audio_hw_primary: start_input_stream: pcm_prepare returned -1
06-12 15:15:53.569 660-15495/? W/audio_hw_primary: start_input_stream: exit: status(-1)
06-12 15:15:53.593 1909-1910/? E/ANDR-PERF-OPTSHANDLER: Warning: Resource [2, 0] not supported for core 1. Instead use resource for core 0
06-12 15:15:53.593 1909-1910/? E/ANDR-PERF-RESOURCEQS
@marcorei
marcorei / Lotto.js
Created April 19, 2018 14:07
Probability calculation helper for Google Spreadsheets
function _FACT(num) {
var rval = 1;
for (var i = 2; i <= num; i++) {
rval = rval * i;
}
return rval;
};
function _COMBIN(x, y) {
if (x < y) return 0;
@marcorei
marcorei / idea-for-default-intent-handlers.ts
Created April 11, 2018 07:51
idea for states with default intent handlers
const defaultIntents = [
{
intentName: 'AMAZON.HelpIntent',
handler: yourFunctionPointer
},
// ... more Intents that are the same for each state.
]
const firstStateIntents = [
{
override func sizeThatFits(_ size: CGSize) -> CGSize {
return layout?.startMeasure(with: size) ?? .zero
}
override func layoutSubviews() {
layout?.startLayout(with: bounds)
}
let actionBar = [
actionLabel,
optionsLabel.layoutGravitating(to: .right)]
.layoutAsFrame()
.layoutMatchingParentWidth()
let posterDetails = [
posterNameLabel,
posterHeadlineLabel,
posterTimeLabel]
let actionBar = [
actionLabel,
optionsLabel.layoutGravitating(to: .right)]
.layoutAsFrame()
.layoutMatchingParentWidth()
let aLayout = optionsLabel.layoutGravitating(to: .right)
switch (app.getSelectedOption()) {
case 'KEY_A':
return app.tell('Option A is a solid choice.')
default:
return app.tell('I would prefer Option A.')
}
function buildOptionItem(app: DialogflowApp, aString: string): Responses.OptionItem {
// Provide a key which is unique to each option.
// And synonyms that the user can say alternativly to the title
return app.buildOptionItem(`KEY_${aString}`, aString)
.setTitle(`Option ${aString}`)
// Description and image are optional.
.setDescription(`Description for ${aString}`)
.setImage('https://example.com/image.jpg', 'An image')
}