Is there a way to display cell number on Google Colab ? ( not line number ) - google-colaboratory

Is there a way to display cell number on Google Colab ? ( not line number ). I did not find the answer with standard google searches and the option does not exist in the Tools > Parameters > Editor section of Google Colab.

Related

How can I open a pdf in Edge like in Internet-Explorer with args search tag from command line?

#echo off
START /max iexplore.exe http://stwfue/svn/y//4cs-gw/51_integration/product_systems/ecad/CP4/tags/cp4_v01_t05/result/pdf/Y_4CS-GW_SP4.pdf#search=Fensterkomparator
Edge now uses the chromium engine and you can find an open issue on chromium project:
Issue 792647: Implement "search" PDF Open Parameter in PDF Viewer
"search" parameter is not implemented in Edge/Chrome PDF viewer, so you can't use it in Edge.
I suggest that you can star the issue to add a vote. Besides, you can raise a feature request about adding "search" parameter by pressing Alt+Shift+I in Edge. Edge team will check the feedback and improve the product continuously. Thanks for your understanding.
Edge PDF reader is not Acrobat so only a subset of Adobe URLs appear to be available.
As a side comment, my Acrobat Reader will accept #page or #nameddest but not #search because of my security settings to block actions.
"#search=wordList Opens the Search UI and performs a search for the specified word list in the document."
The correct default to call Edge is
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "file:///C:/users/name/downloads/PDFOpenParameters.pdf#zoom=200&nameddest=Resources"
Note the order here in Edge is zoom first but the nameddest is on page 3 which is respected HOWEVER the destination is not showing ! But If I reverse order the zoom is not actioned, yet again your mileage may vary.
[Update]
SumatraPDF could in the past be scripted to search via vbs, but that is no longer needed in latest 3.4 Pre-release as -search has been added to command line options, and can be mixed with others for example:-
curl -o sample.pdf https://africau.edu/images/default/sample.pdf & SumatraPDF.exe -zoom "fit width" -page 1 -search "continued from page 1" "sample.pdf"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3028 100 3028 0 0 3028 0 0:00:01 --:--:-- 0:00:01 4723

Train Tesseract to label icons

I'm trying to create training data for Tesseract 4.0 to identify icons (like, comment, share, save) in screenshots. This is a sample screenshot:
I would like to fine tune the Tesseract to achieve output as below:
Like 147
Comment 29
Saved 5
Actions
58
Actions
Profile Visits 24
Follows 2
I have followed step-by-step as stated in https://pretius.com/how-to-prepare-training-files-for-tesseract-ocr-and-improve-characters-recognition/
I modified the box file as below:
- Heart : Like
- Speech bubble: Comment
- Bookmark: Saved
- Arrow: Share
But, the final training data failed to read the icon as I wanted. Example of error I've got is 'Like is not in unicharset'. Do I have to do something different when creating the unicharset for icons?
I've figured it out. The box editor expects single letter/number instead of full words. I have used Unicode character to interpret my icons. The steps are as below:
Crop all target icons that you wish for Tesseract to detect and save it in one file named as (in my case) own.std.exp0.png
Create box file using the command 'tesseract own.std.exp0.png own.std.exp0 makebox'
Open jTessBoxEditor and input unicode at the char column. The list of supported unicode can be found under program Character Map (https://sites.psu.edu/symbolcodes/windows/charmap/). Example: For heart symbol I used U+2665. Note that some unicode are not supported. It shows as blank square. So, keep trying till you find one that works. My final edited box file looks like this.
Create the final training file which will be own.trainneddata (can be done as shown here https://medium.com/apegroup-texts/training-tesseract-for-labels-receipts-and-such-690f452e8f79 or train using jTessBoxEditor).
Copy the own.traineddata to the directory Tesseract/tessdata and run Tesseract using lang='own+eng'. I used pytesseract and the output is as below:

PDF File Merge Based on Filename

I have large batches of pdf files that must be merged.
Folder1 FileName Explaination: invoice12-105767-1510781492.pdf - 105767 is the component that will match with a pdf filename in Folder2.
"invoice12-" First section of the filename. This can sometimes be "invoice11-" or "invoice6-" so merging based on character length became challenging. The "invoicexx-" are based on where in the system the file came from.
"105767" Second part of the filename. This is the key component for matching and merging. this will be the filename in Folder2 it belongs with.
"-1510781492.pdf" Third part of the filename is a system generated unique ID, which can contain more or less characters.
Folder1:
invoice12-105767-1510781492.pdf
invoice12-105768-1510781484.pdf
invoice12-105769-1510781469.pdf
Folder2:
105767.pdf
105768.pdf
105769.pdf
OutputFolder:
Example I don't want to merge all the files in both folders into 1 huge file. I need them merged based on the Folder2 filename. (105767.pdf + invoice12-105767-1510781492.pdf) in that order specifically, also.
The final output should be three pdf files merged in order as follows:
105767.pdf + invoice12-105767-1510781492.pdf to make 1 file named 105767.pdf
105768.pdf + invoice12-105768-1510781484.pdf to make 1 file named 105768.pdf
105769.pdf + invoice12-105769-1510781469.pdf to make 1 file named 105769.pdf
I would appreciate any assistance with a way to automate this process. I merge over 800 files per day. This small automation would shave hours off my day and my wrist from carpel tunnel.
I primarily use Mac OS 10.13.1. I have looked around in Mac's "Automater" program and cannot figure out how to get it to do what I need. (I did figure out a great way to split files into single pages)
I downloaded pdftk server (since that is Mac compatible) but cannot figure out if this type of match and merge is capable with this program.
I have Adobe Acrobat DC Professional and it does not seem to have this match and merge function.
I am even open to other paid programs. I just need a fairly future-proof way of getting this mundane task done through automation on my Mac.
You can take a look at the APDFL library examples that are provided with sample code. These libraries are supported on Mac, but are not free.
https://dev.datalogics.com/adobe-pdf-library/sample-program-descriptions/c1samples/#mergedocuments
Here is a snippet of the code you would need to use:
APDFLDoc doc1 ( csInputFileName1.c_str(), true);
APDFLDoc doc2 ( csInputFileName2.c_str(), true);
// Insert doc2's pages into doc1.
// Here, we've stated PDLastPage, which adds the pages just before the last page of the target.
// If we specify PDBeforeFirstPage instead, doc2's pages will be inserted at the head of doc1.
PDDocInsertPages ( doc1.getPDDoc(),
PDLastPage,
doc2.getPDDoc(),
0,
PDAllPages,
PDInsertAll,
NULL, NULL, NULL, NULL);
doc1.saveDoc ( csOutputFileName.c_str(), PDSaveFull | PDSaveLinearized);

How to save complete pdf document with plots and results with mathematica?

I need to:
Analyse Data > Get plots and numerical results > Repeat for different sets of data > Make a document
The problem is that I need to create a pdf document for dozens of sets of data... Exporting and copying to a document separately those many graphs and numerical results is a really repetitive process and I'm trying to do that a bit faster, is there a way to do that?
The ideal would be to create a pdf document with: "plot and results + plot and results + plot and results + ..."
Evaluate this in the notebook you want to export as pdf:
Export["~/Desktop/nb.pdf", SelectedNotebook[]]

Display variables using CBC MPS input in NEOS

Am trying to use NEOS to solve a linear program using MPS input.
The MPS file is fine, but apparently you need a "paramaters file" as well to tell the solver what to do (min/max etc.). However I can't find any information on this online anywhere.
So far I have got NEOS to solve a maximization problem and display the objective function. However I cannot get it to display the variables.
Does anyone know what code I should add to the paramters file to tell NEOS/CBC to display the resulting variables?
The parameter file consists of a list of Cbc (standalone) commands in a file (one per line). The format of the commands is (quoting the documentation):
One command per line (and no -)
abcd? gives list of possibilities, if only one + explanation
abcd?? adds explanation, if only one fuller help(LATER)
abcd without value (where expected) gives current value
abcd value or abcd = value sets value
The commands are the following:
? dualT(olerance) primalT(olerance) inf(easibilityWeight)
integerT(olerance) inc(rement) allow(ableGap) ratio(Gap)
fix(OnDj) tighten(Factor) log(Level) slog(Level)
maxN(odes) strong(Branching) direction error(sAllowed)
gomory(Cuts) probing(Cuts) knapsack(Cuts) oddhole(Cuts)
clique(Cuts) round(ingHeuristic) cost(Strategy) keepN(ames)
scaling directory solver import
export save(Model) restore(Model) presolve
initialS(olve) branch(AndBound) sol(ution) max(imize)
min(imize) time(Limit) exit stop
quit - stdin unitTest
miplib ver(sion)
To see the solution values, you should include the line sol - after the min or max line of your parameter file.
If this doesn't work you can submit the problem to NEOS in AMPL format via this page. In addition to model and data files, it accepts a commands file where you can use statements to solve the problem and display the solution, for example:
solve;
display _varname, _var;
This post describes how to convert MPS to AMPL.