FAQ Database Discussion Community


Where do I find (and run) an executable compiled with a cabal sandbox?

haskell,testing,compilation,executable,cabal
I'm compiling my myProgram.lhs with the use of a cabal sandbox (set up with cabal sandbox init). I'm using a simplest approach I've come up with: cabal exec -- ghc myProgram or (having a rule in Makefile) cabal exec -- make myProgram After that, in my source directory, appears myProgram.o,...

Make a SQLite3 command file executable

osx,sqlite3,executable,shebang
I have a file of SQLite3 commands. For example, .print "This is running in SQLite3!" I want the behavior of sqlite3 < commands.sql when I run the following on OSX: ./commands.sql Here's my current solution: #!/usr/bin/env sqlite3 -init .print "This is running in SQLite3!" This works, but it spits up...

Whether program is executed from command line or invoked through system call

linux,command-line,executable,invoke,system-calls
Platform is linux and the c code is compiled in gcc. Is it possible to know from inside the code of program whether its executable has been executed directly from command line or invoked through "system" call ? e.g test.exe can be directly run on command line as ./test.exe or...

Do executable files always open a terminal window on MacOS?

osx,terminal,executable,app-bundle
I'm on MacOS X, and I'm pretty new to app-bundle-type things. I am writing a program that opens a window and registers mouse input -- not a command line tool. When I compile my code (written in C, if that is important) into an executable file (a "unix executable file")...

C write file as executable ASCII

c,linux,executable
I'm making some program with a server sending a shell script to a client. the client gets the code and puts it in a file, and later exec it. The adding function : void addScript(char *name,char *content){ int fd; char path[BUFSIZ]; strcpy(path,"scripts/"); strcat(path,name); strcat(path,".sh"); printf("file : %s\n",path); fd = open(path,O_WRONLY|O_CREAT|O_TRUNC,S_IRWXU|S_IRGRP);...

passing variables from bash to executable (which reads argument with stdin)

bash,variables,executable,stdin
I have the following test.cpp c++ program #include <stdio.h> #include <stdlib.h> #include <iostream> using namespace std; int main() { float a,b,c; cout<<"Give 1st number"; cin>>a; cout<<"Give 2nd number:"; cin>>b; c=a+b; cout<<"\n"<<a<<"+"<<b<<"="<<c<<endl; return 0; } and I want to create a shell script which gives the input variables. I know how...

AVBin in cxfreeze

python,executable,cx-freeze,pyglet
I'm having a bit of trouble in Python 3 lately. i have a program that uses Pyglet and AVBin to play sound into my game. It's one of my socket tests, so I want to test the game with someone that doesn't even own python. I used to use cx_Freeze...

Why isn't the distinction between CPUs more ubiquitous?

cpu,executable,machine-code
I know that every program one writes has to eventually boil down to machine code - that's what compilers produce, that's what executable files consist of, and that's the only language that processors understand. I also know that different processors may have different instruction sets (I know 65c816 assembly, and...

How can I exclude source file metadata from output when compiling?

gcc,compilation,metadata,executable,binaryfiles
For example: $ gcc -O3 foobar.c -o foobar $ grep 'foobar\.c' foobar Binary file foobar matches How can I exclude such unnecessary and revealing metadata from the output of gcc and other compilers? It appears regardless of whether the output is an assembly file, object file, or executable....

Run compiled python .exe with a file as input

python,input,executable
So I made a program in Python and compiled it to .exe. This works fine. What I want is to be able to double click files I created (say with text in them) and open those files with the .exe I compiled and then do something with the files as...

Converting a Shell Script Into a *.app File

osx,shell,scripting,executable,desktop
Using Automator.app and Platypus.app, I have been able to bundle a simple shell script I created to power cycle wi-fi on my MacBook Pro. Both resulting apps run properly, but have one glaring issue that I want to correct: The apps reference the shell script from outside of the program....

Frozen Bokeh application too large

python,executable,cx-freeze,bokeh
I have created a Bokeh application based largely on this recipe: http://bokeh.pydata.org/en/latest/docs/gallery/unemployment.html This works great but I need to to be able to distribute this application to my team, most of whom don't have python, let alone bokeh installed. I tried building this into an executable using cx_freeze but the...

Relative paths from binary file

c,linux,executable
I have the following folder structure: bin/ <-binary-file is in here include/ src/ data/ Makefile In my code, I use relative paths to my data. So "../data/xml/xmlFile.xml". This is fine if I were executing the binary file from the bin/ folder: brando[email protected]:~/PATH-TO-PROJECT/bin$ ./binary-file argv[0] = ./binary-file dirname(argv[0]) = . But...

SBCL: Deploying Hunchentoot application as executable

common-lisp,executable,sbcl,hunchentoot
Dear StackOverflow community, I started playing with SBCL Common Lisp and want to develop a small web application using Hunchentoot. For easy deployment I planned to save everything in a binary using sb-ext:save-lisp-and-die as I can live with the big output size. For the executable you need to supply a...

how to configure eclipse(pydev) to run with external executable

python,eclipse,configuration,executable,pydev
I have a test framework where all my tests have to be kicked off using a particular executable(say M). All my tests are written in python(I have eclipse configured with pydev) . Currently I run my tests are run thru cmdline like: $ M -test <test_file_name>.<testcase_name> How do I configure...

What is the equivalent to “svn propget svn:executable” in git?

git,svn,executable
We want to move our version control from svn to git. Everything was quite easy, except one small part. In our release process we have a smoke test to ensure, that any shell script has its executable flag set on disk and in the repository as well. In svn this...

How to create a Linux executable file using python code

python,linux,ubuntu,tkinter,executable
For an example I have created welcomeGUI.py file with has a simple GUI as follows using Tkinter. from Tkinter import * import ttk class Application(): def __init__(self, master): frame = Create_widgets(master) frame.pack() class Create_widgets(Frame): def __init__(self, master): Frame.__init__(self, master) self.toplabel = Label(master, text="Welcome!", font=('cambria', 20, 'bold'), fg="white", bg="Midnight Blue") self.toplabel.pack(fill=X,...

which is pelican executable script that user executes from shell?

python,executable,pelican
I am trying to call pelican via subprocess for automated blog posting, however when I tried which pelican in shell and opened it. I found this #!/usr/bin/python # EASY-INSTALL-ENTRY-SCRIPT: 'pelican==3.5.0','console_scripts','pelican' __requires__ = 'pelican==3.5.0' import sys from pkg_resources import load_entry_point sys.exit( load_entry_point('pelican==3.5.0', 'console_scripts', 'pelican')() ) while I was expecting to see...

Profiling compiled code without source code?

assembly,profiling,executable,opcode
I'm working with an application that has a SDK for it and a bunch of dev tools, I also did a lot of code analysis using IDA Pro on it so I'm quite comfortable with it. It's basically, to put it short, a gameserver application, so you can see the...

What happens when you save an exe file in a text editor?

text,save,editor,exe,executable
A long time ago I remember opening an executable file (.exe) in a text editor, and saving it back to the hard drive. The executable, needless to say, didn't open. My understanding is that a file is a series of bytes. In the case of a text file, these bytes...

Println the return values of an executable

java,executable
I have deploy an matlab .m file into an windows console application. The matlab file that I deploy is in fact a matlab function which have no arguments and return a list of integer. I am running that .exe from java code using process to run my executable file. I...

How to change the working directory of a bundled Java program

java,netbeans,bundle,executable
I wrote a program in Java and packaged it up as a Mac App using Netbeans. It has the typical Java, MacOS, Resources, and Plugins folders and works just fine. The problem is that my program has a save feature which, whenever used, saves files to the computer's User directory...

Parallel Execution of a .net application

c#,executable
I want to write a small console application (C# 4.0/4.5) that will serve as a logger to a remote database. Said application could be called from numerous peripheral automation components/programs, not of all which will be .NET based. (calls would be made via commandline: e.g., logme.exe appID, taskID, statusID, msg)...

Compiling multiple programs into a single binary to save space

c,compilation,executable,embedded-linux
Applications like busybox and dropbear contain several programs in a single binary. Are there tools out there that facilitate this process? Could I compile several C programs from different authors into a single binary relatively easy? I ask because I'm compiling a few things for a small Linux embedded device...

How to know my Java application is run for first time

java,logging,log4j,executable
I have a standalone Java application which i shall be shipping to the customers. The first time the exe is run I would like to show some welcome messages,configuration details etc. Its like a one time helping out the user to get started How to reliably ascertain that my application...

Nothing happens when executing a python shebang script in /usr/local/bin/

python,executable,shebang
Nothing happens when executing a python shebang script in /usr/local/bin/ Hopefully someone can help me. So i made a simple python program called test for testing out shebang scripts(I have used chmod to make it executable): #!/usr/bin/python print "hello" after i copied it to /usr/local/bin/ i tried to call it...

Reverse Engineering: changing AL register without overwriting instructions

debugging,assembly,executable,reverse-engineering,x86-64
I am trying to learn more about reverse engineering by debugging and patching a 64 bit windows executable. I am using x64dbg (Much like ollydbg but with 64 bit support) I have some assembly that looks roughly like this: call test_exe.44AA9EB20 mov byte ptr ds:[44AB9DA15], al [More instructions...] [More instructions...]...

How to check is there a process running with the given handle

delphi,executable,handle,auto-update
Scenario: From App1, I need to execute App2 passing App1.Handle as param. App2 should wait until App1's close. After this, App2 should replace App1.exe file with an updated version. Are there better ways to update a running executable file? If there aren't.. In App2, I know App1.Handle and I should...

could not find the executable please specify one

c++,qt,dll,executable
I am trying to create a dll file with C++ using qt. In my mylib.cpp I have: #include "mylib.h" MyLib::MyLib() { } void MyLib::Test() { qDebug()<<"Hello from DLL!"; } in mylib.h: #ifndef MYLIB_H #define MYLIB_H #include "mylib_global.h" #include<QDebug> class MYLIBSHARED_EXPORT MyLib { public: MyLib(); void Test(); }; #endif // MYLIB_H...

Python project to exe

python-2.7,executable,py2exe
I've been working on a rather large Python project containing both downloaded packages (xlwt, xlrd etc. ) and user defined packages and I'd like to pack it into a single .exe file. I've been searching, but can't seem to find something on how to make an executable from such a...

Why does this “new ImageIcon(getClass().getResource(”files/icon.png“)).getImage();” make my Program invisible?

java,eclipse,swing,executable,invisible
I wrote this Image icon = new ImageIcon(getClass().getResource("files/icon.png")).getImage(); in a JFrame-extending class to then set the icon of the frame with this.setIconImage(icon); I do it this way, intead of by simply using the Path, because otherwise the Icon would disappear, if I exported my Project as an executable .jar. (as...

Running executable files using Haskell

shell,haskell,command-line-arguments,executable
Say there's a C++ code that I've compiled into an executable using: g++ test.cpp -o testcpp I can run this using Terminal (I'm using OS X), and provide an input file for processing inside the C++ program, like: ./testcpp < input.txt I was wondering if doing this is possible, from...

C Executable does not run on linux Mint

c,linux,executable,mint
I am running Linux Mint 17.1 Rebecca xfce edition. I installed libc6-dev and successfully compiled a C program. My .out does not execute when I double click the file, nor when I right click and select execute. I have actually looked for an answer to this but all answers I...

Fail to compile a python script with dependencies

python,compilation,dependencies,executable,portability
I have a tiny (70 lines) python script and I need an executable which includes all the dependencies of the script. It should be usable on windows, where python-magic is only usable in connection with cygwin. Now I've tried to use Nuitka, which gives me a 6MB executable, however it's...

Executable suddenly stopped working: silent exit, no errors, no nothing

c++,qt,visual-studio-2012,executable,exit
I am facing a rather peculiar issue: I have a Qt C++ application that used to work fine. Now, suddenly I cannot start it anymore. No error is thrown, no nothing. Some more information: Last line of output when application is started in debug mode with Visual Studio 2012: The...