Is there an easy way to View, Edit & Locally store a .txt file through Chrome [closed] - browser

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 5 years ago.
Improve this question
This isn't necessarily a coding problem, but users here would be the perfect people to ask.
Is there an easy way to view and edit a simple text file (.txt seems the most obvious) on a browser (I use Chrome). I'd like this file to be stored locally as well, preferably in my dropbox folder so it's backed-up at all times.
I tried looking for a chrome extension that does this, but after 3 failed attempts I thought there might be a manual way to do this.
I don't care about the format as long as it's common and can be opened on other computers if need be.

Paste the following into your browser address field to get a ready browser notepad:
data:text/html, <html contenteditable>
You can type or paste your text here, edit and then save as page or copy somewhere. Suggested by Jose in his blog.

HTML5 has a File API: http://www.html5rocks.com/tutorials/file/filesystem/
Once you read that you will realize that you can use a blob builder to write to a file, then post that file back to your browser which will automatically download it.
var bb = new BlobBuilder();
bb.append(message.value);
var blob = bb.getBlob();
location.href = window.webkitURL.createObjectURL(blob);

This is an old question, but I've wanted this ability for a long time and finally found a solution that works for me. In Chrome, set up a Workspace folder as described here.
I wanted to edit a markdown file, so I created an empty file called editable.md in my workspace folder. With Chrome developer tools open, in the Sources pane, I can double click this file to edit it. Even better, I have the MarkView plugin installed, so I see a nicely rendered version of the markdown in the main view.

I think there's a reason why web browsers and text editors are called the way they are. Why would you wan't a functionallity like that? There are other tools for that.
Maybe your answer is a server which handles this kind of requests - allows information to be added, and stores it in it's own dropbox folder which is shared with other users.
The main problem is that browser can't that easily access files on your computer if those aren't cookies, tmp files.

Related

XLSX corrupt after accidental open & save in Notepad [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Is there a programmatic, built-in, or external method to recover a corrupt Excel file?
I accidentally opened my .XLSX file (Excel 2010) in Windows Notepad, added a line of recognizable text, and saved it. Now the file cannot be opened by Excel, as the internally compressed .XLSX file cannot be uncompressed.
My research showed me that:
The .XLSX file is a compressed archive, starting with PK….
By saving the file in Notepad, all Null/\0 characters were replaced with spaces (0x20).
Before the mistake happened, the file contained already several hundreds of 0x20 characters, so replacing all 0x20 with 0x00 won't help.
Any ideas are appreciated! Thanks in advance!
Wow, that sucks, bigtime.
I've seen lots of corrupt files caused lots of different ways but that's a new one.
That series of events if probably near the top of the list of "Things not to do to Excel files." We're sorry, we'll have to suspend your "Excel Operator's License".
I guess there's a couple things you could try...,
Plan A
Is there any chance you have Autorecover turned on? If not, you should probably turn them on now, for "next time".
If it is on, then hopefully the Document Recovery task pane appears when you try to open the file (in Excel). If so, see:
Office.com : Recover your Office Files
Even if your file doesn't show up in that dialog, double-check all of the folders/files located in the default AutoRecover save location to see if a recent version was saved, "just in case":
%AppData%\Microsoft\Excel
Plan B:
Since an XLSX file is actually just a .ZIP file, there's a chance you may be able to use WinZip or a ZIP Repair Utility to recover your data (depending, of course, on how badly you messed it up.)
Change the file's extension to .ZIP and open it with WinZip.
It may try to repair the file, and if it does it might even succeed (on some or all "parts").
Put all the files back into a new .ZIP.
Change the extension back to .XLS.
Cross you fingers and try opening it with Excel.
There are also lots of standalone ZIP Repair Utilities out there, so you could try a few others with the same process.
I have no idea if any will actually work in this case, but please report back if you do end up trying any of them (whether or not they fix it), so we all know.
More about Excel File Structure:
XML & ZIP: Explore Your Excel Workbooks File Structure
Plan C:
Short of that working, you could try opening it back up in Notepad and see if there's any legible data you can copy & paste out manually... might be there a while, if there's anything at all...
Plan D:
There is no Plan C. Sorry, you're SOL.
How to turn on AutoRecover (for next time):
Click File → Options → Save
Make sure the Save AutoRecover information every x minutes box is selected
Important: Even after turning AutoRecover on, the Save button is still your best friend.
To be sure you don’t lose your latest work, click Save Button
(or press Ctrl+S) often.
Oh, and in the future:
Don't open Excel files in anything but Excel.
Source & More Info:
Office.com: Use AutoSave and AutoRecover to help protect your files in case of a crash

Use custom formats in new Excel files [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 7 years ago.
Improve this question
I have a set of custom formats that I would like to use in any new Excel files that I create.
I found this approach, Save cell styles to use in all new workbooks, but it relies on using a template which I cant use as I am using a cloud server so I don't have access to the XLSTART folder.
Using code is fine if I must, but I don't have experience in this space.
I understand that I may be able to create an Excel addin to hold the formats, and create a new workbook from that. Is this addin the way to go?
Please help!
Is this a desktop Excel program? If so, you might try adding another custom startup folder. (Depending on version it might be different, in 2013: Excel Options - Advanced - General - At startup, open all files in:.) Now if you put a file here, it will auto-open on Excel startup, just like the files in the XLSTART folder.
(But to be honest, I don't see how this will help you, since XLSTART - or any automatic startup folder - is useful if you want macros available. I'm not sure about templates.)

How to download all subtitles from Opensubtitles.org in a specific language? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Excuse me if this post is not related to this forum, but I couldn't find any other place to ask my question. It would be appreciated if you introduce me a suitable place for this post.
By the way, I am trying to download all the subtitles from Opensubtitles.org in a specific language (say English) and find their translations in another language (say Arabic). I tried wget, but I couldn't download anything useful from this site. (I need .srt, .zip and .txt files)
Can everyone help me?
Bests.
Downloading everything individually will put an unnessesary load on their servers. Better use something like http://opus.lingfil.uu.se/OpenSubtitles.php
The download link is something like:
http://dl.opensubtitles.org/en/download/sub/4617044
Where 4617044 is the ID of the subtitle. You can use this URL with wget to download it, but it won't have the correct filename.
Alternatively, you can use the XML-RPC api to search and download subtitles.

How to get text into Unity? [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 4 years ago.
Improve this question
I have a basic Java program with output of "hello world". What I want to do is to write a Java script to run that program and import that into Unity so I can use it in my program in Unity.
Is there a way?
You can communicate with Unity from a Java application trough OSC(Open Sound Control) and send text, commands triggers or load an external file(xml or similar) into Unity.
Unity and Open Sound Control
http://www.sundh.com/blog/2012/07/unity-processing-demo/
On unity you have to use function OnGui() to show text.
In the related documentation you have many example.
For show message in a console just use in a javascript:
Debug.Log("Hello world");
You can also put files in your /Resources folder in your unity project, then load them at run time. These can be pretty much anything. models, prefabs, materials... could be text files (maybe comma delimited txt files, that you parse) or more typically .xml files that you can easily access and extract data (text) from.
to load any resource file, use resources.load()
http://docs.unity3d.com/Documentation/ScriptReference/Resources.Load.html
Don't use OnGui as this is bad for performance rather use Canvas to edit and place the text you prefer on or in (parent) object you want.
to make this look better put the font size higher and the width and height lower.
this will make it look sharper.

Can I embed an exe payload in a pdf, doc, ppt or any other file format? [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 7 years ago.
Improve this question
Is there any way that I can embed a .exe file in a .pdf, .doc, .xls, or .ppt file in such a way that upon opening the containing file, the document processor will run the .exe automatically without the user intentionally executing it?
Yes, this is totally possible and pretty easy to accomplish - so long as you have an active exploit in the PDF viewer. Check out one of the many Adobe Acrobat Exploits in the Metasploit framework. Next you can use a download+exec shellcode to download and execute your payload, err I mean ".exe".
You can embed files with EXE or any other format. However, the ability to have the EXE run automatically depends on the viewer application and its security settings. This PDF feature has been exploited by many malware. So, there is no guarantee that it will work on all end-user systems. Be warned that if you make this feature a part of some commercial application, then security software will soon flag it as a malware, which can adversly affect your company's reputation.
Yes. Besides using an exploit, you can just paste the file in using Acrobat Professional. Acrobat allows you to add arbitrary attachments these days.
If you make your PDF files with pdflatex, you can embed any file using the embedfile package. I use this frequently to add all kinds of files to PDF files. They show up as attachments.
\usepackage{embedfile}
\embedfile{my-wonderful-file.exe}
You can also use the Acrobat GUI to do it.
In short, no. These file formats have no provision for embedding a Win32 PE executable inside of them.
For the Office files, you could use VBA to write a script that runs when the document is opened.

Resources