text
stringlengths 83
79.5k
|
---|
H: Tons of liked comments
So, I was on a YouTube video, and I expanded all the sub-comments on the top comment, and all of them were liked by me, even though I never watched the video before. This occurs on all popular videos, only on the top comment. The comments aren't liked until I expand the comments:
Unexpanded:
Expanded:
Video from screenshots: https://www.youtube.com/watch?v=kffacxfA7G4
AI: YouTube is aware of this bug. They are working on a fix. |
H: How to filter and sum cells in Google Spreadsheet?
I have a list of families invited to my wedding, formatted like this
Name | Who invited | How much will come?
------------------------------------------
Johes | Bride | 2
Smits | Groom | 3
...
And I want to add two cells that will come totals for "How much will come?" for Bride and for Groom separately. Is there any way to do this using formulas?
AI: The following formula will do that.
Formula
=QUERY(A1:C3, "SELECT A, SUM(C) GROUP BY A PIVOT B")
Screenshot |
H: Can we add more users in Google apps legacy free edition?
Can we add more users in Google apps legacy free edition ? Do I need to upgrade ? My domain is only with one user
AI: According to Google Apps Free Edition (legacy) the user limit is ten. If you have only one user, you should be able to add 9 more. |
H: How do I view messages in a discussion group on a per-message basis (Facebook)?
One of the incredibly annoying features of infinite scrolling (such as on your own timeline or in a discussion group) is that it will make the page slower and slower, and clog the memory of the page. At some point, the browser will be out of memory. It would be much nicer if, instead of infinite scrolling, I can see the messages on my timeline / discussion group on a per-message basis: this frees the memory associated with the last post, and therefore I can actually "scroll" infinitely.
However, I cannot seem to find this feature. From a User Experience point of view, I would expect this feature to be there.
How can I view a single message on my timeline / in a discussion group, and then use the arrow keys to go to the next question?
AI: This is not possible at the current time. |
H: Why can't I find certain music videos on YouTube?
I am from India and I don't know if there's the region or country problem but I cannot find videos such as "No Favors - Big Sean feat. Eminem" or "Campaign Speech - Eminem"?
What could be the possible reason?
A side question to Eminem followers: I found Campaign Speech on this new channel "EminemMusic". Is this a new channel of Eminem because I don't feel so? Why didn't he upload it to his "EminemVevo"?
AI: This appears to be an issue related to your physical location, because the two Eminem music videos that you mentioned in your question show in the search results of YouTube in my computer. You can verify this for yourself by installing Tor Browser Bundle and searching for the same two music videos in Tor browser.
From What is Tor Browser? at the official Tor website:
Tor Browser protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world: it prevents somebody watching your Internet connection from learning what sites you visit, it prevents the sites you visit from learning your physical location, and it lets you access sites which are blocked.
Beyond this the question of why certain music videos are not uploaded to certain websites is primarily opinion-based, therefore it is not possible to answer this part of your question accurately. |
H: Can a supervisor see the last time a worker synced their device?
I am working on a supervisor app that uses user configurable reports (UCRs) to show aggregate data of the workers the supervisor oversees. Supervisors see worker performance data as well as information about the worker's clients. In order for the supervisor's UCRs to show the most recent data, two things must happen:
The worker must sync her device
The supervisor must sync her device
When supervisors go to visit their workers, it can take a long time for workers to sync their devices if they have not done this in a while. Supervisors would like to be able to see when workers last synced their devices so they can instruct the workers to do so ahead of time if it has been a while since they last synced.
Is there a way to display the last time a worker synced her device to the supervisor?
AI: You can add a column to your UCR which contains the date of the user's last sync. The property on the user that you want is:
reporting_metadata.last_sync_for_user.sync_date
You can use this as is if your UCR is based off users but if it's based off forms or cases you'll need to use a related_doc expression to get the user. |
H: Where do GOOGLEFINANCE((“CURRENCY:xxx xxx”)) takes the prices from?
I'm using the GOOGLEFINANCE((“CURRENCY:USDARS”)) function to convert US DOLLARS to ARGENTINIAN PESOS.
I wanted to know where do Google take the prices from? I'm comparing with our local trade values and there's a small difference.
AI: SIX Financial Information, according to here, with a three minute delay. |
H: Google is in German, why?
Recently I did a trip to Europe and since then, when I open Google, it's not in English anymore, is in another language (looks like Swedish or German).
'Search button' is 'Google-Suche'.
Also every site I open seems to think I speak this language too.
I already checked my google account and it's set to English, but even this way I'm having this problem.
The problem only happens in Chrome ; when i google in Safari, it shows the right language.
How to solve it?
AI: It probably has set a cookie when you used it there. The easiest way is to not use simply google.com, but https://www.google.com/ncr - you will always get the standard US version.
Using it once should also clean/overwite the cookie. However, my recommendation is to save the version with ncr as bookmark, or as startup page. That way, you'll never have the issue again when you travel. |
H: Mediawiki shut down old passwords. Can it be bypassed?
As submitted in multiple bug reports, Mediawiki has a recent bug that prevents users with old passwords (such that weren't changed in years) from staying logged in. If such users try logging in, they immediately get logged out.
I'm not talking about local installations, but about their webapps like Wikipedia.
Perhaps Mediawiki will end up fixing it, but who knows when. Thankfully, users who originally supplied an e-mail address can use it to reset their password and thus resolve the issue on their own.
My question is - can you think of any way to bypass this issue for users without a provided email address?
I thought to:
Log in and change password in 1 step.
Log in and add an e-mail address in 1 step.
But couldn't get either to work as each step requires a different form, so 1 step turns to 2.
AI: After carefully reading the aforementioned bug report, here's the non e-mail bypass:
Log in to a Wikimedia project to which you've never logged in and/or to a language version to which you've never logged in.
For example, if you can no longer log in to en.wikipedia.org, then log in to ch.wikipedia.org or en.wiktionary.org. To make sure you've never logged in to these places before, run your user through https://meta.wikimedia.org/wiki/Special:CentralAuth first (thankfully, this tool doesn't require a login).
That's it! The creation of a new localized user fixes your global account. Now you can log in the actual Wikimedia project which you required in the first place. |
H: What is the shortcut key to toggle between Suggesting and Editing modes in Google Docs?
When copying content into Docs, for collaborative editing, there are some changes that I would like to get confirmation on (in Suggesting mode) and others that I want to make silently (in Editing mode). Switching between these states with a mouse is cumbersome. Is there a shortcut?
AI: Mode Switch (KB Shortcuts)
Mode
PC
Mac
Switch to editing
Ctrl + Alt + Shift + z
⌘ + Option + Shift + z
Switch to suggesting
Ctrl + Alt + Shift + x
⌘ + Option + Shift + x
Switch to viewing
Ctrl + Alt + Shift + c
⌘ + Option + Shift + c
The keystroke order is based on Google Docs Help and the special keys can often be reordered as long as the letter key (c, z, etc.) is added last to the combination.
All KB Shortcuts
Online at: Keyboard shortcuts for Google Docs
From within Google Docs:
Navigate to Help > Keyboard shortcuts; or
Press Ctrl+/ (Windows, Chrome OS) or ⌘+/ (Mac)
Help > Keyboard shortcuts > Editing ( Windows) |
H: Deleting other people's comments on Facebook
On Facebook it appears other people can delete your comments. When can this happen, in the context of writing on someone's timeline (so not including scenarios where a group admin deletes a comment)? For example is it whoever you replied to can delete your comment? Will you get a notification if someone deletes your comment?
AI: Post owner can delete any comment, or if you are replying to anyone, that person can delete your comment. You will not get any notification. Deleting comment will not notify to the commenter.
Similar a group admin or page admin can delete any comment and comment poster will not get any notification. |
H: Can G Suite Education administrators monitor email?
If a college provides Gmail accounts through G Suite for Education, can the college's administrators monitor users' emails?
AI: Yes they can.
Data access by your administrator or service provider
[...] It’s important to note that your administrator has access to any data you store in this account, including your email. Please read the Google Privacy Policy for more information.
And in the G Suite Administrator Help:
Which of my users can access other users' accounts?
Per your domain’s Customer Agreement, G Suite administrators for a domain can access all user accounts and the associated data, as described in our Privacy Policy.
You can also read this disclaimer in the Privacy Policy:
Information we share
If your Google Account is managed for you by a domain administrator (for example, for G Suite users) then your domain administrator and resellers who provide user support to your organization will have access to your Google Account information (including your email and other data).
Doesn't really matter which version of G Suite you are using, the administrator(s) will be able to access (and read) your emails. |
H: How to return array of cells from a table in Google Sheets
We have # EXAMPLE TABLE with product SKUS on the top row, and the first columns is ingredients. Each SKU row is showing the value of the ingredient row. What we want to do is have another sheet with a drop down, where a user can select from the various SKUs and then we have a formula (maybe =query?) that will dynamically show two columns; ingredients name and ingredient value for that SKU, when the ingredient value is greater than 0. I'd like to do this with a dynamic function like =query as opposed to nested =if.
# EXAMPLE TABLE
ingredients cake pie quiche
flour 2 1 1
sugar 3 3 -
apples - 2 -
berries - 1 -
cheese - - 2
eggs 1 - 2
# EXAMPLE VIEW
Thing to make: [ dropdown ]
# USER selects from EXAMPLE VIEW
Thing to make: [ cake ] <---- user makes choice
# EXAMPLE VIEW returns:
Thing to make: [ cake ]
flour 2
sugar 3
eggs 1
# or user selects [ quiche ]
# EXAMPLE VIEW returns:
Thing to make: [ quiche ]
flour 1
cheese 2
eggs 2
I've tried using =query'ExampleTable'!A:D, "select A where C > 0") and it will return the ingredient names where the values are larger than 0, so it would return an array [flour, cheese, eggs], which is very close, but not the full result I am seeking.
AI: One approach is to filter the table before querying it. Here is an example where the table is in A1:D7 and the choice of product is in cell F1:
=query({A1:A7, filter(B1:D7, B1:D1 = F1)}, "select * where Col2 > 0")
Here, filter keeps only the column where the column name matches F1. The array notation {} makes a two-column array with the first column coming from A1:A7 (ingredient names) and the second being quantities. Finally, query selects the rows where the quantity is positive.
And this is a more decorated version of the above, which displays "no recipe found" when there are no matches, and omits the column names in the output by using label ... ''.
=iferror(query({A1:A7, filter(B1:D7, B1:D1 = F1)}, "select * where Col2 > 0 label Col1 '', Col2 ''"), "no recipe found") |
H: Is there a way to retrieve the "Save & Return" link for an incomplete entry?
We are using Cognito Forms for an application form to a nonprofit organization. Applications come from people in various parts of the world where computer literacy is not the highest, and we have sent users with incomplete submissions a reminder of the deadline. Some of those users cannot find the original Save & Return link generated when they saved their progress, and I cannot find it in the interface, but I can view and edit their entry while logged in. Is there a way to retrieve these links so we can help those users?
AI: I'm a developer with Cognito Forms.
We do not have a way to recover the Save and Resume link. However you can provide them with an edit link to the entry. You can find this on the Entries page under the 'Share' button when an entry is selected. You can learn more about this feature in our Help Content. |
H: Check box IF function issue
I'm trying to get my sheet to subtract a certain amount from a total for every "x" I have in the referenced cells.
My formula is:
=IF(G9 = "x",A8-150,A8)AND(IF(G10 = "x",A8-115,A8))AND(IF(G11= "x",A8-90.80,A8))AND(IF(G12 = "x",A8-11.02,A8))
I'm getting a formula parse error. Is this just a syntax issue, or am I not using the conditional statements correctly? Is there an easier way around this?
AI: You might try changing how you're constructing this.
From what I can see, depending on which columns have an "x", you want to subtract between zero and four values from the same column.
Maybe try something like this:
=A8 - (IF(G9 = "x",150,0) + IF(G10 = "x",115,0) + IF(G11= "x",90.80,0) + IF(G12 = "x",11.02,0))
This does the Boolean check on each of the cells in question and either returns some value (if true) or 0 (if false), then adds them all up and then subtracts from your original cell. |
H: How to sort Google Sheets using a criterion
Background/Business Case
I'm a recruiter who uses spreadsheets to organize the work I've done with candidates with respect to a certain job vacancy.
Like streak, I would like to have a pipeline that shows how my candidates are going through a certain progression or pipeline. I've put the different statuses of the pipeline here:
In the following figure, you can see that I've entered my candidates data, and I've put conditional formatting so that they are color depending on the status they're in:
Question
Notice how in this screenshot, i sorted the candidates according to the status alphabetically:
However, i want it sorted according to the same order available in the pipeline status depicted above, ie according to this order:
- initial contact
- interested
- discussing
- ..
any ideas?
AI: Assuming that you have the data in Sheet1 and the pipeline list in Sheet2, you can copy the data from Sheet1 to Sheet3. Do the editing in Sheet1, and any other sorting, such as by country, name, source, etc. and keep Sheet3 as an automatically updated, and sorted view based on the pipeline.
Create Sheet3 with the needed column headings to match those on Sheet1.
In Sheet3 cell A2 enter the formula: =ArrayFormula(sort(Sheet1!A2:E,match(left(Sheet1!D2:D,6),left(Sheet2!A1:A10,6),0),1))
You will need to adjust the following:
range A2:E by replacing E with your last column
range D2:D by replacing D with the column that actually has the status you are sorting on
the 6 in both left functions with the minimum number of characters to make each item in the pipeline unique.
the names of Sheet1 and Sheet2 if you have renamed the sheets to something more meaningful (as you probably should)
Adding and rearranging the items in the pipeline, as well as adding and editing rows on the main sheet, and inserting columns on the main sheet, are automatically accommodated by Google Sheets, so that you don't have to reformulate the equation for changes that you make in the pipeline, or for new entries in the data. (One exception to this: if you add a column to Sheet1 you will need to change the header row in Sheet3 to match.)
Note:
IMHO, as complex as this seems to be getting, you probably ought to look into switching to a database for this instead of a spreadsheet. |
H: How do I apply text effects like this in "The Three Evils"
I know there's an online utility that does it but I can't seem to find it. All my Googling has been in vain.
The T̜͓̞̤͎ͦ́ͤ̓̄̚ḣ͖͙̘ͦͯ̾re͗̈́e ̙̥̘̙͉̺̜̐ͧ̍E͍̲̜͈͊v̹͙̝̗ils is the only example I could find of the text effect I'm looking for.
Not looking for the utility specifically, but what the effect is.
AI: This is called 'Zalgo' on Stack Exchange, and how it works can be found here.
It makes use of so-called 'combining characters' in Unicode. A combining character basically says 'I'm a normal character, except that you must render me above/below/inside the base character.
Here is a list of combining characters; you can just copy them from there.
Note that the use of Zalgo is discouraged on more serious websites (except when demonstrating the limits of regular expressions). That might explain the downvotes on this question. |
H: Script in Google Sheets which deletes every column that doesn't have a specific header
Via a different service, I export a CSV file which I then import into Google Sheets. I then manually clean up the file in order to print out reports.
The issue is, the imported CSV file contains a bunch of columns of data which I do not need. However these columns are never in the same order, so I can't reference the columns by a, b, c, 1, 2, 3, etc. The first row always contains the column headers, so if I can reference the columns by the text in the first row then that would be great.
All I want to do is:
Import CSV
Run Script which deletes all non-required columns so only the columns I need exist.
Currently my import process is:
Go to shared folder in Google Docs
Create new Google Sheet
Import the CSV file
Manually delete all columns and clean up the spreadsheet so I then print it.
I am open to various methods of doing this (even if it makes having a script make
a copy of the sheet and only putting the required columns in the new sheet), but would like to avoid having to use a 3rd party add-on or service.
AI: Here is a script that deletes all columns except those where the first row is one of the words listed in the "required" variable:
function deleteColumns() {
var required = ["Name", "Position", "Salary"];
var sheet = SpreadsheetApp.getActiveSheet();
var width = sheet.getLastColumn();
var headers = sheet.getRange(1, 1, 1, width).getValues()[0];
for (var i = headers.length - 1; i >= 0; i--) {
if (required.indexOf(headers[i]) == -1) {
sheet.deleteColumn(i+1);
}
}
}
The logic is simple: get headers (the data in the first row), and loop over them, deleting whatever is not found in "required" array. There are two things that merit attention:
The deletion process goes from right to left, so that deletion does not change the position of columns that are yet to be processed.
JavaScript arrays are numbered starting with 0, while sheet columns are numbered starting with 1. Hence i+1 in the deleteColumn method. |
H: Can I allow collaborators to add themselves on GitHub?
I'd like to send out a URL to an external team such that anyone who clicks on it can join my private repository as a collaborator using a read-only role.
I don't want individually to add every person who needs access, nor do I want to give someone else the authority to do this.
Is there any way to do this using GitHub?
AI: Only someone with admin rights to the repository can add collaborators, so there's no way for a potential collaborator to automatically add themselves via a URL.
However, you can use the GitHub API to programmatically add collaborators. You can make use of the API in several ways. Here are two possible approaches:
Write a script to add any and all users as collaborators, either as a one-time execution or to use on-demand when you have new users to add.
If you have access to a web server, Microsoft form, or some other method for having the user submit a request or respond to a request, write a server-side script to add any user who responds to your email/form/etc. as a collaborator.
The second approach would be more precise, as it wouldn't add users who don't want to be collaborators, but it would also require more setup. |
H: Can collaborators add themselves on Bitbucket by clicking on a URL?
I'd like to publish a URL with restricted access such that anyone who clicks on it can join as a collaborator. I don't want to individually add every person who needs access, nor do I want to give someone else the authority to do this.
My repository is private (currently on Github, though I'm willing to move it to Bitbucket).
Is there any way to do this using Bitbucket?
AI: Hopefully the GitHub approach will work for you, but if not, or if you want to switch to BitBucket, you can do something similar using the BitBucket REST API and the privileges endpoint:
Set up a way for the user to indicate they'd like access to the repository
Write a script or program to call the BitBucket API and grant that user access, in this format:
$ curl --request PUT --user evzijst:password https://api.bitbucket.org/1.0/privileges/evzijst/test/brodie --data write |
H: How can I trigger CommCare to create user cases
I need to have the commcare-user case type exist for all my users in my domain so I can export their location ids. Is there a way to trigger commcare to create the commcare-user cases for existing users?
It looks like if I add user case management to a form the user case gets created when that form is submitted. But for existing users I'd like to not have to rely on them submitting a form.
AI: Nick, it looks like once user-as-a-case is enabled for the domain, usercases will be created whenever a user is saved. I realize this isn't ideal. You can manually trigger this for an individual user in the UI by making a trivial change (and changing it back, if needed), or similarly in a bulk user upload.
It does look like when user-as-a-case is enabled, there should be a bulk action to add cases for all existing users, although this may not happen immediately. |
H: How do I count the number of occurrences in a big data file that occur on a number of filters, one of which is an OR statement?
I can easily count on filters from the data like this
-->
=count(filter(Data!$A$2:$A, Data!$C$2:$C=$C13,Data!$E$2:$E=$A$5,Data!$J$2:$J>=P$7))
But I want
Data! Data!$E$2:$E=$A$5 Or $A$6 Or $A$7
... but an Or statement gives an error. What is the way to do this? I can't lose the rest of my filters either.
AI: Use the + operator, which works just like boolean OR, thanks to 0 being interpreted as boolean false and non-zero as true:
=count(filter(Data!$A$2:$A, (Data!$C$2:$C=$C13) + (Data!$E$2:$E=$A$5) + (Data!$J$2:$J>=P$7))) |
H: Sum the values where the first two characters match
Seems like this should be simple but I'm having a hard time figuring it out.
I have data like this:
A B
1 Cr foo 1.00
2 Cr bar 2.00
3 Cr boo 0.50
4 Cr far 3.00
I want to sum column B where column A starts with "Cr". Obviously in the real data there are lots of other values in column A as well that do not start with "Cr".
I've been playing with using left() inside of the sumif, but I can't get it to work.
AI: That would be
=sumif(A1:A, "Cr*", B1:B)
where A1:A is the range to which the condition is applied, Cr* is a pattern that matches any string beginning with Cr (here * stands for any number of any characters), and B1:B is the range of the values to be added.
One can also use query or filter for such operations. I wrote a summary of available functions: String matching in Google Sheets/Docs/Apps Script. |
H: Comparing Strings in Address Lines
I need to set Address2.Line1 != Address.Line1 in the same form.
Originally, I had thought a simple reference to the input fields in a conditional would work, but the rule fails when testing; i.e., no matter what text is entered into the Address fields, a custom error always shows.
Looking through Cognito Form's guides, I do not see supported options for CHAR arrays or other variables that can take "Address.Line" references rather than specifically enter text.
Best way to achieve this?
AI: As per Cognito Forms Support:
=(Address.Line1 = Address2.Line1) or (Address.City = Address2.City) or (Address.PostalCode = Address2.PostalCode) or (Address.State = Address2.State) |
H: Highlight the admin responses rows
I have a comment form and sheet on my site:
• Column A: Timestamp
• Column B: Name
• Column C: Comment
I'd like to highlight every row that includes the admin's answer. In other words, if a cell in column B has the text Admin, its entire row should have a background color. How should I use conditional formatting or something like that to achieve it?
AI: Apply conditional formatting to the range A2:C with custom formula
=regexmatch($B2, "^admin$")
The idea is that the formula should be written as it applies to the upper left corner of the formatted range, in this case A2. It will be automatically adjusted for other cells: for example, cell C6 will refer to B6, because row reference is relative while column reference is absolute.
Using regexmatch with the pattern "^admin$" ensures complete case-sensitive string match; ^ means the beginning of string and $ means its end.
If you want case-insensitive comparison, the formula is simply
=$B2 = "admin" |
H: Append the cell content as a URL parameter and create a link
Here's a sample form:
https://docs.google.com/forms/d/e/1FAIpQLSfiPSHacKKNEfe-Jq82DBScbCBRkwtm8rq2Jq7y-ceLgGIC3Q/viewform
And here's the linked spreadsheet:
https://docs.google.com/spreadsheets/d/16mNc5EBNRBZ_E3jWa848NhFUNoTu496_lBSjb4Rd7x0/edit
I've created an extra sheet named Comments to draw data from the Source sheet. The data on the second sheet should be exactly like the first sheet, except column B of the Comments sheet: I'd like the usernames to be hyperlinks using the following URL:
https://t.me/username
As a result, for the username @johnDoe on sheet 1, I should have the following on sheet 2:
@johnDoe
AI: You can do this very easily with a literal array and array formula:
={Source!A1:C1;Source!A2:A,arrayformula(if(istext(Source!B2:B),Hyperlink("https://t.me/"&substitute(Source!B2:B,"@",""),Source!B2:B),)),Source!C2:C}
The first part creates the header, the below it it pulls in the first column, then uses and if check to only hyperlink fields in column B that have text in it, then pulls column C.
This way you only enter the formula once at the top and never have to edit it again |
H: Conditional countif date is before today and cell in another column is blank
Column AE has dates
Column AG has text
I need to count how many rows have these occurrences:
Column AE is before today
AND
Column AG is blank
I've been trying for a while, looking around the questions and answers, I got this, but it gives me an error:
=COUNTIF(AE3:AE124,"<"&TODAY()), isblank(AG3:AG124)
AI: If you have multiple IFs, use COUNTIFS instead of COUNTIF.
=countifs(AE3:AE124, "<"&today(), AG3:AG124, "=")
The format is: first range, criterion for it, second range, criterion for it, and so on.
The condition "=" means being empty, while "<>" would be "non-empty". |
H: How can I watch an age-restricted YouTube video without logging in?
I want to watch an age-restricted video on YouTube.
I'm currently using my computer on non-password protected public wifi, meaning that I don't want to login with my YouTube username and password due to security concerns. I've also had times where I'm using private browsing, and I wanted to avoid adding the video to my account's watch history.
I know that YouTube age restrictions don't apply on embedded videos, but I'm trying to watch a video which hasn't been embedded on any site.
Is there any way I can watch an age-restricted video on YouTube without logging in?
AI: You can get around age-restricted YouTube videos by changing the URL of the video. All you need to do is change it to this version:
https://www.youtube.com/embed/{video-id}
The {video-id} part is taken from the end of the normal page you land on.
For example:
https://www.youtube.com/watch?v=8dLS8_xM2LI
In this, 8dLS8_xM2LI is the video-id, and you can get around the age-restriction by going directly to the full screen mode:
https://www.youtube.com/embed/8dLS8_xM2LI |
H: Is there a way to create a catch-all "if not in another filter then label as..." filter to Gmail?
I have many email filters connected to labels. I would like one final filter that labels every incoming email that wasn't caught by any other filter in the list.
Is this possible? Is there a hack I can do with IFTTT or Zapier if not?
AI: That's a little tough, as filters seem to be handled in the order that they're listed, but I don't think that's guaranteed.
If all of your other filters add labels, you could try creating a final filter with has:nouserlabels. That'll match any message that has one of your user-created labels, so ostensibly if any of the filters before that didn't add a label this filter would catch it.
If that doesn't work out, an IFTTT recipe that uses the same search term should find recently received messages that lack a custom label. |
H: Dating When a Cell is Edited in Google Sheets
I want to autofill the date of an edit in one cell into the next cell. Specifically:
When I enter something into any cell in column 2, I want the cell next to it in column 3 to autofill the date.
When I enter something into any cell in column 5, I want the cell next to it in column 6 to autofill the date.
... same for columns 8 and 11
I've seen similar questions, but I don't know the coding well enough to alter the answers to my needs. I used this as a basis (found here: Auto-updating column in Google Spreadsheet showing last modify date):
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
var r = s.getActiveCell();
if( r.getColumn() != 2 ) { //checks the column
var row = r.getRow();
var time = new Date();
time = Utilities.formatDate(time, "GMT-08:00", "MM/DD/yy, hh:mm:ss");
SpreadsheetApp.getActiveSheet().getRange('B' + row.toString()).setValue(time);
};
};
It works great except that I want to do the same thing with columns 5, 8, and 11. When I copied the code and changed the number, it only works with column 11, not 2, 5, or 8.
AI: This is a much shorter script that does it:
function onEdit(e) {
if ([2, 5, 8, 11].indexOf(e.range.columnStart) != -1) {
e.range.offset(0, 1).setValue(new Date());
}
}
Where [2, 5, 8, 11] is the list of columns of interest. The offset(0, 1) means same row, 1 column to the right.
If you want a particular format of the timestamp, add setNumberFormat like so: (reference for formats)
e.range.offset(0, 1).setValue(new Date()).setNumberFormat("yyyy.MM.dd at HH:mm");
Aside
Various versions of the script you found are now entrenched in forums despite many things being wrong with it. It does not preserve date structure, replacing it with a string. It is tied to a timezone. It does not care about Daylight Saving Time. It uses too many API calls. |
H: How to split and transpose text in cells from multiple rows into 1 column
I have an automatically generating list of rows with multiple text items within them separated by a , (ColA). I'm trying to automatically split and transpose each row, where all responses end up in the same column B.
Bonus if the repeating text items in Column A could only be listed once in Column B along with a count of their occurrences in Column C. No worries if that bit isn't possible though.
Example sheet here: https://docs.google.com/spreadsheets/d/1Gelwp2eSFNHIc9pZLW2YwnoKHxid3faKrXHWDxYZcZI/edit?usp=sharing
I found a similar question here that was answered with a script, but I couldn't figure out how to fit it to my purpose.
https://stackoverflow.com/questions/17530499/how-to-split-and-transpose-results-over-2-columns
AI: I'll describe the solution step by step:
Get all names in separate cells
=split(join(", ", filter(A2:A, len(A2:A))), ", ", False)
does this, by taking nonempty cells in the range A2:A (this is what filter is for), joining them using the same comma-space separator you have within cells, and then splitting by that separator (not by space or comma separately).
Transpose
This is easy: just add transpose.
=transpose(split(join(", ", filter(A2:A, len(A2:A))), ", ", False))
Get unique names only
This is only if you don't want the counts. unique does the job then.
=unique(transpose(split(join(", ", filter(A2:A, len(A2:A))), ", ", False)))
Get unique names and their counts
For this I would use query instead of unique:
=query(transpose(split(join(", ", filter(A2:A, len(A2:A))), ", ", False)),
"select Col1, count(Col1) group by Col1", 0)
Which says: group by name, and include the count of repetitions. The last argument "0" says the data has no header row, which it doesn't since we started with A2. |
H: What is this advertisement on the bottom-left of a YouTube video?
YouTube has now disabled the creation of Annotations, and instead has given us "End Screens" and "Cards", but I can't see how to recreate this particular look with either.
Is this an advertisement? If so, what type? It doesn't seem to appear in their advertising documentation, either (which states that overlay advertisements are 480x70).
AI: This is a call to action overlay (which is different from an overlay ad). CTA overlays are available in advertisements (if a video ever has been used as a video ad, any CTA overlays that have been inserted during the campaing remain on it afterwards), for non-profit accounts and for twitch live notifications. |
H: How can I add a cell's contents to another cell and then automatically delete the contents of the original cell?
I have a spreadsheet to keep track of points in a class. I want to have a cell for each class that I can type a number of points into, and that number will be added into a corresponding cell in the row below it. Then I want the first cell to empty itself so that I can add more points in and repeat the process whenever I need to. The second cell (the one in the row below) should keep a running total of all the numbers entered into the original cell.
AI: This requires a script, for example:
function onEdit(e) {
if (e.range.rowStart == 2) {
var below = e.range.offset(1, 0);
below.setValue(Number(e.value) + Number(below.getValue()));
e.range.clear();
}
}
Here the watched range is the 2nd row (the condition e.range.rowStart == 2). If a number is entered there, then it's added to the content of the cell below, and the cell itself is cleared.
Using Number to avoid string concatenation 2 + 2 = 22 instead of addition.
Same for rows 2 and 6: the notation || means OR:
function onEdit(e) {
if (e.range.rowStart == 2 || e.range.rowStart == 6) {
var below = e.range.offset(1, 0);
below.setValue(Number(e.value) + Number(below.getValue()));
e.range.clear();
}
} |
H: Where are YouTube messages sent?
On the About page of some YouTube channels there's a "Send message" button for contacting them through private message. As an example, here's the about page from my channel.
Where are these messages sent to? How can I check if I've received a message?
I know that YouTube used to have a private messaging system, but that was years ago. I haven't been able to find a message inbox in the current version of YouTube.
AI: https://www.youtube.com/messages is the page you are looking for. You can reach it via the avatar menu > creator studio > community > messages from anywhere at YouTube. |
H: How do I delete multiple recurring events from Google Calendar?
To delete multiple events, I used the script in this answer -
How to delete all events on many dates all at once but not the whole Calendar in Google Calendar?
var fromDate = new Date(2013,0,1,0,0,0);
var toDate = new Date(2013,0,4,0,0,0);
var calendarName = 'My Calendar';
// delete from Jan 1 to end of Jan 4, 2013
var calendar = CalendarApp.getCalendarsByName(calendarName)[0];
var events = calendar.getEvents(fromDate, toDate);
for(var i=0; i<events.length;i++){
var ev = events[i];
Logger.log(ev.getTitle()); // show event name in log
ev.deleteEvent();
}
However, the problem I have is that I have around 50 events per month which are recurring every year (birthdays), so it just goes on and on. How can I delete to make sure the recurring events are deleted as well?
AI: You want to delete not just the particular Event but the Event Series to which it belongs. So, instead of ev.deleteEvent(); use
ev.getEventSeries().deleteEventSeries();
This should also work for events that aren't repeated, because the method getEventSeries wraps them in a new EventSeries object. |
H: Can't resize Google drawing
There is no "grab bar" in the lower right corner of the drawing as is falsely described if I Google the problem.
I'm trying to make my drawing larger but there is no way to resize the canvas area, at least no obvious way.
AI: Both in an existing and a newly created Google Drawing, I see the drag handle as described in the help article.
Since this issue seems to be related to your computer I recommend each of the following steps:
Make sure your browser is up to date, and among the supported browsers listed by Google
Completely clear your browser's cookies & cache
Try using an Incognito window in the Chrome browser, or a Private browsing session in Firefox. These modes use their own cookies and cache, as well as often disabling extensions that could be causing the issue.
Try using another computer. It's possible software on your computer (antivirus, antimalware, automatic backup software, etc) is causing the issue |
H: Dropdown Lists Values from Spreadsheet Ranges
Using Google Sheets, I wanted to populate drop down lists in a form displayed by HtmlService with range values from a Sheet. In the example below, I wanted to display a drop down list with values from G6:H8 and the next drop down list will be filtered based on the corresponding value in B6:D11.
Currently I'm using the code below but I'm looking for an option that allows drop down values to be updated just by modifying the Spreadsheet and not the HTML file.
<form onSubmit="handleSubmit(this)">
<select name="cuisine">
Type of Cuisine
<option value="Indonesian">Indonesian</option>
<option value="Vietnamese">Vietnamese</option>
<option value="Philippine">Philippine</option>
</select>
<select name="food">
Type of Cuisine
<option value="Adobo">Adobo</option>
<option value="Nasi Goreng">Nasi Goreng</option>
<option value="Bami Goreng">Bami Goreng</option>
<option value="Pho">Pho</option>
<option value="Pancit">Pancit</option>
<option value="Lumpia">Lumpia</option>
</select>
</form>
AI: Your script should access the spreadsheet by its URL or Id, get the values from there, and include them in HTML. Here is an example:
function doGet() {
var ss = SpreadsheetApp.openByUrl("url");
var sheet = ss.getSheetByName("Sheet1");
var values = sheet.getRange("C6:C11").getValues();
var options = values.map(function(row) {
return '<option value="' + row[0] + '">' + row[0] + '</option>';
});
var html = '<form onSubmit="handleSubmit(this)"> <select name="food"> Type of Cuisine' + options.join('') + '</select></form>';
return HtmlService.createHtmlOutput(html);
} |
H: SUMIF look to previous row
I want to make SUMIF in Google Spreadsheets to look at the previous row for its evaluation. So if my sheet looks like this:
trigger value1
something value2
I want it to add value2, because the trigger is in the previous row. Can this be done with SUMIF and if not, is there another way?
AI: This effect is achieved by shifting the criteria range by one row:
=sumif(A2:A15, "<6", B3:B16)
sums the entries in B where the number up-and-to-the-left is less than 6. |
H: Difference between a Channel and a Group
What is the difference between a Group and a Channel? Can a member comment in a channel or it is just the owner who can post?
AI: channel: only creator and admins with the "can send post" permissions can send posts and members are only viewers of the messages.
groups: as default all the members can participate in the groups but in the new version of telegram, admins/creator can restrict other users and they may not be able to send messages. |
H: Create fresh duplicate of Master Google Sheet on a daily basis
I'm trying to hack together a paperless data-entry solution for my company using Google Sheets. Basically, our employees are required to fill out daily logs on paper. Needless to say, this is extremely wasteful and inefficient. I'd like to automate the process by doing the following:
Manually create a Master Sheet with proper formatting, etc.
Run a script that duplicates the said master sheet and places an editable copy in a separate folder on Google Drive once a day (at a specific time).
Ideally, each copy would have a timestamp of its creation in a cell somewhere, although this isn't absolutely needed.
I've looked all over the place and haven't found any scripts that do exactly this (the closest thing I found was a messy Zapier hack).
Does anyone know how I would go about doing this?
Any scripts laying around that do this?
If not, are there any resources you could point to that would allow me do figure it out myself?
AI: Here is one approach. The script should be attached to the master spreadsheet (Tools > Script editor) and set to run on daily basis (Edit > Current project's triggers). To run, it needs the destination folder Id (the part of folder URL after /folders/).
The new copy is named like "original file name 2017-07-25 19:11:23" which also serves the purpose of timestamping. This is actually UTC time... there are other options, such as
var timestamp = new Date().toLocaleString(); (returns July 25, 2017 3:17:45 PM EDT)
or
var timestamp = new Date().toDateString(); (returns Tue Jul 25 2017).
Both of the above depend on local date conventions of the owner of master sheet.
function duplicateSpreadsheet() {
var folder = DriveApp.getFolderById("folder Id here");
var timestamp = new Date().toISOString().replace("T", " ").split(".")[0];
var ss = SpreadsheetApp.getActiveSpreadsheet();
var file = DriveApp.getFileById(ss.getId());
file.makeCopy(folder).setName(file.getName() + " " + timestamp);
}
Further reading
DriveApp and SpreadsheetApp |
H: How to remove Skype from outlook.com?
In the past, when Outlook.com was still Hotmail, I merged Skype with Hotmail and could communicate with my Skype contacts through the outlook.com website.
I have not used Skype for years now and I think that this whole integration with Skype makes loading a lot slower and it is something I don't want anymore.
Is there a way to remove Skype from outlook.com, or is it a standard feature?
AI: Currently, this is not possible. Please see the official answer below:
How do I turn off Skype in Outlook.com?
Skype is fully integrated with Outlook.com and cannot be turned off.
We have received customer feedback that people would like the ability
to turn off Skype and we’re working on adding this feature – watch
this space. |
H: Google Form can be edited, or not viewed at all - where is the view only option?
I am trying to create a Google Form. I am unfamiliar with Google Forms, but I am familiar with Google Sheets and Docs. I'm having a problem with the form, however.
When I go to the Sharing Settings for the form, and change who has access, the options show up properly. If I select any of the 'on' settings, however, there is no pull-down to select 'can view' as there should be. The only option is 'can edit'. I do not want this option, as then anyone I send the form to can change its structure outright.
Turning the sharing off doesn't work, as placing the link into a different browser (and different Google account) simply returns a message that I don't have permission to view the form. I did some research, and someone said to leave the sharing off and simply get the URL from the 'view live form' button. That button exists only in the old forms, so I switched back to that with the form, clicked the button, got the link, pasted it into the other browser, and was still told I didn't have permission.
I can find nothing in Google about this problem that has worked.
Either I'm doing something wrong or Google Forms are unusable. Is it a bug or am I just missing a step?
AI: When viewing the form, click "Send" in upper right:
and choose the "link" option:
This gives you a link that you can send to anyone, and they will be able to access the form without logging in (unless you insist on collecting identities or controlling whether they take the survey more than once). It also has the structure
https://docs.google.com/forms/d/e/ .... /viewform
but is different from the link you have when viewing the form yourself. Google also offers to shorten the link in case this is preferable. |
H: How do I check my Capital One 360 account number?
I've forgotten the account number for my Capital One 360 account and cannot find where I had it stored. I'm not able to set up services like Direct Deposit without my account number.
I haven't been locked out of my account, as I can still login with my account's username and password.
Is there a way to check my Capital One 360 account number online?
AI: Via Capital One Support - Customer Number
Your Account Number identifies each Capital One 360 account you may
have and is often used to set up transactions like Direct Deposit,
paying bills or making purchases. You can have more than one Account
Number.
You can find your Account Number:
On your Capital One 360 statement under ‘Your Savings Summary’.
On your account(s) summary after signing into capitalone360.com. |
H: How can I view my previously scanned checks in Capital One 360?
I found an old check in my drawer from a 2 months ago, and I can't remember whether I cashed it or not.
Over on Personal Finance & Money, when I asked how to see if a check was deposited, they recommended that try to view the images from my previously scanned checks online. However, I haven't been able to find a way of doing this with Capital One.
Is there a way to view images of my previously scanned checks with Capital One 360?
AI: Sign into your account at http://capitalone360.com/
Select the account where your check was deposited
Find the deposited check in your Transaction History.
It may help to filter by Transaction Type: All Deposits
Click any deposit to view an image of the check. |
H: How to automatically forward events from one Google Calendar to another
I run a seminar series at work. Due to institutional inertia, people find out about these seminars using three separate Google Calendars and are unwilling to either all settle on one or to subscribe to multiple. Currently, I have to copy events from one calendar to the other two manually. Is there any way to automatically forward the contents of one calendar to another? That way I could have one Google Calendar for the seminars, and the other calendars would automatically be updated.
AI: There is no concept of forwarding events in Google Calendar. Subscribing to multiple calendars is how people normally deal with this.
But I can offer a Google Apps Script which copies all events within the coming week from source calendar to target calendar. It can be set up with a trigger to run every week, e.g., on Sunday. The calendar Id is found on the Settings page of a calendar.
function copyLastDayEvents() {
var source = CalendarApp.getCalendarById('....com');
var target = CalendarApp.getCalendarById('....com');
var startPeriod = new Date(); // now
var endPeriod = new Date();
endPeriod.setDate(a.getDate() + 7); // 7 days from now
var events = source.getEvents(startPeriod, endPeriod);
for (var i = 0; i < events.length; i++) {
var event = events[i];
var title = event.getTitle();
if (event.isAllDayEvent()) {
cal.createAllDayEvent(title, event.getAllDayStartDate());
}
else {
cal.createEvent(title, event.getStartTime(), event.getEndTime());
}
Utilities.sleep(100);
}
}
This just loops over the events happening within the coming week, and copies them one by one. Utilities.sleep(100) provides a little pause (100 ms) to avoid hitting Google's rate limit for event creation.
This may be unsatisfactory for several reasons: e.g., events do not appear in the target calendar until the week before. Unfortunately it appears impossible to get all events created today (or within some time period); it's all based on when the events take place. |
H: Can I use half-seconds when linking to a specific point in a YouTube video?
I know that it's possible to link to a specific point in a YouTube video by adding #t=XhYmZs to the end of the URL. (i.e. https://www.youtube.com/watch?v=-zA1jRmAYfU#t=1h2m48s). However, sometimes I want be a bit more specific so the video doesn't start playing mid-sentence.
Is it possible to use a more specific timestamp? Can I send a link that starts 48.5 seconds into a video? (i.e. https://www.youtube.com/watch?v=xuCn8ux2gbs&t=48.5s)
AI: From the API documentation with added emphrasis
start
This parameter causes the player to begin playing the video at the given number of seconds from the start of the video. The parameter value is a positive integer. Note that similar to the seekTo function, the player will look for the closest keyframe to the time you specify. This means that sometimes the play head may seek to just before the requested time, usually no more than around two seconds.
In other words:
No, you cannot specify half-seconds as-is.
Even if you could, the distance between keyframes is the limiting factor for precise linking. |
H: Google App Script If Statement Based On Cell Value
I have a spreadsheet that is populated with data via a google form. I also have a Google App script associated with the response spreadsheet. The script has several versions that do slightly different things and I need to run a specific version of the script based on a cell value in the response sheet. The problem is it always needs to be the last cell in column "J" with data in it.
For example, the form gets submitted and populates row 5. I need the "if statement" to look in J5. The next time the form is submitted it will populate row 6. That time I need the "if statement" to look in J6. And so and so on.
I'm fairly new to google app script, but I'm familiar with if statements.
Any help is greatly appreciated.
AI: If your script runs when the form is submitted, then presumably it is triggered on form submit. In this case, the function will receive an event object, in which the property values is the array of values submitted. This is the preferable way to access just-submitted form values, compared to fetching them from responses sheet.
The function would be like,
function processForm(e) {
if (e.values[9] == 'something') {
// do something
}
else {
// do something else
}
}
Here the index is 9 because J is the 10th letter of the alphabet, and JavaScript index begins with 0. |
H: How to convert currency at a specific day's exchange rate?
I need to convert 1 USD = INR on specified date (23/07/2017)
Using
=D5*GoogleFinance("CURRENCY:USDINR", "price", "23/07/2017")
But it is throwing an error, where I am going wrong?
AI: Try:
=D5*index(GoogleFinance("CURRENCY:USDINR","price","23/07/2017"),2,2)
The error message seems clear enough to me: Function MULTIPLY parameter 2 expects number values. But 'Date' is a text and cannot be coerced to a number. Why 'Date'? ... because, as mentioned for GOOGLEFINANCE:
Historical data, even for a single day, will be returned as an expanded array with column headers.
[Try your formula without D5*.]
INDEX can be used to select a specific element from an array. |
H: How do you report a bug to Facebook?
When I'm trying to fuse 2 Facebook pages, in one particular case, in the last step, after choosing which page I want to keep for the fusion, Facebook undo my choice and set the other page with the confirmation box dialog. How can I report a bug like that to Facebook?
AI: See:
Report a Broken Feature
If something's not working on Facebook, please follow the instructions
below to let us know more. These instructions will show you how to
report a problem directly from the page you're seeing it on.
How do I report a problem with Facebook?
What happens when I report that something isn't working on Facebook?
How do I take a screenshot? |
H: Count the number of lines in a column where some cells have multiple lines
How to count the number of lines when some cells in a column contain multiple lines? Example:
+----------------------+
| text |
+----------------------+
| multiline |
| text |
| here |
+----------------------+
| |
+----------------------+
| some cells are empty |
+----------------------+
The function counta helps by counting nonempty cells, but it does not take into account multiple lines in the same cell.
AI: This can be done by the following combination:
=counta(A2:A20) + sum(arrayformula(len(regexreplace(A2:A20, "[^\n]", ""))))
The first part, counta, counts each nonempty cell once. Then, regexreplace removes everything that is not a newline character \n. The len function then counts how many linebreaks the cell contains, and they are added up.
For the example above, there are 3 nonempty cells, and one of them contains 2 line breaks. So the formula returns 3 + 2 = 5. |
H: How to reorder columns in output of Filter formula
In Google Sheets, I am using the filter formula to obtain a subset of my data, but I would like to reorder the columns of the output.
Here is a sample dataset, and below is the filter formula I'm using.
=FILTER(data!A:F,data!A:A<DATE(2017,7,1),data!A:A>=DATE(2017,6,1))
This gives me the sample of rows, but the columns are in the same order as the original table. Is there a way to reorder them, e.g. have the 2nd column be last and move all others one to the left?
I understand I can filter columns as well as rows, and with that could use a second filter wrapping the first one, but that would mean making a different formula in each column. Any way this can be done in one formula?
AI: A query may be more straightforward:
=query(data!A:F,"select A,C,D,E,F,B where A>=date'2017-06-01' AND A<date'2017-07-01'")
since selection is by letter rather than sheet+column and it is quite easy to include or exclude headers, limit the output, change the order etc all at the same time. |
H: Problem with CONCATENATE when used inside of arrayformula
I'm trying to update this formula so it will work inside of an 'arrayformula'.
This works on its own and when I fill it down.
=if(E2>0,CONCATENATE(B2, " | ",C2," | ",D2), "")
This does not work when rows are added to the spreadsheet.
=arrayformula(if(E2:E>0,CONCATENATE(B2, " | ",C2," | ",D2), ""))
It only repeats the values in row 2 over and over again.
How should I write 'b2' and 'c2' and 'd2' so they adjust to row3, 4, 5, and so on as the number of rows expand?
AI: Please try:
=ArrayFormula(if(E2:E>0,B2:B&" | "&C2:C&" | "&D2:D,""))
I would have expected:
=arrayformula(if(E2:E>0,CONCATENATE(B2:B," | ",C2:C," | ",D2:D),""))
to produce the same results as above, yet it does not. Whereas normally & rather than CONCATENATE is just a matter of personal preference, it seems they are not full interchangeable. No mention of that at CONCATENATE.
However, Google Spreadsheets has CONCAT where "Equivalent to the & operator" is mentioned. This:
Returns the concatenation of two values.
So is a substitute for & ... provided for the concatenation of one 'pair' at a time. Hence:
=arrayformula(if(E2:E>0,(concat(concat(concat(B2:B," | "),concat(C2:C," | ")),D2:D)),""))
does produce the same results 'as above'.
Seems somewhat curious to me, as does M$'s deprecating of CONCATENATE in favour of CONCAT, released in Excel 2016 (though that does allow joining of more than two strings together). |
H: Date Format Lost When Combining Two Cells Using "&" and CONCATENATE in Google Sheets
I'm trying to figure out "how to" maintain the date format when I concatenate a date formatted cell with a nondate formatted cell.
Result: The Date Format Is Lost
Formulas Used
Desired Result: I had to convert Date format to Text Only
I'm trying to figure out "how to" maintain the Date Format while combining two cell values. Any ideas?
AI: You can do the formatting on the fly:
=text(B2,"m/d/yyyy")&C2
Google Sheets Help: TEXT() |
H: Sort non-unique names by sum of another column
I have a spreadsheet (technically a Google Sheet) I transcribed from a script of a musical. Each line is its own row, and has the name of the person who said it and the number of words in the line in the same row.
I want to make a list of people who have lines sorted by the total number of words they've said. What functions can I use to do this?
AI: I'm guessing people's names appear multiple times, so suggest a pivot table:
Bod added to ROWS and Words added to VALUES with Summarise by SUM.
Sorting is by Bod by default but can be by Sum of Words, either ascending or descending. |
H: How to join group in Telegram group based on an invite code
Someone provide this: tg://join?invite=EaEnSUPktgfoI-xxxxxxxx
How do I join that group in web based version of Telegram?
I tried that link in my Chrome browser but it just did a Google search.
These are the menu options in the web-based Telegram.
AI: I found another post with the link to join like this: https://t.me/joinchat/AAAAAEQbOeucnaMWN0A9dQ
Then when I clicked I chose "Open in web", and then clicked "Join" button at the bottom, and then showed this URL: https://web.telegram.org/#/im?p=@EOSproject |
H: How to return maximum numeric value if text is in array with MAXA()?
UPDATED
MAXA() not returns maximum numeric value if text is in array, as expected according https://support.google.com/docs/answer/3094016
MAXA Returns the maximum numeric value in a dataset.
and even sample is with error - returns #VALUE, not maximum numeric
Example:
formula MAXA({1;20;300;"#VALUE!";"Google"}) gives 300
but if values 1; 20; 300; #VALUE!; Google are in cells A9:A13
having array =MAXA(A9:A13) gives #VALUE!
To reproduce: https://docs.google.com/spreadsheets/d/17yJ33Zx24eC7-n-a7EaR9f9knhlQUaKYHEk2ghzZXAI/edit#gid=1923535662
Where is the problem?
AI: You can't pass MAXA() character strings directly (vs having a text value in a range of cells), but can pass numeric string such as "35". You can however pass non-numeric character strings as part of a range of cells (see example below) and it will assign them a value of zero.
The function will return something like #VALUE! or #NAME? as an error message if it cannot calculate the function parameters.
If you mouse over the value it returns in your example it will tell you why it failed.
Function MAXA parameter 4 expects number values.
But '#VALUE!' is a text and cannot be coerced to a number.
Examples:
MAXA(3,4,"5") valid, it is a numeric string
MAXA(3,4,"five") invalid, as it is not a numeric string
MAXA(A1:A6) valid, "text" gets set to 0, when A1 to A6 looks like
A1 | -2
A2 | -4
A3 | -2
A4 | -5
A5 | -1
A6 | text
Source: the support document you linked. Note they show in one of their examples that the result of
=MINA(A2:A6, "Google") is #VALUE! |
H: Is there any way to make an automatic post with image to a Facebook group you aren't admin of?
Note: I already know this question: Is there a way to automatically post to a Facebook group?
The answer there is right (I've been using it for a long time) for groups you are admin of. But what I want to do is, either posts to Facebook pages, Twitter, or Instagram, with images to be posted in Facebook Groups I'm not an admin of. Is that possible?
AI: Based on how this was written this seems to be asking about an app that bypasses the user_managed_groups permission.
Since you already possibly know this will not work, the overall answer to this question is that there is no way to do this natively without a custom application/script (which is outside the scope of this site). |
H: How do I access the contents of my Amazon shopping cart?
I'm creating a script that injects helpful data into the amazon shopping cart page. For this, I want to basically query the items a customer has already added to their shopping cart.
I know this is possible because the share-a-cart extension does it.
So, how do I programmatically access the shopping cart list on Amazon?
Edit: This was closed as off-topic correctly. However, if you're building something similar, the answer gave me pointed me to the right direction, and I solved my problem by injecting a snippet of JavaScript to the user's page, which let me scrape and process their checkout page.
AI: This depends on the context of where your script will live. In an extension, I have elevated priviledges to access websites on behalf of the user. When I use this model, I get access to the DOM of the shopping cart page and I parse it to retrieve the contents. Heres the code I use: https://github.com/fixanoid/amazon-share-a-cart/blob/master/chrome/lib/injects/inject-cart.js |
H: Return reference to last occurrence of value in a column?
I tried the solutions from this question but couldn't get it to work.
If C1:C5 = { 1, 1, 1, 2, 3 }
And B1 = 1
How can I return a reference to the last value of B1 (1), in this case, "C3" on Google Sheets?
AI: This returns the row number of the last occurance:
=ArrayFormula(max(if(C1:C5=B1, Row(C1:C5)))) |
H: "Cannot convert to multiple nodes" error message in CommCare
I'm working with repeat groups. As soon as I input a number of repeats for the repeat group to run over, I get this error:
cannot convert multiple nodes to a raw value. Refine path expression to match only one node.
How should I begin to troubleshoot?
AI: That repeat group number has to be a single hidden value reference (such as /data/num_children). You cannot have a raw number like 5 and you also cannot have a calculation such as /data/num_children + 1. |
H: How can I find comments I made on a friend's post?
A friend of mine posts on Facebook multiple times a day every day. I made a comment and we had a conversation on one post a few months ago. I almost never comment or interact with this person.
How do I find the conversation we had? Is there a way to search for interactions between two people on one of their posts?
(I wish FB would allow you to just query their DB if its public info. At least query your own activity if nothing else.)
AI: You can use the Activity Log feature of Facebook to search your comments.
Log in to https://facebook.com/.
Open your profile and from the top of the page (on top of your cover photo), click View Activity Log.
From the Filters menu, click Comments.
All your comments will begin loading. Use the Activity Search box to filter to comments between you and the other person. |
H: How to slow down too-frequent execution of Import() functions?
I have a Google Spreadsheet that uses a number of import() functions, including the third-party importJSON() function. It all works great, except that I keep apparently exceeding the limit on how many times per day I can perform the urlfetch() function (used in importJSON()). I'm not manually updating the sheet with any frequency at all, but I can only make maybe 30 or so manual sheet changes before I begin getting these errors.
I believe that Google Sheets itself may be updating all these calls every minute, which at I believe 7 instances of the function, times every minute, may be causing the limit to be hit. If my theory doesn't hold water, someone please correct/inform me as to what may actually be happening.
I'd like to find some way to reduce the frequency of updates. In a perfect world I'd love it to only update when I manually ask it to, but Google Sheets doesn't appear to provide such an option.
Is there any way to reduce or slow down the frequency of function calls?
AI: The specific issue was the Recalculation setting being not only "on change" but also at time intervals.
If the issue persists, consider the nuclear option: designate some cell of the spreadsheet, say A1, for the status (update / freeze), and put the following on top of importJSON function:
function importJSON(...) {
var currentStatus = SpreadsheetApp.getActiveSheet().getRange("A1").getValue();
if (currentStatus != "Update") {
return;
}
// the rest of function
This will guarantee that the custom function does nothing unless the sheet is set in the "Update" mode. The cell used for this purpose can have data validation with dropdown, so it's easy to trigger it between two states.
But in general, a custom function like importJSON are supposed to be recalculated only when its parameter(s) change. If the content of the URL from which it imports the data changes, one may force a manual refresh by calling the function like =importJSON(url, 1) putting some extra parameter in. The custom function will ignore extra parameters, but the Sheets software does not know that. |
H: Help with unlisted streaming
Is it possible to auto-unlist videos AFTER they've been streamed or have I to manually do this myself when the stream has ended?
Or even better, can I set it so people can send me superchats on an unlisted stream?
AI: If you use Stream Now, you can automatically make your stream unlisted once completed in the stream options. |
H: How to translate outcomes of hidden value calculations in multi-lingual application
I am translating an app that is currently in English into Spanish and am unsure of the best practice to translate outcomes of hidden value calculations into other languages.
The form is a compliance checklist with various Yes/No multiple choice questions.
At the end of the form I have hidden values that calculate the total 'Yes' answers (e.g. 'total_compliance_a' = compliance1 + compliance2 + compliance3 + ...) and separate hidden values that calculate if compliance was met (e.g. 'calc_compliance' = if(total_compliance_a = 37 and total_compliance_b >= 19, "Pass", "Did not pass"). Given that these calculations are in hidden values I am not able to translate them via the Bulk App Translator.
What would be the best practice to translate the strings "Pass" and "Did not pass" into different languages to support the application in various languages?
AI: One option could be to use two separate labels to display the different outcomes. You could you create two labels, one for "Pass" and one for "Did not pass", translate them as usual, and then use the hidden value to trigger the appropriate display condition for each label.
That is instead of showing the output directly, you would show one of two labels |
H: Does it cost to setup a custom domain on Heroku?
When attempting to add a custom domain to my Heroku application I am prompted to add my billing details.
Does this mean it costs to setup custom domains for Heroku, even on the free host packages?
AI: To quote Heroku:
Domains can be added to both free and paid Heroku apps and adding domains does not incur extra charges. For verification purposes, you must verify your Heroku account to add domains to apps. |
H: Cannot sign in to my organization Mail by Google using Inbox
The only message I get is this:
Your organization isn't set up for inbox yet
But there the link of "Learn more" doesn't do anything.
AI: For G Suite, formerly known as Google Apps, your company has to enable Inbox before you can use it. You would need to contact your organization's G Suite admin and ask them to follow the steps in this article: Turn Inbox by Gmail on or off |
H: Historical stock price "changepct"
=sparkline(query(GOOGLEFINANCE(A20,"price",today()-30,TODAY(),"DAILY"),"select Col2",-1),{"charttype","column";"highcolor","red"})
The function above provides a visual representation of daily price movement for the last 30 days in a specific cell. Is it possible to similarly track only the daily 'changepct" for the last 30 days?
AI: Here's the first try at this (with linebreaks for readability):
=sparkline(query({
googlefinance("goog", "price", today()-30, today(), "daily"),
googlefinance("goog", "price", today()-31, today()-1, "daily")
},
"select Col4/Col2 - 1", 1),
{"charttype", "column"; "highcolor", "red"})
This calls googlefinance twice for two ranges, the second being offset by one day. Then Col4/Col2 - 1 is the change relative to previous day. If multiplied by 100, it would be the percentage change but seeing as sparkline does not have a scale anyway, I didn't bother to.
However, the above formula may run into trouble because of weekends and holidays, as the price quotes are given for business days only. The two date ranges, although equal in the number of calendar days, may differ in the number of business days. This can be avoided by using array_constrain to limit the number of rows to, say, 20:
=sparkline(query({
array_constrain(googlefinance("goog", "price", today()-30, today(), "daily"), 20, 2),
array_constrain(googlefinance("goog", "price", today()-31, today()-1, "daily"), 20, 2)
},
"select Col4/Col2 - 1", 1),
{"charttype", "column"; "highcolor", "red"})
If the number of googlefinance calls becomes an issue (that is, you have many such sparklines, and doubling the number of calls exceeds the quota), a workaround is to put each googlefinance separately somewhere else, and then refer to that output liks so:
=sparkline(arrayformula(N1:N24/N2:N25 -1),{"charttype","column";"highcolor","red"}) |
H: How to make importJSON leave existing data alone, if calculation not performed?
I'm using the 3rd party importJSON() function, and I needed a way to make it calculate only when I explicitly requested it. Thanks to this question, I now have a way to do that, but a big problem remains.
Now, any time a calculation is performed (which is On Change), importJSON either calculates if I have it set to do so, or wipes out the existing data that was calculated last time. This means my data is constantly disappearing on me in the middle of trying to use my spreadsheet.
Is there any way to make importJSON() return if not set to calculate, but not erase data in previously-calculated cells?
AI: Generally, multiple import-statements of whatever kind are a path to frustration. I offer a general solution, not specific to ImportJSON: it is a way to always invoke a specific custom function explicitly, using the menu. The code is below, and here is the explanation.
Instead of ImportJSON, use manualImportJSON functions, with the same parameters.
This function won't import anything on its own, it only prints "Imported data below this cell" in the cell.
Have ImportJSON in the script as it originally was, but it will no longer be called as a custom function. For the sake of completeness I included a demo version of this function here; it only spits out the parameters and a few numbers to show that it works.
To actually import data, use "Actually import JSON" item in the custom menu, which is added by the onOpen function. It calls the function actuallyImportJSON, which finds all manualImportJSON functions in the sheet, retrieves parameters from it, and passes them to the real ImportJSON function. Then it puts the imported data in the sheet, below the cell with manualImportJSON, so as not to overwrite it. (Note: the data will mercilessly overwrite anything, unlike the output of custom functions.)
Specifically, /^=manualImportJSON/i.test(formulas[i][j]) is the part that tests for "manual" function and eval("ImportJSON" + formulas[i][j].slice(17)) is the part that evaluates the real ImportJSON function. The number 17 is just the length of =manualImportJSON, the characters that are being replaced by ImportJSON.
Limitations of this approach: (a) the arguments of custom function must be literals, not formulas or cell references; (b) the custom function cannot be a part of formula. See below for an alternative.
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Custom", [{name: "Actually import JSON", functionName: "actuallyImportJSON"}]);
}
function ImportJSON(url, query, parseOptions) {
return [[url, query, parseOptions], [1, 2, 3], [4, 5, 6]];
}
function manualImportJSON(url, query, parseOptions) {
return "Imported data below this cell";
}
function actuallyImportJSON() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getDataRange();
var formulas = range.getFormulas();
for (var i = 0; i < formulas.length; i++) {
for (var j = 0; j < formulas[0].length; j++) {
if (/^=manualImportJSON/i.test(formulas[i][j])) {
var data = eval("ImportJSON" + formulas[i][j].slice(17));
sheet.getRange(i + 2, j + 1, data.length, data[0].length).setValues(data);
}
}
}
}
Cell references/formulas as arguments
If the original custom function had such parameters, the approach above will not work since a JavaScript function has no idea what "B2" or such mean. Here is a modified approach.
Instead of =manualimportJSON(url, query, parseOptions), type only the string manualImportJSON in a cell, and put its parameters in separate cells to the right of it. (So, if B2 has "manualImportJSON", then C2 has the URL, D2 has the query, and E2 has parse options.)
Use the modified version of actuallyImportJSON below.
This version gets all values from the spreadsheet, rather than formulas. If a value matches "manualImportJSON" (case insensitive) than the contents of three cells to the right are passed as parameters to ImportJSON; the rest goes as above.
function actuallyImportJSON() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getDataRange();
var values = range.getValues();
for (var i = 0; i < values.length; i++) {
for (var j = 0; j < values[0].length; j++) {
if (/^manualImportJSON$/i.test(values[i][j])) {
var data = ImportJSON(values[i][j+1], values[i][j+2], values[i][j+3]);
sheet.getRange(i + 2, j + 1, data.length, data[0].length).setValues(data);
}
}
}
} |
H: How to select checkboxes in Gmail via keyboard?
I noticed that I can use the arrow keys to move a cursor up and down in my inbox like you see in the 11th email in the list having a blue index to the left of the item:
In normal checkbox I navigate to via some tab order I use the spacebar to check/uncheck the currently selected item.
How do I do likewise in Gmail?
I'd like to avoid using the mouse for selecting non-contiguous items.
AI: Here is a list of keyboard shortcuts:
https://support.google.com/mail/answer/6594
But you use the x key to select a message |
H: Query a column where numbers are mixed with blanks
I have a query where in a column there are numbers and blanks. It seems that the query function is treating everything in the column as string and not numbers. So when I sort, it doesn't sort numerically. How to fix this?
Right now my solution is to make another column and change everything in the desired column to values with =ArrayFormula(if(AN11:AN="",,value(AN11:AN))) then I sort by this new column. This works, but I don't want to make extra columns.
AI: An arrayformula can be applied to data to be queried without creating a new column. Example: suppose I query columns A:C and want to apply an arrayformula to column B. This would look like this:
=query(arrayformula{A:A, arrayformula(if(B:B="", , value(B:B))), C:C},
"select Col1, Col2, Col3 order by Col2 desc")
here {} is array notation, where commas separate columns. The columns of this "virtual array" can only be referred to as Col1, Col2, etc - they do not have names like A, B, C because they are not really spreadsheet columns.
That said, I'm not sure your description of the problem is accurate. I could not reproduce it by putting many empty strings in a column with numbers. Putting in nonempty strings like " " does change the column type to numeric, coercing the numeric values to strings within query.
Looking at your formula if(AN11:AN="",,value(AN11:AN)) I suspect the values in column AN are already strings; otherwise you would not need "value" here.
In any case, the best solution is to fix the problem of data type at the root: do not put empty strings "" in spreadsheet cells (e.g., use if(A2>0, "foo", ) instead of if(A2>0, "foo", "")), do not store dates and numbers as strings, etc. The unexpected behaviour of query is merely a symptom of the incorrect data types in the spreadsheet. |
H: How to hide the navigator tools during the present mode of Google Slides?
In the full screen (slideshow) mode of Google Slides, there is a big navigator on the left bottom side. There are two fundamental problems with it:
The navigator pops up whenever you move the pointer (mouse) which is very distracting to the audience.
The navigator conceals content of the slides lying in that corner.
I wonder, can I hide the annoying slide navigator?
AI: Found a workaround that seems to solve the problem.
When in Google Drive, right click on the presentation file and select preview. Then, select the full-screen option from the bottom bar. |
H: Is it possible to create a multi-lingual webpage on GitHub Pages without Jekyll?
I have create a one-page template in English which I am planning on hosting on GitHub Pages1.
It's a very simple resume website, so I don't need anything as fancy as Jekyll. Is there a way to offer multi-language support for the website?
I was thinking of translating my index.html file into a couple of other languages, and then making some sort of JavaScript popup whereby if a user clicks on one of the flags it would re-load the page with the translated html file. Is this possible? Or perhaps there is a better way of achieving this?
1. God bless them for offering this service for free!
AI: Answering my own question here, but there are plenty of JS plugins such as translate.js that enable client-side translation as long as a dictionary is provided. |
H: How to merge x-axis data from two ranges?
Consider the data below:
1-Jan-2010 3 2-Feb-2009 9
5-Apr-2010 4 18-Apr-2010 5
10-Sep-2012 9 1-Oct-2011 8
The first two columns are for individual A, the last two for individual B.
Is it possible to create a graph such that both ranges are displayed under a common x axis? In other words, 6 data points 9noted with two different symbols with the corresponding date for each data point?
This would be equivalent to a merge of two distinct graphs, to a common x-axis.
AI: Is this roughly what you want?: |
H: Is there Custom User Data equivalent for Locations / Organizations in CommCare?
Is there an equivalent to Custom User Data for Locations / Organizations in CommCare?
AI: yes there is.
From the Manage Organization Structure web interface page you can use the edit locations button to access what is essentially the same interface as the Custom User Data. After you create the structure you can then update the data one at a time through the web interface (accessed by drilling down into your Organizations structure and then choosing "edit") or in bulk via the excel upload process (again, the same as the Custom User Data interface). |
H: Displaying parent case name in a child case export in CommCare
Is there an easy way to display the name of a parent case in the child case data export?
AI: I don't think there's an "easy" way to do this so it just comes through in the export. Your options would be:
Save the name of the parent case to the child case so it is a child case property. This isn't a great idea since if the name of the parent changes later it will be incorrect on the child case. You'd need to be very confident the case names won't change to use this method.
Export the parent_case_id in your export, then also export the parent cases separately. Use a vlookup to match them in Excel after the fact. |
H: Script to work on certain sheetname.... .getSheetByName('Sheet 1'); didn't work. for multiple sheets
I am working with this script:
/** * Automatically sorts the 1st column (not the header row)
Ascending. */ function onEdit(event){ var sheet =
event.source.getActiveSheet(); var editedCell =
sheet.getActiveCell();
var columnToSortBy = 3; var tableRange = "A2:T99"; // What to
sort.
if(editedCell.getColumn() == columnToSortBy){
var range = sheet.getRange(tableRange);
ran
ge.sort( { column : columnToSortBy, ascending: true } ); }
I need it to only run on Sheet 2, Sheet 3, Sheet 4, and not all sheet in the workbook. I tried doing several variation of getsheets that didn't work.
AI: The name of the current sheet is obtained by sheet.getSheetName().
You want to make sure that this name is one of "Sheet 2", "Sheet 3", "Sheet 4". A concise way to express this condition is to have an array sheetList with the names that need to be sorted, and check whether the name of the active sheet is on the list. The method indexOf does this check: it returns -1 if the name is not on the list.
function onEdit(event) {
var sheetList = ["Sheet 2", "Sheet 3", "Sheet 4"];
var sheet = event.source.getActiveSheet();
if (sheetList.indexOf(sheet.getSheetName()) != -1) {
var editedCell = sheet.getActiveCell();
var columnToSortBy = 3;
var tableRange = "A2:T99";
if (editedCell.getColumn() == columnToSortBy) {
var range = sheet.getRange(tableRange);
range.sort( { column : columnToSortBy, ascending: true } );
}
}
} |
H: Authorization Problem
I made a script that makes a copy of its related Google Form after making a few changes to it. Although I've already authorized the script to modify my Google Drive data, it only works properly when the tab where the scripts is written is opened. I used the onOpen() trigger so the script is supposed to work whenever the page is opened or refreshed.
Here is the code and the error that I'm receiving when I have just the form tab opened:
Code: var pastas =
DriveApp.getFolderById("xxxxxxxxxxxxxxxxxxxx").getFolders();
Error: Execution failed: You have no permission to call getFolderById
(line 114, file "Código")
What can I do to fix this?
AI: It's very likely you are using a simple trigger rather than an installable trigger. Simple triggers only can call services that do not require authorization to run. For further details see https://developers.google.com/apps-script/guides/triggers/ |
H: How to display rows based on the filtered content of a column?
I have a table that has three columns:
| name | company | country |
so I have many people belonging to the same country, I wanted to make another table that made a list of unique companies, and another column that listed how many people belonged to that company like so:
| company | num users in company |
that was done using this formula
B1: Unique names
B2: =SORT(UNIQUE(FILTER( A2:A ; ISTEXT( A2:A))))
C1: # of times occurring
C2: =COUNTIF( A2:A ;SORT(UNIQUE(FILTER( A2:A ; ISTEXT( A2:A))) ))
How do I list the countries besides each company mentioned in a separate column, so the end result will look like this?
| company | num users in company | country |
AI: Assuming you data is in Columns A:C. In several steps because easier (my excuse is that you have not clarified whether a company may be associated with more than one country):
In E1: =UNIQUE(QUERY(A:C,"select B,C where B is not NULL order by B,C",1))
to obtain an ordered list of unique company / country combinations.
In G1: Count, in G2 and copied down to suit: =countifs(B:B,E2,C:C,F2)
for the counting of names.
In I1: =query(E:G,"select E,G,F")
to rearrange the column order. |
H: LastPass import feature does not work, v4.1.62 on Firefox v55.0.2 (64-bit)
I'm trying to get LastPass to import my passwords in a CSV file exported from Avast Passwords. For some strange reason, the option to import passwords doesn't seem to work. The screenshots below showcase the issue I'm currently having.
When I press "Other", nothing happens. I've scoured the Internet for a solution. I do have BinaryComponent set to true. I have also clicked on the "Firefox Password Manager" option, it doesn't work.
AI: Apparently, that button doesn't work so I found another way to access the Import button:
I also logged out and logged back in again, that may help. |
H: How do you stop your friends from being notified of what you post on others' walls?
With Facebook, if you go to for example a company's page and post something on their wall, or even another friend's page, how do you stop it from notifying all your friends of what you posted?
I don't care if they visit the actual company's/other friend's page and see it, but I don't want all my friends being notified of what I posted.
Is there a way to do this? I can't see anything in Facebook's privacy settings.
AI: If you are frequent poster (means if you keep updating status, sharing etc), they will not get any notification but if you are posting something after a long time (3 weeks or more), they will get notifcation. There is no control.
If you are writting something on your friend's wall, only they can control who can see that. You can't do anything in that, it will be visible to all your friends.
If you are writting something on any Page, it will be public.
There is no privacy setting to control this. |
H: How to create a folder alias inside of Google Drive
I like always to save files I receive by email into my shared folder in Google Drive. The problem is that my folder structure in Google Drive is pretty deep, so I have to click through many folders to finally arrive at the desired folder.
I would like simply to create an alias for the destination folder (that's like ten levels deep) inside the root directory of my Google Drive folder. I tried creating an actual Mac alias but that alias didn't show on the Google Drive folder structure (only my Mac).
Any ideas?
AI: Pretty easy, I simply had to star the folder in question, and then as soon as I wanted to move the file around, the starred folders immediately appeared. |
H: How can I protect an Apps Script with triggers and authorizations in a shared Google Sheet?
I have a Google Sheet that is shared via URL. It's a list of events. I wrote a script that syncs the list to a shared Google Calendar. The script has an installable on-edit trigger to update the calendar with new information. The script is therefore authorized to edit my calendars.
As stated here,
Installable triggers always run under the account of the person who created them.
Given this is the case, it seems that anyone with the shared link can edit my script to do whatever they want with my calendars. This seems like an inherent security issue in any shared file that has a triggered script with an authorization. Is there any way to prevent this? Am I missing something?
Related:
Can I Protect Scripts in Google Spreadsheets
Note:
This has been marked as a duplicate to the related question, however that question does not specifically require the on-edit trigger functionality.
AI: My solution was to convert the script into a standalone script and programmatically create an on-edit trigger for the spreadsheet using the spreadsheet ID (instructions here). |
H: In a formula search for closest future date in list, how do I include current week?
This array formula searches from a list of dates in Column A and returns the closest future date from today:
=ArrayFormula(MIN(IF(A2:A>TODAY(),A2:A)))
Column A:
8/4/2017
8/11/2017
8/8/2017
8/25/2017
9/1/2017
Today is 8/25/2017. We want it to select 8/25/2017, not 9/1/2017.
How do we fix the formula to include TODAY and future dates? (Not just future date because it's selecting future date on the actual date.)
AI: Start the cut off one day earlier:
=ArrayFormula(MIN(IF(A2:A>TODAY()-1,A2:A)))
(I have deducted 1 from TODAY.) |
H: Character number in hexadecimal
What I am trying to do is have Google Sheets display a number with 10 places, formatted in hex. Here's my current function:
=TEXT(dec2hex(ROW()-2), "0000000000")
The -2 exists just to make sure it starts at zero coming in row 2.
The problem with this set-up is that when it gets to A, it stops formatting in a ten character system, presumably because they are not numbers.
Is there a way to format this system so that it works for hexcode?
AI: This formula works as well, as it uses the second parameter of the DEC2HEX formula:
=DEC2HEX(ROW()-2,10) |
H: How can I buy songs I like from Pandora and listen to them on Google Play?
All the music I've bought is on Google Play. Over on Pandora, I've given "thumbs up" to a lot of tracks. I'd like to buy the Pandora tracks and listen to them in Google Play. But Pandora only seems to offer the ability to buy music from iTunes or Amazon MP3.
I don't want to search for the track names on Google Play, since there may be 20 mixes of the same song, and I want the specific mix I thumbed up. Is there a way to buy these great tracks from Pandora and listen to them on Google Play?
AI: If you cannot manually locate the song on Google Play, you can download the song from iTunes or Amazon after you've purchased the song and then use the Google Play service to listen to them. Google actually is running a promo on this right now.
https://play.google.com/intl/en-US_us/about/music/unlock/
The site says, to use iTunes on Google Play do the following:
Google Play helps you bring your iTunes library to your Android
devices. You can upload up to 50,000 of your songs from your computer
to Google Play for free. Once you’ve uploaded your music, it's
instantly available on the web and your Android phone or tablet. No
wires, downloading or syncing.
Sign up for your Google Play music library To get started, sign up for Google Play and download Music Manager, a simple desktop
application that lets you upload your collection from your iTunes
music library or any music folder on your computer to the cloud.
Sign in to Music Manager, choose where you keep your music and it starts uploading automatically. And when you add new music to your
computer, Music Manager can automatically add it to your library too.
You can upload 50,000 of your songs for free. Music Manager even adds
your iTunes playlists and ratings so you can start listening to your
favorites right away.
Now that you've set up your Google Play music library, you can access it on your Android phone or tablet and the web. Sign in and all
your music is just there, like magic. And when you upgrade to the
latest Android device, your music comes along too. You'll never be
without your favorite artists again. |
H: Receiving mail for an account that isn't mine
My Gmail account is formatted as Firstname.LastName@gmail.com. However I have been receiving emails addressed to: FirstNameLastName@gmail.com.
It's been going for a little while, but now over the last couple of months it has become worse. I was letting the senders know. I'm afraid some of my email may be going to this other person's mailbox!
What can I do?
AI: As the owner of the account FirstNameLastName@gmail.com, you will get all emails sent to FirstName.LastName@gmail.com.
Gmail does not recognize the dots as characters. So if an email gets sent to F.i.r.s.t.Name.L.a.s.t.Name@gmail.com, the account FirstNameLastName@gmail.com will still get the email.
Insert one or several dots (".") anywhere in your email address. Gmail doesn't recognize periods as characters in addresses -- we just ignore them. For example, you could tell people your address was hikingfan@gmail.com, hiking.fan@gmail.com or hi.kin.g.fan@gmail.com.
Source: 2 hidden ways to get more from your Gmail address |
H: How to sort incrementally in Google Sheets
Background
I'm making a spreadsheet that will plan out attendees for a wedding. There will be separate halls for men and women, and we are debating which age groups should be invited. Right now I have a tab in my sheet called age range and it has the following age ranges:
0 - 3
4 - 12
12 - 18
18+
I have a tab that has different families, along with their gender, age range etc listed like so:
Here is the summary sheet:
Question
The goal of doing this spreadsheet is to be able to quickly make decisions like: do we want to invite everyone from family x/y/z with everyone above 12 years old, etc.?
What I would like to do in the spreadsheet is, if I select the dropdown of age group and select, say, 4-12, then I want everyone in the age group 4-12 (and the ones older) to be selected. Right now if I select 4-12, then only the people who are 4-12 years old get listed.
Ideas?
(note: keep in mind I want the age group that is as equal or older, not the other way around. If the age group 18+ was selected, I don't want anyone younger than 18 to be included.)
Here is an editable copy of the spreadsheet
What I tried
I was able to do this for a single value: tell me if the person belonging to a specific cell in the heba_immediate_family table belongs to an age range group that is equal to or greater than the one you selected, by running this:
=match(vlookup(C23, 'age range'!$A1:$B4, 2),
{vlookup(heba_immediate_family!D2,'age range'!$A1:$B4,2)},1)
However I don't know how to expand this to include the whole table, i.e., this formula:
=ARRAYFORMULA(match(vlookup(C24, 'age range'!$A1:$B4, 2),vlookup(heba_immediate_family!D2:D19,'age range'!$A1:$B4,2),1))
returns this error
Did not find value '0' in MATCH evaluation.
Ideas?
AI: The use of MATCH was, indeed, was the way to go, adding that inside the COUNTIFS that you started with. (Corrected for the first row of the ranges.)
COUNTIFS(heba_immediate_family!C2:C, B11, heba_immediate_family!D2:D, C11)
As it is in the screen shot, the first criteria in your COUNTIFS is okay, so we'll start by rebuilding the second criteria. More specifically, what the range is matched against, which is shown as C11 in the sample. Because you need to create a cumulative selection rather than a single selection we need to compare the cell range against the age range using an inequality operator. With nothing given, the COUNTIFS implicitly defaults to = for comparisons. We need to change that to an explicit comparison using >=, greater than or equal, so that it matches anything in the selected range, or greater. This yields:
COUNTIFS(heba_immediate_family!C2:C, B11, heba_immediate_family!D2:D, ">="&C11)
The next problem is that your case is using what is really a text string in what we think of as a numerical range. To fix that is where we need to use the MATCH function. MATCH returns the position of the matched item in the range relative to the start of the range. You have already prepared for this with the age range sheet, which we can use. We don't however need the second column since we're going to use the MATCH function rather than the VLOOKUP function. The numbers we will get from MATCH will, however, be the same as what's listed in the second column, so it does serve as a handy reference. To make this work, we need to use MATCH on both sides of the comparison so that we're getting the same reference point. The MATCH function normally works on one cell, so we also need the ARRAYFORMULA function to apply the first MATCH in an array sense. One last point is that the MATCH function defaults to assuming that the given range is sorted in ascending order. Since the age ranges are really text, they are not. We need to inform the function of this with the optional third argument set to 0, This now gives us:
COUNTIFS(heba_immediate_family!C2:C, B11, ARRAYFORMULA(MATCH(heba_immediate_family!D2:D, 'age range'!A1:A, 0)), ">="&MATCH(C11, 'age range'!A1:A, 0))
If you want to type this in to each cell on the summary sheet, we're done. If you want to be able to replicate it by dragging, then we need to lock down some of the range references with absolute notation, $. This will give us:
COUNTIFS(heba_immediate_family!C$2:C, B11, ARRAYFORMULA(MATCH(heba_immediate_family!D$2:D, 'age range'!A$1:A, 0)), ">="&MATCH(C11, 'age range'!A$1:A, 0))
One more thing we can do to make this all easier to use is to link the sheet names in the formula to the name in the first column. This step will require a change to how the sheets are named, or the way the families are named in the first column of the summary page, so that they are the same. In the first column of the summary sheet you have heba immediate family and it references the sheet named heba_immediate_family. Since typing the underscore is less natural than typing a space, I'd recommend renaming the sheets to remove the underscores, but any way that makes the two match will work. Having done that, the next part is to use the INDIRECT function to turn the text into a sheet reference. Actually, because of how it works, we will really need to turn that into a range reference using the text in the cell as part of it. The way we're going to do that is to concatenate the text in the cell with the fixed text of the range, like this for the age range column, INDIRECT(A3&"!D$2:D"). Doing that for both ranges, and moving it into the data first row of the summary sheet, gives the final version in cell D3, which can be reproduced down the sheet as needed for all the families. The completed formula is:
=COUNTIFS(INDIRECT(A3&"!C$2:C"), B3, ARRAYFORMULA(MATCH(INDIRECT(A3&"!D$2:D"), 'age range'!A$1:A, 0)), ">="&MATCH(C3, 'age range'!A$1:A, 0))
As a further option you could drop the gender column completely from the sheet. Everything in the top half is, by definition, "M", and in the bottom half is "F". So deleting column B moves the age ranges into column B and the formulas into column C. Doing that, and hard coding the gender into the formula gives two formulas.
For the Men, starting in cell C3:
COUNTIFS(INDIRECT(A3&"!C$2:C"), "M", ARRAYFORMULA(MATCH(INDIRECT(A3&"!D$2:D"), 'age range'!A$1:A, 0)), ">="&MATCH(C3, 'age range'!A$1:A, 0))
For the Women, starting in cell C11:
COUNTIFS(INDIRECT(A11&"!C$2:C"), "F", ARRAYFORMULA(MATCH(INDIRECT(A11&"!D$2:D"), 'age range'!A$1:A, 0)), ">="&MATCH(C11, 'age range'!A$1:A, 0))
And, since I see one final option that might be an improvement for use, I'll propose a final improvement, with an understanding. If the intention is to invite the same age range from all the families, rather than different ranges from each family, there is no need to have the age group selectable on each row of the summary sheet. Instead, make it a single cell at the top of the sheet and link all formulas to it. If, on the other hand, you are considering the option of different age ranges from different families, then this change is not what you would want to do.
To do this, combined with the last option about genders, again drop the column B of age group, moving the formulas, and totals, into column B. In cell D1 type "Age group:", and in cell E1 create the age range drop down. Then change the two formulas to these.
For the Men, starting in cell B3:
COUNTIFS(INDIRECT(A3&"!C$2:C), "M", ARRAYFORMULA(MATCH(INDIRECT(A3&"!D$2:D"), 'age range'!A$1:A, 0)), ">="&MATCH($E$1, 'age range'!A$1:A, 0))
For the Women, starting in cell B11:
COUNTIFS(INDIRECT(A11&"!C$2:C), "F", ARRAYFORMULA(MATCH(INDIRECT(A11&"!D$2:D"), 'age range'!A$1:A, 0)), ">="&MATCH($E$1, 'age range'!A$1:A, 0)) |
H: How to conditionally display questions based on lookup table answers?
How can I conditionally display labels depending on the answers selected in a series of multiple choice lookup tables (similar to the filter with Xpath to do this with lookup tables)?
Can I use the answer from a lookup table as a display condition for a label in my app, or would the best option to reference my lookup table in my form be to use < instance id="random_questions" src="jr://fixture/item-list:random_question"> in a hidden value and then use that hidden value in the display condition of my label?
AI: You can indeed. It's a little difficult to explain generically, so I'll use the example from this wiki page. Let's say you have a question (called "Select District") where the choices come from a lookup table:
| field: id | field: name | field:state_id | user 1 | group 1 |
|-----------+-------------+----------------+------------+---------------------|
| ah | Ahmedabad | gujurat | supervisor | Gujurat Users |
| ja | Jamnagar | gujurat | supervisor | Gujurat Users |
| agra | Agra | up | supervisor | Uttar Pradesh Users |
| faizabad | Faizabad | up | supervisor | Uttar Pradesh Users |
Your question will probably have "Value Field" set to "id" and "Label Field" set to "name". When the user then selects, for instance "Jamnagar", the value of that question will be "ja". You can then use that to get more information from the selected row wherever else you may need it. Here's how you reference the name of that row:
instance('project')/project_list/project[id = /data/select-district]/project_name
If you have a question that you only want to display for districts where "state_id" is "gujurat", you can add a display condition like:
instance('project')/project_list/project[id = /data/select-district]/state_id = gujurat |
H: Review answers before submitting the Google Form
I need to echo the answers before the form is submitted so the user can check them, but I couldn't find any way of doing it through a script or app.
How can I do it?
AI: In Google Forms, there is no built-in or Google Apps Script way to echo the answers before form submission.
One alternative is to create a custom form by using Google Apps Script. |
H: Fix font size of Gmail signature
The font size of my Gmail signature looks weird — it sometimes changes even in mid-sentence, and this is only visible outside Gmail, e.g. in the Inbox app on my iPhone. How to fix?
AI: Step 1
An optional diagnostic step, just so you can see what's going on. Send yourself a test email and look at it on your iPhone (or through whatever email reader your emails/signatures tend to look weird on). If it does indeed look weird, open it in Gmail on a desktop/laptop; click the menu next to the reply icon, and you'll see a list of options including "Show original". Peer at the HTML code and you should see that some of the tags (like <div style="...etc.">) break up the writing.
Step 2
These instructions are for Chrome. Instructions for other browsers shouldn't be hard to figure out.
To fix, go to the text input where you typically edit your signature and pull up the text of your signature in there. Go to View > Developer > Developer Tools. Hover your mouse over the topleftmost button and confirm it says "Select an element in the page to inspect it." (If this screen is too small, click the toprightmost button, then the icon that says "undock into separate window" when you hover your mouse over it.) Click the "select an element" button, then click on the text input where you enter your signature.
The DeveloperTools window should now become visible, and you should now see some HTML including a line that begins <div class="gmail_signature">.
Step 3
Two methods:
Step 3a
Hard method: Right click (or control-click) on this line, and click "Edit as HTML". You are now editing your signature as HTML. To make the appearance consistent, one thing you could do is to make sure that each <div> contains a <span style="font-size:12.8px">.
Step 3b
Easy method: You should see lines saying <div> or <div dir="ltr">, and the most-indented lines might begin <span. (Click on the little arrows to show deeper indent levels.) Make sure the most-indented <div> lines just match this pattern: <span style="font-size:12.8px">[some text here]</span>. To fix HTML, right click (or control click) a line and click Edit as HTML, then when you're done click outside that text input that opened up.
When you're done, click "save changes" at the bottom of the Gmail settings page. If the "save changes" button is not clickable, go to the signature editor input, add a space to the end, then remove that space. That should make the button clickable again.
Then send yourself a test email, and use step 1 to figure out how to check out whether the HTML is being generated correctly.
Good luck! |
H: Notifications for Outlook Web Access
My organization asked us to support a limited Microsoft Office license that only allows access to portal web applications, such as Excel, Office, and Outlook online. The only inconvenience is that Outlook does not notify the user when a new email is in the inbox. My end-user expects a sort of number to appear on the tab similar to what Facebook provides.
I tried looking at the Chrome, Firefox, and Internet Explorer options but could not find a third-party application I felt comfortable installing onto a client's computer.
Is there an obvious notification solution that doesn't require the installation of third-party "free" extensions on a browser?
AI: Go into your settings by clicking the gear at the top right. There's an option for Mail under Your app settings on the right-hand column that will appear. Click that link. Options column will open on the left side of the page. Go to Message options. Sound and notification options are there. |
H: Find a Gmail attachment by size
I am searching a mailbox for the mail that first brought a specific attachment. Since the original mail, the attachment has been saved to associated Google Drive and likely been renamed too.
Since it has been renamed, filename:CurrentFileName.pdf searches don't find my document under the filename I know. The only thing I can think of that is likely not to have changed is the file size (PDF files should not change size).
In short: It's easy to search the mailbox by email size (size:) but what about attachment size? Is there a syntax like attachment:size?
Side note: a search by email size within a 5kB range around the file size found nothing, most probably because the original mail has several files attached.
AI: Unfortunately, there's no search filter for attachment size (though that would make a good feature request).
The closest you'll likely be able to get is to use several search parameters to try to find a group of emails that might contain the one you're looking for. You could try:
has:attachment filename:pdf larger:{minSize}
Replace {minSize} with a size that you know is smaller than the attachment.
If you have any idea when the email was sent, you can include an after: or before: filter -- or both -- to narrow it down even further.
If you remember at least part of the file name, you can use wildcards in your search. For example, you could search for filename:report*.pdf or filename:*report*.pdf.
Other filters can be added, depending on any other information you might have, such as the sender's name, whether the email was marked as "important," etc. |
H: Calculate duration from log events
I have log-events with a timestamp like the following in Google Spreadsheets:
Date Time Event
8-30-17 8,42 Login
8-30-17 12,31 Logout
8-30-17 14,1 Login
8-30-17 18,54 Logout
8-31-17 6,89 Login
8-31-17 14,01 Logout
9-1-17 8,24 Login
9-1-17 12,57 Logout
9-1-17 13,43 Login
9-1-17 18,03 Logout
So essentially this is the date and time when a login/logout occurred. I now would like to calculate the logged in time for each date. Taking the 8-30-17 this would result in a total duration of 3,89 + 4,44 = 8,33 hours.
As a second duration I would like to get the total time between the first login and the last logout for a day. So again for the 8-30-17 this would mean a total duration of 10,12 hours.
Is it possible to calculate this with Google Spreadsheets or is this too advanced?
AI: Provided not logged in over midnight (and you can handle some repetition) something like:
=sumifs(B:B,A:A,A2,C:C,"Logout")-sumifs(B:B,A:A,A2,C:C,"Login")
(copied down) may serve, assuming you adjust the delimiter (, to ;) if required and that your data is numeric.
SUMIFS |
H: Filter YouTube to avoid spoilers
I do not know whether this is the right StackExchange site, but I would like to ask whether I can tell YouTube somehow (without installing add-ons to my browser) to top showing me anything related to Game of Thrones. I am not currently planning to watch this year's season and when I get to watch it, I would like to do so without knowing everything that is going to happen. The YouTubers are so stupid (sorry for that word, but it really bothers me) that they are putting images and titles to their videos which spoil the plot just by accidentally looking at the reference.
Unfortunately, going anonymous does not work here either; tried that and failed.
AI: The only thing you can do is tell YouTube with all means available to you that you aren't interested in GoT content, ie by not watching any GoT-related stuff and immediately marking whatever you do see as not relevant (3-dot-menu next to the title, usually). |
H: How to change the color of any function in desmos function grapher without the need to delete and recreate the function all the time?
I don't see any way to change the color of some function without the need to delete it and recreate it.
I think and believe that there must be a better, easier, faster and more convenient way to change the color of any function without the need to delete it and recreate it all the time but if there is better and easier way to do that then what is it?
AI: From Change Color or Style (UNTESTED - I think you would need to be signed in, or click on Edit List (the gear icon) first):
To change the color or style of an expression, long-hold the colored icon to the left of the expression. Clicking the icon will hide or show the expression. |
H: Can I date-format cells to display my own abbreviations for months?
In Google Spreadsheets I don't like the built-in abbreviations of the month names in date formats. I especially hate the fact that abbreviations for month names doesn't have a fixed length. I think the use of a period in those abbreviations is ugly, useless and unnecessary.
1-ene.-2017
1-febr.-2017
1-mzo.-2017
1-abr.-2017
1-my.-2017
1-jun.-2017
1-jul.-2017
1-ag.-2017
1-set.-2017
1-oct.-2017
1-nov.-2017
1-dic.-2017
AFTER ANSWER ACCEPTED:
1-Jan-2017
1-Feb-2017
1-Mar-2017
1-Apr-2017
1-May-2017
1-Jun-2017
1-Jul-2017
1-Aug-2017
1-Sep-2017
1-Oct-2017
1-Nov-2017
1-Dec-2017
AI: These, I am guessing are representations of a date index (numbers formatted as dates) and to preserve that flexibility I suggest you change your Locale in Spreadsheet settings... (say to United Kingdom) in File. This though might not be convenient as it may also switch the decimal separator from , to ..
A suitable format then might be:
dd-mmm-yyyy
Other than something of that kind your only choice is to convert from Number format (Date) to Text format with string handling. So extract the month number, say with:
=month(A1)
look up its appropriate name/abbreviation (create a lookup table mapping numbers to whatever text suits you) and then concatenate it with day (1st) and year (2017), something like:
="01-"&VLOOKUP(month(A1),Month_Table,2,0)&"-2017"
However for most processing of the dates you would then need to reverse those steps. |
H: Is there function overloading in Desmos function grapher?
My input in Desmos function grapher is:
1. f(x,y)=x+y
2. f(x,y,z)=x+y+z
3. f(x,1)
4. f(x,2,3)
but it alerts me the following error/warning:
You've defined 'f' in more than one place. Try picking a different variable, or deleting some of the definitions of 'f'.
Is there a special/unique syntax to note/tell Desmos that I want to overload function f?
AI: No, overloading is not supported. I threw together a hack that may work for you, using a list as input: Fake Function Overloading. |
H: Can I assign a file to more than one folder in Google Drive?
It is possible to have the same file in more than one (1) folder?
Something like symlinks or hard links in Linux.
AI: Yes. Locate the file in its original folder, and select it.
Now press Shift+Z.
From the folder select window that opens, navigate to the folder where you would like to add the file.
Now, the file is available in both its original and the newly selected folder.
Source: http://www.pcworld.com/article/3062612/software-productivity/how-to-add-a-file-to-multiple-folders-in-google-drive.html
Be aware, that if you navigate to the new folder, and press Delete on the file there, it will be deleted from both locations (or, more precisely, it will be moved to the Trash can).
If you just want to remove it from one of the folders without deleting it from everywhere, select the file and click the (i) icon. The sidebar that appears lists all the file's folders, and lets you remove them individually. |
H: Linking Wikipedia articles in different languages
Wikipedia pages have the article in different languages on the left pane.
How does this linking work?
I have also noticed that the language options change when you go to one that is listed there. Are the pages listed in the page's plain text?
AI: You used to have to add language links in the article text, but that has not been true for the last few years.
Interlanguage links are managed from the Wikidata specialty site.
Find the specific topic you want to add an interlanguage link to on Wikidata (e.g., Beer) and add the correct link in the proper format.
Much more information is available from Wikipedia Help. |
H: YouTube next/previous tracks in a mix
I do not mean YouTube playlists or the next auto-play track. I mean a long YouTube mix of music that is all within the same video, i.e. one like this.
It is a hassle to have to scroll down and click the time next to the track name, I'd like a way to have a next/previous track for mixes like this (provided the time for each track is given in the description).
How can I do this?
AI: While it's not natively possible on YouTube, you can do so using a usercript.
I've created a userscript that adds a previous and next song in the mix functionality to YouTube (along with hotkeys u and i to go back and forward). You need something like TamperMonkey installed for your browser and can download it from GreasyFork if you'd prefer.
Here's the code:
// ==UserScript==
// @name YouTube mix next/previous buttons
// @namespace https://zachsaucier.com/
// @version 0.5
// @description Adds next/previous buttons to seek between tracks in a YouTube mix without having to scroll down.
// @author Zach Saucier
// @include /^https://www.youtube.com/watch
// @grant none
// ==/UserScript==
(function() {
'use strict';
function goToNextTrack() {
var currTimeString = document.querySelector(".ytp-time-current").innerText,
currTime = parseTimeString(currTimeString);
for(var i = 0; i < timeLinks.length; i++) {
var linkTimeString = timeLinks[i].innerText,
linkTime = parseTimeString(linkTimeString);
if(isLaterTime(currTime, linkTime)) {
timeLinks[i].click();
return;
}
}
timeLinks[0].click();
}
function goToPreviousTrack() {
var currTimeString = document.querySelector(".ytp-time-current").innerText,
currTime = parseTimeString(currTimeString);
for(var i = timeLinks.length - 1; i >= 0; i--) {
var linkTimeString = timeLinks[i].innerText,
linkTime = parseTimeString(linkTimeString);
if(isLaterTime(linkTime, currTime)) {
timeLinks[i].click();
return;
}
}
timeLinks[timeLinks.length - 1].click();
}
function parseTimeString(timeString) {
var timeArr = timeString.match(/\d+/g);
var h = 0,
m = 0,
s = 0;
if(timeArr.length === 3) {
h = parseInt(timeArr[0]);
m = parseInt(timeArr[1]);
s = parseInt(timeArr[2]);
} else if(timeArr.length == 2) {
m = parseInt(timeArr[0]);
s = parseInt(timeArr[1]);
}
return [h, m, s];
}
function isLaterTime(firstTime, secondTime) {
if(firstTime[0] < secondTime[0]
|| (firstTime[0] === secondTime[0] && firstTime[1] < secondTime[1])
|| (firstTime[0] === secondTime[0] && firstTime[1] === secondTime[1] && firstTime[2] < secondTime[2])
)
return true;
else
return false;
}
var description,
timeLinks;
var url = window.location.href;
var videoid = url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);
function checkReady() {
description = document.getElementById("description");
if(description) {
timeLinks = description.querySelectorAll("a[href *= '/watch?v=" + videoid[1] + "'");
// If true, it's (probably) a mix with tracklisting provided
if(timeLinks.length > 0) {
// Create the buttons
var nextButton = document.createElement("button"),
prevButton = document.createElement("button"),
br = document.createElement("br");
nextButton.innerText = "Next track";
prevButton.innerText = "Previous track";
nextButton.onclick = goToNextTrack;
prevButton.onclick = goToPreviousTrack;
nextButton.style = "cursor: pointer; background-color:#444244; color: white; padding: 4px 12px; border: none; margin-right: 5px; margin-bottom: 5px;";
prevButton.style = "cursor: pointer; background-color:#444244; color: white; padding: 4px 12px; border: none; margin-right: 5px; margin-bottom: 5px;";
nextButton.title = "Hotkey: u";
prevButton.title = "Hotkey: i";
description.insertBefore(br, description.childNodes[0]);
description.insertBefore(nextButton, description.childNodes[0]);
description.insertBefore(prevButton, description.childNodes[0]);
// Create the key listeners
document.addEventListener("keyup", function(e) {
if(e.keyCode === 73
&& e.srcElement.tagName !== "INPUT"
&& e.srcElement.tagName !== "TEXTAREA") { // i pressed
goToNextTrack();
} else if(e.keyCode === 85
&& e.srcElement.tagName !== "INPUT"
&& e.srcElement.tagName !== "TEXTAREA") { // u pressed
goToPreviousTrack();
}
});
}
}
else {
setTimeout(checkReady, 100);
}
}
setTimeout(checkReady, 100);
})(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.