How do you get the firebase log viewer to show line numbers? - firebase

Is there a way to get line numbers from log entries, for example when you do a:
console.log('Already a Thumbnail.');
It would be nice to see more than:
Instead it would be useful to also see the line number, particularly as functions get larger, is this possible? Thanks!

The Firebase Cloud Functions log doesn't have the ability to show line numbers as it's basically reading from stdout (or similar).
You may be able to glean further insight by viewing logs through the Cloud Functions Stackdriver Logging UI though.
Also, it's worth adding more details to your logs or using tags to distinguish between different console.log calls, for example:
console.log("ifThumbnailExists: Already a Thumbnail.");
And if you want to use the same log message on multiple lines, another line may use:
console.log("ifSmallImage: Already a Thumbnail.");
Ultimately the idea is that you should be able to tell what line or method the logs are coming from by providing additional details and using unique log messages.

Related

How do I provide my Identity / Email when connecting to NCBI through Rentrez?

My project head is telling me that its unacceptable to connect with NCBI to retrieve sequence entries without sending along identifying information such as our institution email. They claim this means NCBI won't instantly block our connection if we violate their user guidelines, they'll 'email' us first. We are using Rstudio with the Rentrez package to retrieve protein sequences from NCBI Genbank.
But I'm not certain that's necessary or IF rentrez has any way to even do that. For reference this is general format of our code.
sequence <- entrez_fetch(db="nuccore", id=**accession_number**, rettype="fasta")
Rentrez says on their documentation: "The NCBI will ban IPs that don't use EUtils within their user guidelines. In particular /enumerated /item Don't send more than three request per second (rentrez enforces this limit) /item If you plan on sending a sequence of more than ~100 requests, do so outside of peak times for the US /item For large requests use the web history method (see examples for entrez_search or use entrez_post to upload IDs)"
Both entrez_search and entrez_post include an argument called "web_history A web_history object for use in subsequent calls to NCBI" I'm not sure if this is what I'm looking for though.
I can't find any arguments or functions etc. which allow the user to send identifying information to NCBI when connecting.
It seems like you need an API key. You can get one from your NCBI account interactively, and it needs to be specified in your .bash_profile (at least on a mac, using bash, not sure your OS / terminal of choice here).
For command line usage it just needs to be set as a variable with the following line added to your profile:
export NCBI_API_KEY=<yourkeyehere>
Then as long as R is loading up that profile when it spins up, you should be fine.
EDIT:
A bit of a tangential note here, you can grab files from the FTP site with utilities like curl and wget, or even Biostrings' functions like readDNAStringSet() without an API key, but if you're going to access things with eutils, you need one - as long as you're going OVER the X-number of queries per second - but if you're under that threshold, i don't think they care that much.

How to get a list of all the telegram groups I have joined?

I want to get the list of telegram groups(name) which I am a part of. Like a text file or something else. How can I do that?
I had the same question here, so I started searching and found no proper answer. Then I came over this question and since it had no answers, it triggered me to search more and write an answer.
According to what Telegram document says here and here:
messages.getAllChats
Get all chats, channels and supergroup
apparently getAllChats gives you all ChatIds. You can pass chatIds to another API to get chat name and more info.
Also, if you want to get the list of chats you administrate, use the following API:
channels.getAdminedPublicChannels
Get channels/supergroups/geogroups we're admin in. Usually called when
the user exceeds the limit for owned public
channels/supergroups/geogroups, and the user is given the choice to
remove one of his channels/supergroups/geogroups.
I just don't like (or maybe understand) the way they documented their APIs. I wish it was something more familiar, more HTTP-like.
Another way - use web-version of the telegram and parse HTML. Here are steps:
create folder with only groups;
go to web-version, open this folder;
run code copy($$(".dialog-title .peer-title").map(function(e){return e.textContent})) in console, it will copy title of groups on screen into clipboard;
if you have a lot groups on several screens, list groups below and make previous step again;
join all the groups into one big list;
profit!

Jmeter: How do I create a separate report for each assertion?

Right now, my HTTP call has 3 assertions. The reporting options for the results listener only provide a checkbox for "Assertion Results", which lumps all of my assertion results into one value in the CSV output.
The team would like to create a csv output for each assertion. The problem is, you can't add a results listener under an assertion, it must be under the HTTP call. I can't think of a way to create separate reports besides making three separate HTTP calls, each with their own results listener writing a report. That is not ideal.
I tried with jtl with XML.
Below is the config. Use minimum parameter required as it consume a lot of resource.
Below is the output.
But i think if you try to have response time in the same then there will be same entry twice. Similarly, other calculation might get impacted. So, you can use two one this and other simple data writer.
Hope this helps.

cloud functions truncating logs

I currently rely on getting some information from cloud functions through console.log(information)
However, whenever the logs are long they are truncated when viewing on the browser. Scrolling bring up the next set of logs, hence the logs are incomplete (see attached image)
I'm aware that I can store his data in the database, but sometimes it's convenient viewing the logs as well
Anyone with a better way of going round this?
There is no easy workaround for this. You would have to build a string of whatever you want to log, split it into segments that fit on screen, then log those substrings separately. Or, you could write the log somewhere else temporarily, such a database.
This is a known issue, but please feel free to file a bug report to add your voice.

thunderbird - number of underad messages, from .sqlite base

I want to make a small plugin for awesome WM that will show a number of unread messages pending in Thunderbird. I want to fetch the number of messages accessing directly Thunderbird sqlite base. The question is: which base, table and fields should I query?
There are at least 15 bases under ~/.thunderbird/profile/, including ./global-messages-db.sqlite. In this base I tried messageAttributes table, but with no big success. I could not find development documentation describing the attributes...
Any help here?
You will find what you need in the global-messages-db.sqlite file. If you watch the messages table, you will find a column jsonAttributes. In there you will find a JSON array, from attribute ids and their value. The key 58 is the read-status of a message. So if you find something like {"58": false} in this column the message is still unread. But this database won't be updated immediately when a new message is received. (It might even be updated only, when you close Thunderbird -- I am not sure about that.)
So as you see finding unread messages that way will be a bit of the hard way to go. I would recommend you to better create a plugin, that is directly checking the server via IMAP or POP3.
For IMAP servers there already exist an awesome-plugin inside the Delightful Extensions. I don't know of any POP3 plugin, and as it seems POP3 libs for lua are also rare to find.

Resources