From many sites and books, I could see
ds = datasets.CIFAR10(root="../data/CIFAR_10" ...)
My question is how can we figure out appropriate "root" for different datasets provided by pytorch?
I downloaded the tar.gz from www.cs.toronto.edu to see the inside, but the file didn't have the images in intuitive way.
Can anyone help?
Related
Situation:
I want to train and simple configure the retrieve and rank service.
I just uploaded some PDFs and now I want to upload some questions.
In the documentation I do not find a simple information how the csv file must be structured and which are the must fields and which are not must files.
Something like: "[YOUR QUESTION (MUST)]",[DOCUMENT ID (MUST)], [RANKING (OPTIONAL)]
The document ID you will find in xyz in section xyz.
Inside the help I can not find such kind of help.
https://www.ibm.com/watson/developercloud/doc/retrieve-rank/training_data.shtml#script
Impact:
There is no chance to get a "real" documentation of the configuration outside the tutorial.
Possible Solution:
Provide additional documenation.
Maybe I was not able to find it and someone can guide me to the right place?
Ok, I found the solution for me, by try and error. Following steps do work for me:
1) You need a plain text file and the ending should be *.txt
2) Inside the file you have to write your questions like this:
What is the best place to be?
Why should I travel to the USA?
-> Don't do it like
"What is the best place to be?"
For me the help was missleading, because saying something about CSV files.
You can take a look also in the comment of #dalelane he is right, and highlight the entry text for the upload of the file.
please don't kill me if this question is listed anywhere else, i really searched high and low to find answer to this question.
i am working on a project in which i need to plot data on Mumbai city map section wise or area wise but i am not able to get Shapefile for the same. can anyone please provide me the link where i can get this Shapefile? or guide me on creating one using QGIS??.I mentioned QGIS because i know a little about OGIS and hence it will save time.Also i tried certain links which are listed below. but i couldn't find what i need.Guys it would be a great help because i really need this and i am stuck on this from few days.Also i mentioned shapefile because these are easy to manipulate, later i will convert it into geoJSON and work on it so if geoJSON files are there then it would also help.
Note: only the important links are listed:
1. http://monsoon.mcgm.gov.in:8080/RESTFulWS/WardMaps.html0
2.http://www.naturalearthdata.com/downloads/10m-cultural-vectors/
thanks.
I am using the Drupal 7 Migrate module to create a series of nodes from JPG and EPS files. I can get them to import just fine. But I notice that when I am done importing them if I look at the nodes it creates, none of the attached filefield and thumbnail files contain filename information.
Upon inspecting the file_managed table I see that both the filename and filemime fields are empty for ONLY the files that I attached via the migrate module. This also creates an issue with downloading the files.
Now I think the problem has to do with the fact that I am using "file_link" instead of "file_copy" as the file operation I specify. The problem is I am importing around 2TB (thats Terabytes) of image files. We had to put in a special request with Rackspace just to get access to that much disk space on our server. So I can't go around copying from one directory to the next because of space issues. So "file_link" seems like the obvious choice.
Now you probably want to see how I am doing this exactly, so here is the code snippet:
$jpg_arguments = MigrateFileFieldHandler::arguments(NULL,
'file_link', FILE_EXISTS_RENAME, 'en', array('source_field' => 'jpg_name'),
array('source_field' => 'jpg_filename'), array('source_field' => 'jpg_filename'));
$this->addFieldMapping('field_image', 'jpg_uri')
->arguments($jpg_arguments);
As you can see I am specifying no base path (just like the beer.inc example file does). I have set file_link, the language, and the source fields for the description, title, and alt.
It is able to generate thumbnails from the JPGs. But still missing those columns of data in the db table. I traced through the functions the best I could but I don't see what is causing this. I tried running the uri in the table through the functions that generate the filename and the filemime and they output just fine. It is like something is removing just those segments of data.
Does anyone have any idea what this could be? I am using the Drupal 7 Migrate module version 2.2. It is running on Drupal 7.8.
Thanks,
Patrick
Ok, so I have found the answer to yet another question of mine. This is actually an issue with the migrate module itself. The issue is documented here. I will be repealing this bounty (as soon as I figure out how).
I currently am loading all images in a folder in my "MyPictures" folder on my machine which works fine...
foreach (string filename in Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)))
What I really want to be able to do, though, is load all the images in my Images folder within my solution project. Can someone please tell me the correct syntax to do this?
[Nothing in your question (as it is currently stated) is really directly related to WPF as opposed to C# (and Windows development) in general, as far as I can tell. You might get a better reply if the question was tagged to C# as opposed to just WPF.]
I don't think there is a way to reference your solution's folder as such (nor does it really make much sense, as the users of your application won't in general have the solution, only the distributables).
If you need the directory to be within your solution folder somehow, maybe you should refer to the directory your executable resides in (...\SolutionDir\bin\Debug), which you can get using
System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly()
.GetModules()[0].FullyQualifiedName);
(Of course, you could tack \..\.. to that to refer to the SolutionDir instead, but that'd be a bit ugly.)
Depending on the usage of the images, though, it'd probably be better to put them under one of the defined special directories -- Environment.SpecialFolder.CommonApplicationData sounds like the best candidate, if the images are to be shared by all users.
One way to access images stored in a folder inside the WPF project is to do the following:
If you have already added the images inside an Images folder, Add the images file names in the Resources.resx file under Properties. You can access the images in the code by the following
string imageFilename = "pack://application:,,,/APP.UI;component/Images/" + Properties.Resources.imagefilename;
var src = new BitmapImage();
src.UriSource = new Uri(imageFilename , UriKind.Absolute);
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there a resource that lists ALL the mimeTypes in existence?
I have found a few places with under 1000 mimeTypes, but then they still don't include common ones like .rar, .fla, .rb, .docx!
Does anyone have a COMPLETE list of mimetypes? Not down to the most obsure "company-only" ones, but at least all of the ones we might use.
Also, I'm looking for a list that maps file extensions to mimeTypes.
http://www.iana.org/assignments/media-types/ lists the "official" mime-types, but it doesn't prevent anyone making their own an not registering it with IANA.
Here's the most up-to-date mime.types maintained by the Apache HTTPD community:
http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/conf/mime.types?view=annotate
IANA lists the official ones. A list which includes file extensions which I find useful is the one included as /etc/mime.types in Debian & Ubuntu.
The Apache web server project also maintains a list.
I collected MIME types and file extensions from many sites and lists, and here's the result: https://s-randomfiles.s3.amazonaws.com/mime/allMimeTypes.txt
I also created a JSON file: https://s-randomfiles.s3.amazonaws.com/mime/allMimeTypes.json
Please tell me if something is missing or incorrect
iana is tracking the official ones but of course folks can always declare their own...
In other words, it is doubtful you'll ever get the full list on the Planet.
Also consider the case of NPAPI plugins which declare MIME-types just to be be easily accessible... and these MIME-types might be not interesting to you for a reason or another.
If your are using Java you could use Apache Tika, which is a powerful library for dealing with file types. With it you can easily get the preferred extension related to a mime type with a couple of rows:
TikaConfig config = TikaConfig.getDefaultConfig();
MimeType mimeType = config.getMimeRepository().forName("image/png"); //Generally your textual mime type
String extension = mimeType.getExtension();
// this would return the extension with the dot. For "image/png" returns ".png"
In this way you don't have to mess with downloading and parsing a file with the associations, I find it very comfortable. This is the way I've done the trick.
There is a good Mime Type Table you can find on https://drive.google.com/open?id=0By00BwrZ8886VUg3ak9faG5mTU0
Which is updated 27-02-2017.
I am sure that meet your all needful mime type.
There's a good table in the classic book "HTTP: The Definitive Guide" by Gourley and Totty (O'Reilly, with a squirrel on the cover) in Appendix D. It appears to be complete and up-to-date as of the time the book was written (in 2002). That was a long time ago, but you'll find all the old favorites there as well as obscure "company-only" ones.
ISBN 1-56592-509-2, http://oreilly.com/catalog/9781565925090/
Here is a full list that is easy on the eyes:
http://www.webmaster-toolkit.com/mime-types.shtml
User Paul Tarjan said in a comment:
There is a pretty good list on stdicon.com : stdicon.com/mimetypes
This website is no longer available, but the most recent archive is https://web.archive.org/web/20161015175648/http://www.stdicon.com/mimetypes
Note that this site doesn't mention "application/x-zip-compressed" (and it's not because of the escaping of slashes either) so it's not perfect.
I took the list from Apache mime.types as of Fri Sep 29 15:10:29 2017 UTC and wrote a script to convert it to a json mapping. The json is too big for stackoverflow answer. You can find it here mimes.json.
script to generate the mapping:
# mime_to_json.py
# get the mime.types from
# http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types?view=markup
import sys
import re
import json
mapping = {}
with open(sys.argv[1], "r") as handle:
for line in handle:
line = line.strip()
if line[0] == "#":
continue
parts = re.split("\s+", line)
mime = parts[0]
del parts[0]
for ext in parts:
mapping[ext] = mime
print(json.dumps(mapping, indent=4, sort_keys=True))