Where is mathematica help notebook? - wolfram-mathematica

I apologize that this isn't a question on how to use Mathematica, but rather where the documentation lies inside the applications folder.
During a drag and drop, I happened to drag the Mathematica symbol on the help window (on a Mac) onto the desktop, which just ended up dragging the help file onto the desktop. Now, I don't know where in the applications folder folder that file belongs (file name: Mathematica.nb) so that I can place it back and my help won't start because the file isn't where it is looking. My best guess is somewhere in /Applications/Mathematica/Documentation/, but theres tonnes of folders in there. Could someone check in their folder and let me know where this file belongs (again, I'm on a Mac)?

In[70]:= FileNames["Mathematica.nb", $InstallationDirectory, Infinity]
Out[70]= {"C:\\Program Files\\Wolfram \
Research\\Mathematica\\8.0.1\\Documentation\\English\\System\\Guides\\\
Mathematica.nb", "C:\\Program Files\\Wolfram \
Research\\Mathematica\\8.0.1\\Documentation\\English\\System\\\
ReferencePages\\Programs\\Mathematica.nb"}
You want the first one, in Documentation/English/System/Guides.

Related

Pathway to directory lost in R studio

I am relatively new to R studio, I am attempting to import a .RNK file to run on GSEA. However, the pathway to my working directory is lost and I keep receiving a file, "rt" warning message.
When comparing my working directory with my usual windows explorer file, the files themselves are absent from the working directory.
I have attempted to change the Default text encoding to UTF-8 but this has had no effect. I would be grateful for any suggestions to help with this problem?
That is a very common problem!
You have four options to select the correct file and path! Hope at least one can work well.
Manually without code, you can go to the top and choose Session->Set Working Directory -> Choose Directory... and then select the file.
You can just use the function file. choose() and look for the file on your computer and select it.
You can look for the file path on your computer and write it in R. Look in the local search engine for your computer and search for the file. For example: setwd("~/Desktop/University/Homework")
You can use getwd() in the console to know where the script is working and saving the files and then look for the files there!
PD: the best way to work in R and R-Studio/Posit for me is by creating a project. Doing so, you will have everything related to the script in one folder (new and old files!). It is similar to setwd()but better!

mac screengrab creates two files

I ran two commands in Terminal to (a) turn off screengrab shadows, and (b) to change the default save location for screengrabs.
The shadows are now gone and the screengrabs save where I want them to. However, when I invoke command-shift-3 to create a screengrab of the entire desktop, I get two files, one containing what I want as well as a screengrab of the 'background', that is the desktop (with any open finder windows).
Could anyone suggest a fix? Thanks in advance.
Sorry! Please disregard this question… I feel embarrassed to admit that it had something to do with … er… my dual monitor setup.

Is it possibly copy files and position them in my folder with x y coordinates?

Really out there question but, I wanted to create a batch script or (any script) to copy files in a folder be able to position them around in a folder window in a particular arrangement. For example, if I apply the script to my desktop or current open window then it arranges all my shortcuts and files to create an "X" pattern or a circle. Is it possible to XCOPY in a batch file and apply x & y positioning? What language would have control over lets say my Windows 8 or Windows 7 Desktop environment?
It's essentially like answered in this question. The desktop is a Listview which supports setting icon locations. You would need a little program to be used after your copy operation.
If this were possible, since Windows Vista it would only work maybe on the Desktop, or in a "place" that is facilitated by a Shell Extension, like the desktop. Or unless I am mistaken Explorer no longer arranges items in any view. Try to reposition one yourself. It should pop back into its sorted order in a perfect grid (unless you are using XP or a pre-XP version.)
I once had a self-extracting archive have one of its files way off several scroll screens away (all by itself) in its folder after extraction. It was two years before I ever noticed that file. It was part of a patch. I'd thought the file lost to time.

Opening a CHM file produces: "navigation to the webpage was canceled"

I am trying to open a .chm file.
I downloaded the source, extracted it, and double clicked on Waffle.chm and clicked "Open" but no matter what element in the chm file I click, I get the message:
Navigation to the webpage was canceled.
What you can try:
Retype the address.
What's going on here?
Summary
Microsoft Security Updates 896358 & 840315 block display of CHM file contents when opened from a network drive (or a UNC path). This is Windows' attempt to stop attack vectors for viruses/malware from infecting your computer and has blocked out the .chm file that draw data over the "InfoTech" protocol, which this chm file uses.
Microsoft's summary of the problem: http://support.microsoft.com/kb/896054
Solutions
If you are using Windows Server 2008, Windows 7, windows has created a quick fix. Right click the chm file, and you will get the "yourfile.chm Properties" dialog box, at the bottom, a button called "Unblock" appears. Click Unblock and press OK, and try to open the chm file again, it works correctly. This option is not available for earlier versions of Windows before WindowsXP (SP3).
Solve the problem by moving your chm file OFF the network drive. You may be unaware you are using a network drive, double check now: Right click your .chm file, click properties and look at the "location" field. If it starts with two backslashes like this: \\epicserver\blah\, then you are using a networked drive. So to fix it, Copy the chm file, and paste it into a local drive, like C:\ or E:. Then try to reopen the chm file, windows does not freak out.
Last resort, if you can't copy/move the file off the networked drive. If you must open it where it sits, and you are using a lesser version of windows like XP, Vista, ME or other, you will have to manually tell Windows not to freak out over this .chm file. HHReg (HTML Help Registration Utility) Utility Automates this Task. Basically you download the HHReg utility, load your .chm file, press OK, and it will create the necessary registry keys to tell Windows not to block it. For more info: http://www.winhelponline.com/blog/fix-cannot-view-chm-files-network-xp-2003-vista/
Windows 8 or 10? --> Upgrade to Windows XP.
"unblocking" the file fixes the problem. Screenshot:
Win 8 x64:
just move it to another folder or rename your folder (in my case: my folder was "c#").
avoid to use symbol on folder name. name it with letter.
done.
In addition to Eric Leschinski's answer, and because this is stackoverflow, a programmatical solution:
Windows uses hidden file forks to mark content as "downloaded". Truncating these unblocks the file. The name of the stream used for CHM's is "Zone.Identifier". One can access streams by appending :streamname when opening the file. (keep backups the first time, in case your RTL messes that up!)
In Delphi it would look like this:
var f : file;
begin
writeln('unblocking ',s);
assignfile(f,'some.chm:Zone.Identifier');
rewrite(f,1);
truncate(f);
closefile(f);
end;
I'm told that on non forked filesystems (like FAT32) there are hidden files, but I haven't gotten to the bottom of that yet.
P.s. Delphi's DeleteFile() should also recognize forks.
The definitive solution is to allow the InfoTech protocol to work in the intranet zone.
Add the following value to the registry and the problem should be solved:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"MaxAllowedZone"=dword:00000001
More info here: http://support.microsoft.com/kb/896054
Go to Start
Type regsvr32 hhctrl.ocx
You should get a success message like:
" DllRegisterServer in hhctrl.ocx succeeded "
Now try to open your CHM file again.
other way is to use different third party software. This link shows more third party software to view chm files...
I tried with SumatraPDF and it work fine.
I fixed this programmatically in my software, using C++ Builder.
Before I assign the CHM help file, Application->HelpFile = HelpFileName, I check to see if it contains the "Zone.Identifier" stream, and when it does, I simply remove it.
String ZIStream(HelpFileName + ":Zone.Identifier") ;
if (FileExists(ZIStream))
{ DeleteFile(ZIStream) ; }
There are apparently different levels of authentication. Most articles I read tell you to set the MaxAllowedZone to '1' which means that local machine zone and intranet zone are allowed but '4' allows access for 'all' zones.
For more info, read this article:
https://support.microsoft.com/en-us/kb/892675
This is how my registry looks (I wasn't sure it would work with the wild cards but it seems to work for me):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"MaxAllowedZone"=dword:00000004
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"UrlAllowList"="\\\\<network_path_root>;\\\\<network_path_root>\*;\\ies-inc.local;http://www.*;http://*;https://www.*;https://*;"
As an additional note, weirdly the "UrlAllowList" key was required to make this work on another PC but not my test one. It's probably not required at all but when I added it, it fixed the problem. The user may have not closed the original file or something like that. So just a consideration. I suggest try the least and test it, then add if needed. Once you confirm, you can deploy if needed. Good Luck!
Edit: P.S. Another method that worked was mapping the path to the network locally by using mklink /d (symbolic linking in Windows 7 or newer) but mapping a network drive letter (Z: for testing) did not work. Just food for thought and I did not have to 'Unblock' any files. Also the accepted 'Solution' did not resolve the issue for me.
Moving to local folder is the quickest solution, nothing else worked for me esp because I was not admin on my system (can't edit registery etc), which is a typical case in a work environment.
Create a folder in C:\help drive, lets call it help and copy the files there and open.
Do not copy to mydocuments or anywhere else, those locations are usually on network drive in office setup and will not work.

safely editing the content of firefox jar file

i want to edit the content of browser.jar in my debian install to change the position of a button in firefox
(if you need the "why": after a crash, the restore session screen has the buttons in a way that I always press "start new session" instead of restore... i don't know why... maybe my cancel-button-blidness just makes my brain think the long-text-button on the left is the confirm-action and the short text on the right is the cancel. ...instead of fighting with my dumb brain every time, i will move the button further down the screen or plain remove it)
I've already extracted the contents with unzip and found the file I need to change content/browser/aboutSessionRestore.xhtml
the question, can I just do the changes, zip it again and i'm done? Or is there a little more info in a jar file than a zip archive?
dumb question. should have tried it right away.
this did the trick
7z a browser.jar skin/ content/
$ file browser.jar /usr/share/iceweasel/chrome/browser.jar
browser.jar: Zip archive data, at least v2.0 to extract
/usr/share/iceweasel/chrome/browser.jar: Zip archive data, at least v2.0 to extract

Resources