Numpy cannot save with certain name(s) [duplicate] - numpy

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Why in Windows, can't you name a folder 'con'?
Whenever I try to name a folder as "con" (without the quotes) it defaults to its original name.
Why does it do this?

Back in the MS-DOS days, "con" had a special meaning. It referred to the console, and allowed you to treat it like any other file. For example, you might create a new text file by typing copy con new.txt. Then you could enter your text and hit ^Z when finished.
The thing is, you can still do that. Therefore, as far as the file system is concerned there is already an object out there named con. There are other reserved names as well, but I see that while typing this those names have been provided already in other answers.

Do not use the following reserved device names for the name of a file:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9
Source: MSDN
Other names, such as drive names, cannot be used as well:
CLOCK$, A:-Z:
Source: Microsoft support

Actually you can rename the folder to con
use this in the command prompt and this creates a system folder named con on your C: Drive
md \\\\\.\\\C:\con
to remove this folder you need to use this in the command prompt
rd/s \\\\.\\\C:\con
And just for those that are wondering "so why would you?" - my name is CON and if I wish to use that as my folder I WILL so "bugger you MS"
Con "OzDing"

This dates back to MS-DOS. Reading or writing to a file named "CON:" read/wrote from the console. I imagine Windows is still supporting this for backwards compatibility.

From Microsoft TechNet:
Several special file names are reserved by the system and cannot be used for files or folders:
CON, AUX, COM1, COM2, COM3, COM4,
LPT1, LPT2, LPT3, PRN, NUL

Related

How to split sql in MAC OSX?

Is there any app for mac to split sql files or even script?
I have a large files which i have to upload it to hosting that doesn't support files over 8 MB.
*I don't have SSH access
You can use this : http://www.ozerov.de/bigdump/
Or
Use this command to split the sql file
split -l 5000 ./path/to/mysqldump.sql ./mysqldump/dbpart-
The split command takes a file and breaks it into multiple files. The -l 5000 part tells it to split the file every five thousand lines. The next bit is the path to your file, and the next part is the path you want to save the output to. Files will be saved as whatever filename you specify (e.g. “dbpart-”) with an alphabetical letter combination appended.
Now you should be able to import your files one at a time through phpMyAdmin without issue.
More info http://www.webmaster-source.com/2011/09/26/how-to-import-a-very-large-sql-dump-with-phpmyadmin/
This tool should do the trick: MySQLDumpSplitter
It's free and open source.
Unlike the accepted answer to this question, this app will always keep extended inserts intact so the precise form of your query doesn't matter; the resulting files will always have valid SQL syntax.
Full disclosure: I am a share holder of the company that hosts this program.
The UploadDir feature in phpMyAdmin could help you, if you have FTP access and can modify your phpMyAdmin's configuration (or are allowed to install your own instance of phpMyAdmin).
http://docs.phpmyadmin.net/en/latest/config.html?highlight=uploaddir#cfg_UploadDir
You can split into working SQL statements with:
csplit -s -f db-part db.sql "/^# Dump of table/" "{99}"
Which makes up to 99 files named 'db-part[n]' from db.sql
You can use "CREATE TABLE" or "INSERT INTO" instead of "# Dump of ..."
Also: Avoid installing any programs or uploading your data into any online service. You don't know what will be done with your information!

Rename a file at runtime with vb.net

i try to rename a file using vb.net in this way:
my.computer.filesyste.rename(oldname,newname)
But if i use a software to recover files deleted, i find a file named :"_ldname", and if i recovery the file "_ldname" i have, in this way, two files equals.
Can i do this without have a duplicate of my file?
Best regards
Sebastiano
You cannot, this is a windows filesystem limitation and nothing to do with programming. Two files cannot have the same name in the same location.
The recovery software should be forcing a rename to Myfile(1).txt or something like that to distinguish between the two files.
You could always use:
If File.Exists(path) = False Then
To make sure the file doesn't already exists. Then if it does exist you could add a "(1)" to the file name.

How to import dbpedia into neo4j? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I need to import dbpedia into neo4j.
I download the dbpedia from here: http://wiki.dbpedia.org/Downloads37
Any idea?
I am currently doing the same thing. I found that the biggest problem for this is the indexing so the best solution is to write a java program that extracts the statements with md5 hashes into a triple file like follows:
subjectHash \t predicateHash \t objectHash \t subject \t predicate \t object \n.
In another file you will need to store the nodes (aka subjects and objects of statements):
nodeHash \t nodeValue
The code for this procedure can be downloaded from my github:
https://github.com/eschleining/DbPediaImport.git
Compile it with mvn package and it creates a jar file in target that takes the gzipped dbpedia files as arguments. If you only have the bz2 files you can transform them like follows:
for i in *.bz2 ; do bzcat "$i" | gzip > "${i%.bz2}.gz"; done &
Now run:
java -jar ConcurrentDataTableWriter-0.0.1-SNAPSHOT.jar yourdbpediaFolder/*.gz
Then you sort the newly created files manually with the sort utility of linux:
gunzip -c nodes.gz | sort -k2 -u | gzip > nodes_unique.gz
And the triples file:
gunzip -c triples.gz | sort -k1,3,2 -u | gzip > triples_unique.gz
Now you can compile the batch inserter of my repo with maven3 (mvn package) and run it in the same directory as the nodes_unique.gz and triples_unique.gz files it creates a Neo4J database directory named "DbpediaNe04J" (mind the typo "0 instead of o).
I found this to be the fastest way since it only looks up an index once for each subject/object pair in a triple.
Feel free to add datatype nodes as properties and so on. I currently have implemented each triple as a relationship between two nodes.

Automatically locating a file

By default AutoCAD installs a text based file called acad2010.lsp at the set location below
Dim FILE_NAME As String = "C:\Program Files\AutoCAD 2010\Support\acad2010.lsp"
However it my be that the user/ administrator/ or third party has changed the location of this file. Is it possible to then locate it using the following
Dim FILE_NAME As String = "C:\*\acad2010.lsp"
In other words search the entire c:\ drive for file acad2010.lsp?
If this doesn't work can you please let me know what would?
You could search for it with an FSO. It's not going to be fast however you do it but this is the fastest way I can think of.
http://www.microbion.co.uk/developers/fso.htm should give you a rough idea of how it's done.
Your solution will not work. Is not possible to locate it using *. (BTW is possible in ms-builds scripts). The only way of doing it is:
1- Create a FindFile function (check for example
http://xlvba.3.forumer.com/index.php?showtopic=125)
2- Use it to locate the exact path of the file. (It could be really time
consuming)
3- From this point your code is the same...
Unfortunately, you can't use wildcards in a filepath. You have two options:
Prompt the user for the file location using the "Open File" dialog. The code to do this varies based on which Office product you are using. In Excel, you would use the Application.FindFile method (more info here).
Write your own function to search the filesystem for the file. Microsoft provides an example here.
If that file is used by internal functions of the application, the installer will have recorded a registry key for the file's location.
Open regedit.exe and search for the file name and path.
You can read a registry entry using this VBA one-liner:
CreateObject("WScript.Shell").RegRead(strRegPath)
You may need a terminating backslash on the key address, but that's a safe and simple registry access method. More details on the MSDN site:
https://msdn.microsoft.com/en-us/library/x05fawxd%28v=vs.84%29.aspx

Short file name question?

Im trying to add some short file names to a Wise installer to fix validation errors, which is simple for the most part. However if I have the following two files:
LongFile1.dll
LongFile1.EN.dll
Should these be:
LongFi~1.dll and
LongFi~2.dll ? Or do I have to do anything special becuase of the .EN.dll?
Yes, they are named LONGFI~1.DLL and LONGFI~2.DLL (all letters capitalized in 8.3 file format). Which is which is determined by the order they are created.
In a cmd window you can type dir /x to view the short file names as well.