EEGLAB failing to export .edf files - export

I am trying to export a .set file to an .edf through EEGLAB but the files aren't saving as .edf files, rather, they're just saving as regular files. Does anyone know another way to export files from eeglab other than through the GUI?

maybe this will work
pop_writeeeg(EEG, 'filepath_and_filename', 'TYPE','EDF');

Related

Where are anki deck files stored

Once I import a file, and I corrupt it (having anki synchronisation turned off) the deck is still fully functional. So where is a copy of the imported file stored? What folder in macos or windows?
As explained in the relevant section of the manual, all Anki's files are stored at the following places:
Windows: %APPDATA\Anki2
MacOS: ~/Library/ApplicationSupport/Anki2
However, there are some gotchas. If you need more details, see the link.
Besides that, beware that decks are not stored as individual files: the whole Anki collection is a single database, so you can't copy decks around. However, you can still export decks from within Anki.

Having trouble with package.d

I am having trouble with D's package.d feature. I have my package.d file:
module dew;
public
import dew.util;
I then have util.d:
module dew.util;
struct Size
{
int width;
int height;
}
When I try to use it in another project, it gives me this error:
I know that this should work, because projects on GitHub use it, specifically bindbc-sdl.
Your code is correct. By the error message I'm assuming your project layout with DUB probably looks something like this:
dew/
dub.sdl/dub.json
source/
package.d
util.d
However this would be incorrect. By default DUB only uses import folders instead of specifying all input source files, so the compiler attempts to discover the files from the import paths in the filesystem. The compiler dumped the import paths it searches in in your error screenshot.
The rough compiler equivalent to what it's doing right now is (see dub -v)
dmd source/app.d -Isource -I../dew/source
You need to imagine that the path whatever is written in there is invisible to the compiler, so the dew/source/ path is just some opaque string the compiler doesn't interpret. Now all that the compiler sees is a package.d and util.d in its search paths. However for imports from folders to function, they need to correspond to the filesystem layout, i.e. you need to have a folder named dew where your files are stored in.
So a module named dew.util would correspond to dew/util.d
And your package dew would correspond to dew/package.d
So for your dub project that means essentially that you need to move all your source files into
dew/
dub.sdl/dub.json
source/
dew/
package.d
util.d
Alternatively it would be possible to manually specify all files one-by-one where the compiler can look them up because of the module declarations at the top of the file, however you lose the convenience of module names being mapped to filesystem paths, which might be something other community-made D source tools and IDEs are expecting. On the command line that would be equivalent to
dmd source/app.d ../dew/source/dew/package.d ../dew/source/dew/util.d

How to specify a directory for scons to store all the .o(intermediate) files?

How to specify a directory for scons to store all the .o(intermediate) files?
My question is: what's the way to set something like a global flag, so that each 'Object' command will generate .o files in a solid directory, and 'Program' command will generate in some other directory? I don't wish to have some variables so that each 'Object' and 'Program' command will explicitly use this variable: it's ugly and coupled. I just wish to have something like a compile hook.
For example, I've got a testSystem.cpp, and in SConstruct I have:
Program('testSystem.cpp')
Then scons will first compile a testSystem.o file, and link to a testSystem executible.
I know I can explicitly specify where where the binary file is stored:
Program('bin/testSystem','testSystem.cpp')
Well, the object file is still under current directory. I can do this:
testSystem_obj=Object('obj/testSystem.o','testSystem.cpp')
Program('bin/testSystem',testSystem_obj)
Now I have .o under ./obj and executible under ./bin. No problem.
But, this means for each file, I've to manually write 2 lines, 1 line to tell scons to generate the object file under ./obj, another line to generate the file under ./bin. If I wish to reorganize my whole project, I've to modify all my SConstruct/SConscript files. I've got a big project and don't want to do this.
Any hints? How to do this with scons?
Sort of.
SCons supports VariantDir's which allow separating the source from the build product.
Take a look at:
http://scons.org/doc/production/HTML/scons-user/ch15.html

How to find the "current" source file in Python 3?

What's the simplest way to find the path to the file in which I am "executing" some code? By this, I mean that if I have a file foo.py that contains:
print(here())
I would like to see /some/path/foo.py (I realise that in practice what file is "being executed" is complicated, but I think the above is well defined - a source file that contains some function that, when executed, gives the path to said file).
I have needed this in the past to make tests (that require some external file) self-contained, and I am currently wondering if it would be a useful way to locate some support files needed by a program. But I have never found a good way of doing this. The inspect module sounds like it should work, but you seem to need a class or function that is defined in that module.
In particular, the module instances contain __file__ attributes, but I can't see how to get the "current" module. Objects have a __module__ attribute, but that's the module name, not a module instance.
I guess one way is to throw and catch an exception and inspect the contents, but that seems like hard work. Surely there is a simple, easy way that I have missed?
To get the absolute path of the current file:
import os
os.path.abspath(__file__)
To get content of external file distributed with your package you could use pkg_util.get_data()(stdlib) or pkg_resources.resouce_string() (setuptools) to support execution from zip-archives or standalone executables created by py2exe, PyInstaller or similar, example.

.obj to .cpp converter?

Is there any .obj to .cpp converter?
Is it possible to do it?
MICROSOFT VISUAL STUDIO auto-magically deleted my code files when pressed the F5 key.
Please help me.
I have the .obj files (VS forgot to delete them.ha ha ha).
Unfortunately it is impossible to decompile an .obj file back to source. More info here.
shut down your computer, boot from removable media, some sort of the UNIX, and run strings utility on your hard drive. It may be able to recover text off your source code.
As everyone has pointed out, this is impossible.
I would suggest that before you rebuild all those files, you take the time to look into SVN or another version control system.
Version Control allows you to save copies of your files to a safe place. If the compiler eats your homework, you can update with the last copy you saved to the repository.
You should try Recuva
You are out of luck. There is no safe way to reverse an obj file back to its cpp source.
I do not think that is actually possible. You'd be reversing the compilation process, which from my knowledge is not possible.
NO, it's not possible. obj files contain object code, not source code. The compilation process is typically not reversible.
PS: Visual Studio did surely not delete your code files when you pressed F5. They are somewhere, or you've deleted them accidentially.
It is impossible to do that...as all the code's comments and variables are translated into a machine code, you cannot deterministically reproduce a variable name by gleaning in on assembler byte code, Consider this as an example of a mock dump of a binary image:
0x55 0x90 0x33 0xf0 ....
Now, how can you tell that's variable foobar that is of type int....
Hope this helps,
Best regards,
Tom.
As said earlier, it is impossible to get the C source code from on obj. As an alternative, you can try a file recovery utility and scan your disk for lost files. I have previously used testdisk with partial success.
Also, you really need to use some form of SCM!
.obj files are text files for a 3d model I was actually looking for something to bring them into C++ to display using OpenGL. there are programs out there to load them into C++ I was looking for one to download when I came across this.
en.wikipedia.org/wiki/Obj

Resources