Is it safe to use a UUID as the name for a Node Webkit package? - manifest

According to the Node-Webkit wiki the manifest for a program requires a name and this name must be globally unique because it determines the name of the directory that data files for the program are stored in.
I haven't been able to find anything else that this name is used for. Is it safe to just use a UUID as the name listed in the manifest? Or will that be exposed to the user somewhere potentially?

It's more typically related to the common program name that the user sees, but it doesn't have to be. For example on the Mac, the standard location for app specific data is ~/Library/Application Support/. When I look there I see things like GIMP, Skype, XDK &c. If your app happened to have the same name as another app, it would cause problems as they'd both writing to the same location, i.e. if I gave my app the name GIMP, both apps would try to write files to that dir.
Typically a user doesn't have to access this directly, so there's probably no harm in using a UUID here, though I would probably append it to a name related to my app name, just for clarity/simplicity, i.e. instead of making the name foo I'd make it foo-<UUID>.
But I'm no expert . . . .

Related

What does nltk.download("wordnet") accomplish

I wanted to know what nltk.download() do. Also, if I add "wordnet" as an argument, then what happens. Is wordnet like some dataset or something, I would like more clarification on that.
The argument to nltk.download() is not a file or module, but a resource id that maps to a corpus, machine-learning model or other resource (or collection of resources) to be installed in your NLTK_DATA area. You can see a list of the available resources, and their IDs, at http://www.nltk.org/nltk_data/ .
You can use the special id "book" (as in nltk.download("book")) to download all resources mentioned in the nltk book; that's handy if you don't want to keep stopping your explorations to download missing resources.
Calling nltk.dowload() without an argument pops up an interactive browser window (if it can) that you can use to browse and select resources for download.

Mimetype vs AppID

You see that it is adivsed to create your file with your app-specific mime type. Is it right way? I wonder because google drive somehow associates files with the application that created them for Open with functionality. Can this be exploited for the file picker?
FYI-- You mentioned your project ID being alpine-dogfish-833. If you login to the developer console, then click on your project (which takes you to the project "Overview" page), you will see 2 identifiers at the top: Project ID: alpine-dogfish-833 and Project Number: 1088706429537. "Project Number" == "App ID" == "the numeric prefix on the Client ID"
If the file has custom contents that only your app can understand, use the app specific mime type. Otherwise, use the standard mime type for whatever kind of file you are working with.
I have finally discovered that when your app (identified with CLIENT_ID) creates a file with mime-type application/vnd.google-apps.drive-sdk, the mime-type is expanded with .<AppID>. The AppID is the first part of your CLIENT_ID. Basically, project ID looked like alpine-dogfish-833 in mine case. I have then generated Client_ID 1088706429537-4oqhqr7o826ditbok23sll1rund1jim1.apps.googleusercontent.com and 1088706429537 is the AppID that we are looking for because when my app creates a file, using
gapi.client.drive.files.insert({
'resource': {
mimeType: application/vnd.google-apps.drive-sdk,
title: file_name
}
Note mime-type is application/vnd.google-apps.drive-sdk -- it does not contain any app ID. Querying the file reveals that the effective mime type of resulting file is actually application/vnd.google-apps.drive-sdk.1088706429537. Google can even fix the mime type even if you misspel application/vnd.google-apps.drive-sdk a bit.
This answers my question because eliminates all the confusions. The major confusion is that your project has additional application id, that you get even before the CLIENT-ID but it has nothing to do with signing the files with app-specific mime-type. I did not find that in the referred q&a. Secondly, this answers my question because it basically says that mime-type contains APP_ID so that app id and mime-type is therefore the same thing and there is no difference/redundancy/conflict to choose between two.

TCL/TK - Get Desktop path

My TCL/TK application prompts the user to choose a location where to save a file.
What should the value of the -initialdir option be so that the Desktop is the default location?
I tried %userprofile%\desktop, but it's not working.
set dir [tk_chooseDirectory -title "Where do you want to save the config file?" -initialdir %userprofile%\desktop]
Thanks
The safest way is to use twapi's get_shell_folder command with the argument "csidl_common_desktopdirectory" to get the path to the "all users" desktop directory, or "csidl_desktopdirectory" to get the current user's desktop.
If you don't want to depend on twapi, the paths can be found in the registry, but I don't know how reliable it is. For example:
package require registry
puts [registry get "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders" "Desktop"]
This returns "%USERPROFILE%\Skrivbord" on my system. You still have to expand the USERPROFILE variable (and any other variables). That's best done with twapi::expand_environment_strings, but since you're not using twapi, try regsub:ing %USERPROFILE% with $env(HOME) instead.
Or if you don't care about people with non-english Windows, just use "~/Desktop".

Can I add some public meta data to an encrypted Access 2010 database?

My application stores its data in an Access 2010 database (accdb) file. It's password protected, which means it's encrypted w/ AES-128.
I'd like to add some meta data to the file that's publically available. This way older verisons of my application can investigate the file to see if it's even worth trying to open. Otherwise, they'll just get the dreaded "Unrecognized Database Format" error, which is usually associated with file corruptions.
In Windows, you can right-click on a file, click "Properties" and see attributes under the Details tab. I'd love it if I add attributes like the version of my application that last touched the file, and maybe other details. I'd like to avoid having a different file extension for each version of my app!
Is it possible to add some public meta data to an encrypted Access 2010 database?
You can add custom database properties : http://support.microsoft.com/default.aspx?scid=kb;en-us;q178745
You can change the file extension of an encrypted Access database and change the properties for that extension. The extension .enc is fairly descriptive and does not seem to be widely used.
The file will open normally when clicked and ask for the password. The icon will be recognizably Access and the description, "Encrypted MS Access" in this case, will appear under Type in a directory listing.
With NTFS, you can add an alternate data stream (ADS):
notepad.exe z:\docs\testde.enc:Extra.txt
Reading the stream:
more < testde.enc:extra.txt
More information: http://www.think-techie.com/2010/04/alternate-data-streams.html
http://www.irongeek.com/i.php?page=security/altds
This is a tough nut to crack! An application must read information about the ACCDB, but that information can't be stored in the ACCDB because you want the read without opening the ACCDB. And you can't use the suggested file system methods because this must work under Wine on Mac (I assume from another of your questions).
The only solution I can see is to create a companion file (with same base name but different extension) to hold the metadata. So if your application wants to know about SomeDb.accdb, it would look for a file named SomeDb.metadata and read that instead.
I suggested a kludge for your earlier question ... unfortunately this is another. :-) However, it's a simple kludge and it should work ... even on Mac.

Sourcegear Vault: How do I get an automated list of checked out files?

Question:
How can I get a list of all checked out files per user in Sourcegear Vault?
Use of this functionality:
From time to time we have developers leaving files checked out and although this results in drastic punishment (they owe a coffee to the person who needed the checked out file) we are still left with files checked out and work held up.
We would like to display a list of all current number of files checked out by each developer. This way they can check if they have anything checked out before they go home or out the office.
In the Vault Client app, use the Search tab at the bottom of the window.
Select Search By: "Checked Out By" to see a list of all files checked out by a specific user, or by any user.
You can choose to search a specific sub-folder, or from the root, recursively or not.
To automate this, use the Vault Command-Line client (vault.exe)
vault -host myhost.mydomain -user something -password something -repository myrepo listcheckouts
Will give you a list, in XML, of all checked-out files and their users. You can transform the results, or use the command-line client's source code (provided as an example with the Vault .NET API) as a starting point to write your own version.
The various clients and APIs can be grabbed from http://sourcegear.com/vault/downloads.html - didn't want to link to a specific version that would be outdated after the next release.