I need convert UTF-16 to ANSI [closed] - utf-16

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
How i can convert UTF-16 to ANSI in a .cmd file?

Your code has a UTF-16 LE byte-order-marker at the beginning of it, which an obfuscation technique developed on DosTips. Either remove it via a hex editor, or save this code as deobfuscate.bat and drag your script onto it:
#echo on &setlocal
if "%~1"=="" exit /b
if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
<"%~1" ((for /l %%N in (1 1 8) do pause)>nul&findstr "^">"%~n1___%~x1")

Related

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

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

Merging PDF files per the first part of files names - how to automate? [closed]

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 5 years ago.
Improve this question
I was able to revised a sample VBA code I found here to generate PDF files from an excel file. After this coding runs, the results is that I will have multiple PDF files with suffix "-index.pdf" - (e.g., 875458-indexl.pdf) I can change the suffix to anything.
And I will extract another set of PDF files from a zip file that have the identical file name as 875458.pdf.
At the end, in one folder, there will be multiple pairs of files as below.
875458.pdf
875458-index.pdf
875460.pdf
875460-index.pdf
954784.pdf
954784-index.pdf
My goal is to find a w
ay to merge each pair of files into one file.
The end result would be as below.
(Indexl file being the first pages)
875458.pdf
875460.pdf
954784.pdf
I downloaded PDFtk, but I don't know exactly how script works, and even though I see some samples, I just don't get it...
If someone can kindly shows me the following, I would appreciate it greatly.
1) Which programs I should have installed
2) How to name the batch or bash file, and where to save the file
3) how to trigger the script to run
Thank you.
I've found the command to merge/join two pdf files with PDFtk on this page.
setlocal enabledelayedexpansion
for %%# in (*-index.pdf) do (
set n=%%~n#
set n=!n:~,-6!
pdftk A=!n!.pdf B=%%# cat B A output C:\export\done\!n!.pdf
)
This will get every *-index.pdf and merge it with its respective *.pdf.
I found an example as below. When I execute this, I, at least get the following message. So I think I only need to tweak the script below for correct file names.
Error message when executing this batch file
File Not Found
Done. Input errors, so no output created
Where files are saved and file names
c:\merge
merge.bat (this file contains the code example below)
845499.pdf
845499-index.pdf
845502.pdf
845502-index.pdf
pdftk set up
I installed pdftk pro, and it shows when I do "PATH" in command line, and I also copied pdftk.exe in c:\merge AND c:\windows\system32
code example
#echo off
setlocal EnableDelayedExpansion
rem Initialize (delete) "lastFile" and "fileList" variables
set "lastFile="
set "fileList="
rem Next line get the output of a "dir /B" command, that show file names only
rem "for /F" command execute the dir, get the output and divide each line in two "tokens" ("%%a" and "%%b")
rem with the first part before the "" in "%%a" and the *rest* (including further "") in "%%b"
for /F "tokens=1* delims=_" %%a in ('dir /B _KM_.*') do (
rem If the base file name changed...
if "%%a" neq "!lastFile!" (
rem Process previous file list;
rem this "if" is just to avoid process the empty list the first time
if defined fileList (
pdftk !fileList! output !lastFile!.pdf
)
rem Reinitialize the new list
set "lastFile=%%a"
set "fileList=%%a_%%b"
) else (
rem Append this file to current list
set "fileList=!fileList! %%a_%%b"
)
)
rem Process the last list
pdftk !fileList! output !lastFile!.pdf

Asp.net with c# file upload from excel using sql server 08 [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Exception Details: System.Web.HttpException:
'c:/users/agaabhis/documents/visual studio
2010/Projects/WebApplication4/WebApplication4/Files/' is a physical
path, but a virtual path was expected.
Source Error:
Line 23: Line 24: //Upload and save the file Line 25:
string excelPath = Server.MapPath("c://users/agaabhis/documents/visual
studio 2010/Projects/WebApplication4/WebApplication4/Files/") +
Path.GetFileName(FileUpload1.PostedFile.FileName); Line 26:
FileUpload1.SaveAs(excelPath); Line 27:
Source File: c:\users\agaabhis\documents\visual studio 2010\Projects\WebApplication4\WebApplication4\Default.aspx.cs Line: 25
If you read the documentation for Server.MapPath on msdn, you'll find that you cannot hand it physical paths (which have a drive as a root). You need to give it paths relative to the server. For example:
string excelPath = Server.MapPath("Files/") + ...;

Show current class file [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I would like to NSLog the current class file that the simulator loads, in order to make sure the class file loaded currently. What parameter should I code?
Is it possible?
Thanks.
You can use the preprocessor directive __FILE__ to access the file path of the currently executing code. This flag is set at compile-time, but for usage in an NSLog, this shouldn't matter.
You can use it like this:
NSLog("Log called from file %s", __FILE__);
==> Log called from file /Developer Projects/Objective-C/Mac/test/test/AppDelegate.m
There are also other preprocessor variables you can use, such as __LINE__ and __PRETTY_FUNCTION__
You can define it in a preprocessor macro, and use it as such:
#define NSFileLog(format, ...) NSLog(#"%s:%d :: " format, __FILE__, __LINE__, ##__VA_ARGS__)
...
NSFileLog(#"Test Log");
==> /Developer Projects/Objective-C/Mac/test/test/AppDelegate.m:20 :: Test Log

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.