Is there a way to add spaces into a score without using rests? - lilypond

Something that looks like this:
In case you're wondering, I'm trying to type up melodic dictations for a mock AP Music Theory exam.
Edit: didn't include this originally, but I couldn't find anything about this just searching or looking at LilyPond's documentation, so I came here
Any help would be appreciated, thank you!

The solution that I found is to use \hideNotes, then just use filler; for instance,
\stemOff bes,4 \hideNotes bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 \bar "|."
yields

Invisible spacer rests can be inserted with an s followed by a note value number:
{
\clef "bass"
\once\omit Stem des4 s4 s2 |
\repeat unfold 3 { s1 } |
\bar "|."
}
See: 1.2.2 Writing rests - Invisible rests

Related

what can I do to fix my jQuery without any hard-coding in my HTML?

When I checked my work I see undefined in my work. It's not supposed to be there. Can anyone help?
jQuery
$(document).ready(function () {
var listItems = $("#productList li");
listItems.each(function (idx, li) {
var product = $(li);
product.append(" - <b> ("+product.attr('data-type')+") </b>");
});
});
HTML
<ul id="productList">
<li data-activity-type="family">Snow Tubbing</li>
<li data-activity-type="family">Snowcat Mountain Tour</li>
<li data-activity-type="adventure">SnowSlam 11 Racing Course</li>
<li data-activity-type="adventure">Snowboarding</li>
<li data-activity-type="adventure">Edge 11 Performance Ski Racing</li>
<li data-activity-type="family">Dog Sled Tour</li>
<li data-activity-type="family">Snowshoeing</li>
<li data-activity-type="kids">Kid's Night Out</li>
<li data-activity-type="kids">Bear Cub Kamp at the Nursery</li>
</ul>
I'm assuming the activity-type value is going to append to innerHTML.
the data-type should be data-activity-type.
$(document).ready(function () {
var listItems = $("#productList li");
listItems.each((index, item) => {
item = $(item);
item.html( item.html() + `- <b>${ item.attr('data-activity-type') }</b>` );
});
});

How can I select an option from a drop down list on Chrome using VBA?

' Sub chromeAuto()
Dim obj As New WebDriver
Dim doc As HTMLDocument
obj.Start "chrome", ""
obj.Get "https://www.website.com/" #######Opens Chrome
Application.Wait DateAdd("s", 3, Now)
obj.FindElementById("userid").SendKeys ThisWorkbook.Sheets("Sheet1").Range("A1").Value
Application.Wait DateAdd("s", 1, Now)
obj.FindElementByName("password").SendKeys ThisWorkbook.Sheets("Sheet1").Range("B1").Value
obj.FindElementById("btnActive").Click'
##Logs into website
Application.Wait DateAdd("s", 2, Now)
obj.FindElementById("pt1:_UIScmil2u::icon").Click
obj.FindElementById("pt1:_UIScmi4").Click
Application.Wait DateAdd("s", 4, Now)
obj.FindElementById("pt1:r1:0:r0:0:r1:0:AP1:soc2::drop").Click #######Opens Drop down list
Application.Wait DateAdd("s", 2, Now)'
# Below is the source code I get from the button I want to select
I am trying to select option 2
`<ul class="x1qz" id="pt1:r1:0:r0:0:r1:0:AP1:soc2::pop"><li id="pt1:r1:0:r0:0:r1:0:AP1:soc2::sp"
class="x1r4"></li>
<li class="x1r8 p_AFSelected" _adfiv="0">Option 0</li>
<li class="x1r8" _adfiv="1">Option 1</li>
<li class="x1r8" _adfiv="2">Option 2</li>
<li class="x1r8" _adfiv="3">Option 3</li>
<li class="x1r8" _adfiv="4">Option 4</li>
<li class="x1r8" _adfiv="5">Option 5</li>
<li class="x1r8" _adfiv="6">Option 6</li>
<li class="x1r8" _adfiv="7">Option 7</li>
</ul>
`
Difficult to know without seeing more html but try css attribute selector of
obj.findElementByCss("[_adfiv='2']").click

How to expand details/summary when opening page with anchor inside nested "details"?

I made collapsible html <ul> list using <details> <summary>.
However, if I try to reference to bookmark it does not open automatically. In below example, I would love to call url page with #Q0A0 to see page automatically open Q0 node and Q0A subnode to make Q0A0 visible:
e.g.: list.html#Q0A0
<!DOCTYPE html>
<html lang="en">
<head>
<title>Details/summary opened with anchor via javascript</title>
</head>
<body>
<ul>
<li><details id="Q0"><summary>Q0</summary>
<ul>
<li><details id="Q0A"><summary>Q0A</summary>
<ul>
<li><details id="Q0A0"><summary>Q0A0</summary>Answer to Q0A0</details></li>
<li><details id="Q0A1"><summary>Q0A1</summary>Answer to Q0A1</details></li>
<li><details id="Q0A2"><summary>Q0A2</summary>Answer to Q0A2</details></li>
</ul>
</details>
</li>
<li><details id="Q0B"><summary>Q0B</summary>Answer to Q0B</details></li>
<li><details id="Q0C"><summary>Q0C</summary>Answer to Q0C</details></li>
</ul>
</details>
</li>
<li><details id="Q1"><summary>Q1</summary>
<ul>
<li><details id="Q1A"><summary>Q1A</summary>Answer to Q1A</details></li>
<li><details id="Q1B"><summary>Q1A</summary>Answer to Q1B</details></li>
<li><details id="Q1C"><summary>Q1A</summary>Answer to Q1C</details></li>
</ul>
</details>
</li>
</ul>
</body>
</html>
gist, codepen
also: gist, codepen
function MakeArrayOfAllPrefixes(str){
//console.log("MakeArrayOfAllPrefixes("+str+")");
var prefixes = [];
for (var i=1; i<=str.length; i++){
prefixes.push(str.substr(0,i));
}
console.log("MakeArrayOfAllPrefixes("+str+") -> returns [" + prefixes + "]");
return prefixes;
}
function SetOpenAttrForIdsAndPrefixes(ids, openAttrBool){
$('details').attr('open',false); // close all others first
console.log("SetOpenAttrForIds([" +ids+"], "+openAttrBool+")");
for (idindex in ids) {
var id = ids[idindex];
if (id != ""){
var prefixes = MakeArrayOfAllPrefixes(id);
for (prefixidx in prefixes) {
var prefix = prefixes[prefixidx];
if(openAttrBool==true) { operationstr="Opening"; } else { operationstr="Closing"};
console.log(operationstr+" <details id='#"+prefix+"'> with $('#"+prefix+").attr('open',"+openAttrBool+");");
$('#'+prefix).attr('open',openAttrBool);
}
}
}
}
function SetOpenAttrForIdsAndPrefixesFromLocationHash(){
var hashes = $(location).attr('hash').split('#');
SetOpenAttrForIdsAndPrefixes(hashes, true);
}
$(document).ready(function(){
SetOpenAttrForIdsAndPrefixesFromLocationHash();
if ("onhashchange" in window) {// does the browser support the hashchange event?
window.onhashchange = function () {
SetOpenAttrForIdsAndPrefixesFromLocationHash();
}
}
});
<p>
Opens details/summeries, all parths, using prefixes. Supports multiple anchors in url, example:
</p>
<ul>
<li>#Q0A0#Q1A,</li>
<li>#Q0B#Q0C#Q1A#Q1C.</li>
</ul>
<p>
references:
1,
2,
3,
4,
5.
</p>
<ul>
<li><details id="Q0"><summary>Q0</summary>
<ul>
<li><details id="Q0A"><summary>Q0A</summary>
<ul>
<li><details id="Q0A0"><summary>Q0A0</summary>Answer to Q0A0</details></li>
<li><details id="Q0A1"><summary>Q0A1</summary>Answer to Q0A1</details></li>
<li><details id="Q0A2"><summary>Q0A2</summary>Answer to Q0A2</details></li>
</ul>
</details>
</li>
<li><details id="Q0B"><summary>Q0B</summary>Answer to Q0B</details></li>
<li><details id="Q0C"><summary>Q0C</summary>Answer to Q0C</details></li>
</ul>
</details>
</li>
<li><details id="Q1"><summary>Q1</summary>
<ul>
<li><details id="Q1A"><summary>Q1A</summary>Answer to Q1A</details></li>
<li><details id="Q1B"><summary>Q1B</summary>Answer to Q1B</details></li>
<li><details id="Q1C"><summary>Q1C</summary>Answer to Q1C</details></li>
</ul>
</details>
</li>
</ul>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
P.S. Credits to vokoscreen for good job at screencasting and ezgif.com for good job at optimizing gif to fit 2MiB imgur stackoverflow limit.

Parse HTML data using R

I have a html data set as below, which I want to parse and convert into a tabular format which I can use .
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div class="brewery" id="brewery">
<ul class="vcard simple">
<li class="name"> Bradley Farm / RB Brew, LLC</li>
<li class="address">317 Springtown Rd </li>
<li class="address_2">New Paltz, NY 12561-3020 | <a href='http://www.google.com/maps/place/317 Springtown Rd++New Paltz+NY+United States' target='_blank'>Map</a> </li>
<li class="telephone">Phone: (845) 255-8769</li>
<li class="brewery_type">Type: Micro</li>
<li class="url">www.raybradleyfarm.com </li>
</ul>
<ul class="vcard simple col2"></ul>
</div>
<div class="brewery">
<ul class="vcard simple">
<li class="name">(405) Brewing Co</li>
<li class="address">1716 Topeka St </li>
<li class="address_2">Norman, OK 73069-8224 | <a href='http://www.google.com/maps/place/1716 Topeka St++Norman+OK+United States' target='_blank'>Map</a> </li>
<li class="telephone">Phone: (405) 816-0490</li>
<li class="brewery_type">Type: Micro</li>
<li class="url">www.405brewing.com </li>
</ul>
<ul class="vcard simple col2"></ul>
</div>
</body>
Below is the code which I have used. The issue I am facing is it converts into text file using Rvest but cant seem to make it of any useful format.
library(dplyr)
library(rvest)
url<-html("beer.html")
selector_name<-".brewery"
fnames<-html_nodes(x = url, css = selector_name) %>%
html_text()
head(fnames)
fnames
Would this be a correct approach or should I be doing it using some other package to go through each div and the inner elements.
The out put I would like to see it is
No. Name Address Type Website
Thank You.
library(rvest)
library(dplyr)
html_file <- '<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div class="brewery" id="brewery">
<ul class="vcard simple">
<li class="name"> Bradley Farm / RB Brew, LLC</li>
<li class="address">317 Springtown Rd </li>
<li class="address_2">New Paltz, NY 12561-3020 | Map </li>
<li class="telephone">Phone: (845) 255-8769</li>
<li class="brewery_type">Type: Micro</li>
<li class="url">www.raybradleyfarm.com </li>
</ul>
<ul class="vcard simple col2"></ul>
</div>
<div class="brewery">
<ul class="vcard simple">
<li class="name">(405) Brewing Co</li>
<li class="address">1716 Topeka St </li>
<li class="address_2">Norman, OK 73069-8224 | Map </li>
<li class="telephone">Phone: (405) 816-0490</li>
<li class="brewery_type">Type: Micro</li>
<li class="url">www.405brewing.com </li>
</ul>
<ul class="vcard simple col2"></ul>
</div>
</body>'
page <- read_html(html_file)
tibble(
name = page %>% html_nodes(".vcard .name") %>% html_text(),
address = page %>% html_nodes(".vcard .address") %>% html_text(),
type = page %>% html_nodes(".vcard .brewery_type") %>% html_text() %>% stringr::str_replace_all("^Type: ", ""),
website = page %>% html_nodes(".vcard .url a") %>% html_attr("href")
)
#> # A tibble: 2 x 4
#> name address type website
#> <chr> <chr> <chr> <chr>
#> 1 Bradley Farm / RB Brew, LLC 317 Springtown Rd Micro http://www.raybradleyfarm.com
#> 2 (405) Brewing Co 1716 Topeka St Micro http://www.405brewing.com
The problem is that it's not a table, so it's not super easy to parse. It's just two lists, which the below code concatenates into one list. Also FYI, try looking into the xml2 package for parsing html/xml.
library(dplyr)
library(rvest)
library(xml2)
vcard <-
'<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div class="brewery" id="brewery">
<ul class="vcard simple">
<li class="name"> Bradley Farm / RB Brew, LLC</li>
<li class="address">317 Springtown Rd </li>
<li class="address_2">New Paltz, NY 12561-3020 | <a href=\'http://www.google.com/maps/place/317 Springtown Rd++New Paltz+NY+United States\' target=\'_blank\'>Map</a> </li>
<li class="telephone">Phone: (845) 255-8769</li>
<li class="brewery_type">Type: Micro</li>
<li class="url">www.raybradleyfarm.com </li>
</ul>
<ul class="vcard simple col2"></ul>
</div>
<div class="brewery">
<ul class="vcard simple">
<li class="name">(405) Brewing Co</li>
<li class="address">1716 Topeka St </li>
<li class="address_2">Norman, OK 73069-8224 | <a href=\'http://www.google.com/maps/place/1716 Topeka St++Norman+OK+United States\' target=\'_blank\'>Map</a> </li>
<li class="telephone">Phone: (405) 816-0490</li>
<li class="brewery_type">Type: Micro</li>
<li class="url">www.405brewing.com </li>
</ul>
<ul class="vcard simple col2"></ul>
</div>
</body>' %>%
read_html(html) %>%
xml_find_all("//ul[#class = 'vcard simple']")
two_children <- sapply(vcard, function(x) xml2::xml_children(x))
data.frame(
class = sapply(two_children, function(x) xml2::xml_attrs(x)),
value = sapply(two_children, function(x) xml2::xml_text(x)),
stringsAsFactors = FALSE
)

Html paragraph number [duplicate]

This question already has answers here:
Can ordered list produce result that looks like 1.1, 1.2, 1.3 (instead of just 1, 2, 3, ...) with css?
(12 answers)
Closed 5 years ago.
how I can formate my text displayed in HTML like these:
1.1 cdashjkfhkdvfsdfjkvnjk
cnzxjkvnkncjkvjkxcvbkcbvk
1.2 cnzxjknvjn jvnxcjkcxcx
klczxkcnzxnclnxknckxnk
1.3 ....
and not like these:
1. cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk cnzxjkvnkncjkvjkxcvbkcbvk
cnzxjkvnkncjkvjkxcvbkcbvk cnzxjkvnkncjkvjkxcvbkcbvk cnzxjkvnkncjkvjkxcvbkcbvk cnzxjkvnkncjkvjkxcvbkcbvk
2. cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk
Any ideas????
Use an ordered list.
<ol>
<li>cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk </li>
<li>cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk </li>
</ol>
<ol>
<li>cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk </li>
<li>cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk </li>
</ol>
Edit:
If you don't care about IE6 the following will work =P
body {
counter-reset:section;
}
ol {
counter-increment:section;
counter-reset:subsection;
}
li:before {
counter-increment:subsection;
content:counter(section) "." counter(subsection) " ";
}
Output:
1.1 cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk </li>
1.2 cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk </li>
2.1 cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk </li>
2.2 cdashjkfhkdvfsdfjkvnjk cnzxjkvnkncjkvjkxcvbkcbvk </li>
http://jsfiddle.net/73vp5naf/
Browser's won't do decimals for you as far as I know.
You could use two ordered lists, one inside the other, and have the inner one with letters or roman numerals?
E.g.
<ol>
<li>Part 1</li>
<ol>
<li>Child 1 of Part 1</li>
<li>Child 2 of Part 1</li>
</ol>
<li>Part 2</li>
<ol>
<li>Child 1 of Part 2</li>
<li>Child 2 of Part 2</li>
</ol>
</ol>