FAQ Database Discussion Community


Executing jar from q

cmd,system,kdb
I'm trying to run an executable jar from a q process but it gets stuck loading (no error). When running the jar from cmd it works fine. In cmd: java -cp "C:/javaWorkspaces/someDirectory/myJar.jar" myPackage.myClass In q: system "java -cp \"C:/javaWorkspaces/someDirectory/myJar.jar\" myPackage.myClass" Also note that the jar uses external jars (packaged with...

Control media output

java,c++,audio,system
I have been looking into different libraries that would allow for me control where sound is played out of. The overall goal of this personal project is to have a program that will tell how many audio outputs a user has, then allows that data to used on a server...

How to test system calls from the rake task

ruby,rspec,rake,system,stub
Suppose I have a pretty simple Rake task: task :test do system "bundle exec rspec spec" end I try testing it by stubbing the ::Kernel.system method call: describe "test" do before { allow(::Kernel).to receive(:system) } it "runs 'bundle exec rspec spec'" do expect(::Kernel).to receive(:system).with "bundle exec rspec spec" Rake::Task[:test].invoke end...

How to find if less is installed on the system?

c,system
I would like the following behavior without the use of system int ret = system("less -V > /dev/null 2>&1"); if (ret == 0) { printf("The less executable was found.\n"); } I need the variable ret to be 0 if less is installed on the system, but without using the call...

First CLIPS code doesnt work

system,clips,expert-system
I wrote my first CLIPS code for a school project but I am not familiar with CLIPS (I use C# and python as main languages). This is my code and the errors I am gettin: (defrule determine-closing-date (not (day-to-close ?)) (billing-size ?) (unpaid-invoices-number ?) => (if (or (< billing-size 1000000)...

c++ 2 ref classes should have acess to one same object of a other class

c++,windows,reference,system,command-line-interface
I have 2 classes let's say class a und b. And even a thrid class c. class a and b should have acess to the functions of the same object of class c. I want to have a member like a reference. So the argument in the construktor of class...

local file system access - solutions?

javascript,vba,file,system,local
2nd question I've posted. still very new to web programming so excuse my ignorance. I have a web based javascript which accesses a users Gmail account and downloads attachments to the local downloads folder as assigned in Chrome. These files are then manually transferred to another directory and an Excel...

How to make new line when using echo to write a file in C

c,linux,file,echo,system
hi ı am triying to take the data of files in a folder with system function this is the code char path[100],command[120]; scanf("%s",&path); sprintf(command,"echo $(ls %s) > something.txt",path); system(command); but when I look to the something.txt there is no new line. This is the output, all on one line with...

Copying files from one directory into another directory using C. Trouble with opening files in the sending directory. No such file or directory

c,file-io,system
I am brand new to System Programming and am having some trouble learning how directories and files work. The program should take two arguments(directories), if both are existing directories then just copy the files from the first argument into the second. If the second is a file, return with an...

killall(1) equivalent system call or C library call

linux,system,libc,kill-process
I have to stop the earlier instances of processes before starting a new instance. For this i need to system call or a C library call. Presently i use "system("killall name"). This works but I want to replace this with any equivalent system(2)/library(3) calls. What is the option? Also to...

How does virtual memory maintains its efficiency?

c,system,virtual-memory
Given the large number of miss penalties, why doesn't paging affects or reduces the program performance? how is possible for virtual memory to be efficient?

Protect video from video from capturing

java,security,web,filesystems,system
I have a webpage with a video. I have to protect this video from capturing it from browser with video capturing programms. I think that for this task i need to check process list or something like this, but to do this i have to use Java. Could anyone give...

Software requirement for Recommendation System

hadoop,system,mahout,recommendation-engine
In our final year engineering project, we're developing a recommendation system(Web application). The core of our project is CommTrust algorithm. User gives feedback to a particular product. Commtrust algorithm considers user feedback as multidimensional, processes user feedback and provides best recommendation to users. I'm really confused about software requirements. We're...

.nextLine() jumps straight to next output

java,string,netbeans,input,system
I am on an Java encryption program where it prompts user to map his/her own String sequence from A-Z, 0-9, full stop, comma, exclamation mark and Space. The programs runs like this: User enter a String of different sequence from this: String original= "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.,!"; String example= "!,.1234567890QWERTYUIOPASDFGHJKLZXCVBNM" User will now...

Bad System Call (core dumped) on Sybase 12.5 installation (SunOS)

installation,system,call,solaris,sybase-ase
I am trying to install Sybase ASE 12.5.4 on a Sun OS Solaris 11 machine but I am getting the following messages when launching the setup file : -bash-4.1$ ./setup InstallShield Wizard Initializing InstallShield Wizard... Searching for Java(tm) Virtual Machine... Bad System Call (core dumped) Would you have any idea...

Running an executable from python code

python,system,exe
I am trying to run create a codebook from a database of images using colordescriptor.exe. The code comes with an python scirpt which is actually a scirpt to create a codebook. In the usage example it says thath I have to run the following command to console: python exampleCreateCodebook.py trainimages.txt...

Cache size and set associative mapping

caching,byte,system,memory-address
Considering a machine with a byte-addressable main memory of 256 Kbytes and a block size of 8 bytes. With a set associative mapped cache consisting of 32 lines divided into 2-line sets. How many bytes will be stored in the cache? How many bits are there in the main memory...

c++ plugin : Is it ok to pass polymorphic objects?

c++,plugins,binary,system
When using dynamic libraries, I understand that we should only pass Plain Old Data-structures across boundaries. So can we pass a pointer to base ? My idea is that the application and the library could both be aware of a common Interface (pure virtual method, = 0). The library could...

Program not gathering directory information

c#,service,system,directoryinfo
I am working on a program that gathers information about the machine for troubleshooting purposes. After some work on the program running as admin, I couldn't get it to output all the files in the %windir%\drivers properly. I also ran into issues with the current users appdata where it throws...

Invoke mutilple threads by perl system function

multithreading,perl,system
I'd like to invoke multiple perl instances/scripts from one perl script. Please see the simple script below which illustrates the problme nicely my @filenames = {"file1.xml","file2.xml","file3.xml",file4.xml"} foreach my $file (@filenames) { #Scripts which parses the XML file system("perl parse.pl $file"); #Go-On don't wait till parse.pl has finished } As I'm...

solve symbolic system of equations inside an array

matlab,system,equation
sorry if it already has a answer..i tried other links but it didn't understand i have 2 1*63 array .landa and v. each of their members are syms. and each v member is a function of all landa members.i have already calculated v members and they are all symbolic equations...

code for shift add unit

system,verilog,system-verilog
i write the code for shift adder unit....but i didnt get correct result...here i cant ble to post ckt for the same...i think clk synchronization problem in there module shift_adder_8a(clk,,j0,j7,s089,s075,s050,s018); input clk; input [2:0] j0,j7; reg[3:0]z0; output reg[10:0]s089,s075,s050,s018; reg[6:0] o0,p0; always@(posedge clk ) begin z0 <= j0-j7; o0 <= (z0<<3)+z0;...

Use variables in batch to perform a command with varying inputs

variables,batch-file,command,system
How do I make a variable work in a batch command? I want to do the following: @echo off set /p Name=Choose your name: set /p PW=Choose your password: Net user %Name% %PW% /add I just get "System Error 5" ...

C++/Windows - Meaning of: system(“dir \\b *.dat > tmp.txt”)

c++,windows,system
I'm working on an assignment in which I have a few .dat files that I'm going to read in that corresponds to a rigid looking graph (kind of how a hear beat looks but with more data). My Prof. gave the class a specific line of code to use in...

In R: use system() to pass python command with white spaces

python,r,system,whitespace,argument-passing
Im trying to pass a python command from R (on Windows x64 Rstudio) to a python script via the command promt. It works if I type directly into cdm but not if I do it via R using the R function system(). The format is (this is how I EXACTLY...

escape alarm() process timeout with nohup or setsid?

c,linux,shell,unix,system
I have a monitoring application, Zabbix agent, that allows me to run arbitrary commands/scripts and grab the return value. The agent is configured with a timeout and any command that exceeds the timeout will be killed. For every command that is run, it first sets the timeout via alarm(timeout) and...

Nginx: setting the error page to a static file

nginx,configuration,system
I have the following nginx configuration: server { listen 80; server_name default; location / { proxy_set_header Host $host; proxy_pass http://127.0.0.1:8080/; } } When the internal service at http://127.0.0.1:8080/ is not responding nginx return a 502 Bad Gatway error. My question: how can I configure nginx to returning a static html...

Python subprocess.Popen() error (No such file or directory)

python,subprocess,system,popen
I am trying to count the number of lines in a file using Python functions. Within the current directory, while os.system("ls") finds the file, the command subprocess.Popen(["wc -l filename"], stdout=subprocess.PIPE) does not work. Here is my code: >>>import os >>>import subprocess >>>os.system("ls") sorted_list.dat 0 >>>p=subprocess.Popen(["wc -l sorted_list.dat"],stdout=subprocess.PIPE) File "<stdin>", line...

How to scale a trie across multiple servers

architecture,system,scalability,distributed-computing,trie
Does anyone know how I might scale a Trie across multiple machines? Say the first machine runs out of space and I need to add more words from a very large dictionary, what might I do to add more words? (I am a Java thinker, but I believe the answer...

How to change screen saver timeout and screensaverissecure in windows using c#

c#,system,screensaver
How to change screen saver timeout and screensaverissecure using user32.dll for the current user (or) any other users in windows through C# code, as my application is running with SYSTEM privileges in the background process. When we change the value of this registry using c# or scripting HKEY_CURRENT_USER\Control Panel\Desktop\ScreensaverTimeout and...

How can I get the minimum/recommended system requirements for my game?

unity3d,system,game-center,require
is there a service where I can upload my game in to and they give me the info ? I want something like • 2.0 GHz intel core i3 processor • 1 GB RAM • 128 MB Video Card with support for Pixel Shader 2. • The latest version of...

Suppressing system command called from awk script

windows,awk,system
I am currently running this script in Windows 7. So, I have a program that is meant to color-code output from another command (mkmk) and tally up varying numbers of errors and other notable stats, etc. So right now, it starts as a batch file which Turns off echo Sets...

Operating Systems: deadlock possible if a process can only lock one mutex at a time?

system,mutex,deadlock
Is a deadlock possible in an operating system which disallows nested locking, so that a process can only lock one mutex at a time? I think it wouldn't be possible, since for a process to acquire another lock it would need to release any lock it's holding. but I am...

system() occasionally returns 2

c,shell,system
I have coded a function using system() library function as below: int execute(const char* cmd) { int ret = system(cmd); if (ret != -1) { if (WIFEXITED(ret)) ret = WEXITSTATUS(ret); else ret = -1; } LINFO( "execute %s, ret = %d", cmd, ret); // logging return ret; } Then, I...

value of offset bigger than long int in fseek [duplicate]

c,system
This question already has an answer here: fseeko, fseeko64; ftello, ftello64 Visual C equivalents 2 answers we know that the parameters of fseek are : int fseek(FILE *stream, long int offset, int whence) i want to use it with an offset value bigger than long int what is the...

How to use read and write past BUFSIZ in C

c,linux,file,system,stdio
For an assignment, I'm supposed to create two methods: Method one will read() and write() the input file to an empty output file, one byte at a time (slowly). The other method will instead use char buf[BUFSIZ]; where BUFSIZ is from <stdio.h>. We are supposed to read() and write() with...

Why is the last line not executed by this code?

system,alarm
int main() { alarm(2); printf("still going\n"); while (1); printf("should this line be executed?\n"); } I understand that alarm() will interrupt the execution, set the alarm to go off and hand it back. Why does the last line not get executed?...

What is the default mode for open() calls with O_CREAT and how to properly set it while opening/creating files

c,linux,io,system
I am trying to recreate the basic functionality of fopen() using the I/O system calls. I am somehow suppose to "set the default mode for open() calls with O_CREAT" however am unsure how to go about this. It's not perfect but this is what I've got so far. MYFILE *...

setDefaultCloseOperation(HIDE_ON_CLOSE) and System TrayIcon

java,netbeans,icons,system,tray
How can I show the java application that I make after I Close my application? I mean i want to close the application that I make, after that it still run on the background process (tray) and I did, but how can i make the application show (pop up) again...

How many bits are in the address field for a directly mapped cache?

caching,system,cpu,computer-architecture,cpu-cache
This is a question based on Direct Mapped Cache so I am assuming that it's ok to ask here as well. Here is the problem I am working on: The Problem: " A high speed workstation has 64 bit words and 64 bit addresses with address resolution at the byte...

Chrome and file system objects

file,google-chrome,object,asp-classic,system
I have been doing a lot of research and trying to find a work around for a problem I have. I am working with old code. Classic ASP with VBscript. The tool we have working is file system objects. A user uploads a file into the input and it then...

What's the name of this kind of system? [closed]

web,system,intranet
i'm about to start a project for sharing files, announcements, and other stuff between branches of a company, it must be a web based system, with all the layers as profile management, employee communication, etc... What i don't know is what's the name of this kind of systems? It's a...

In Python, how should one test for the existence of a file in a path specified in an environment variable?

python,bash,path,environment-variables,system
I want to check for the existence of the following file: $ANALYSISDIRECTORY/data/AnalysisDerivative/configuration.txt Currently, I have a little function to ensure that a file exists: def ensureFileExistence(fileName): log.debug("ensure existence of file {fileName}".format( fileName = fileName )) if not os.path.isfile(fileName): log.info("file {fileName} does not exist\n".format( fileName = fileName )) sys.exit() How should...

Solutiousing system function to run bat file with arg from vc++

c++,function,batch-file,system
I am new in visual c++ and I am practicing to develop very simple application. I am still learning so please guide me. I am trying to run a batch file withing visual c++ and need to add an argafter it. String ^ arg = textBox1->Text; system("file.bat"); // how can...

How to forcefully stop long postgres query under heavy load?

sql,performance,postgresql,system
I am working on a Rails app with Postgres on Ubuntu. Unfortunately for me, this legacy app uses some heavyweight stored procedures in the db. What's more, the db is quite large (5GB) and my computer is not particularly fast. Every now and then, if I pass some bad parameters...

How does Windows obtain and display My Computer System Version

windows,version,system
Good day In Windows when My Computer properties window is opened, there is a General tab with 'System' information. For example, on my Windows it says: System: Microsoft Windows XP Professional x64 Edition Version 2003 Service Pack 2 Where does Windows get this information? Modifications in 'CurrentVersion' key of the...

linux system stat() method is not working correctly

linux,string,system,stat,strcat
When I wrote path like this, I stat() was working. char homePath[] = "../../usr/http/"; if(stat("usr/bin",&file_info) == -1) { strcat(sendMessage, path); strcat(sendMessage, "\n\nHTTP/1.1 400 Not Found\n"); return 0; } but the below code is not working. stat() always returns -1. I thought strcat is the problem. But when I check the...

variables in system() call C++

c++,arguments,system
I have a variable in argv[1] which I need to call inside another c++ file in such a way: system("./assemblerL.out", argv[1]); this above is incorrect syntax as I am getting "too many arguments" errors. What is the correct way of doing this?...

What's The Difference Between These? & What should I use?

c++,system,volume
I want to make a system that will only allow you to use my program on one computer, kind of like a licence system. ex: program checks volume information of system, if matches with the volume that allows it to run, it runs. My 2 questions are, 1. What's the...

A unix system programming project on windows?

c,unix,posix,system
I was given a unix prgramming project (with of cours a use of signal handling and fork()) but i have some issues with my ubuntu and i prefer to work on windows. So is there a solution ? I installed Cygwin but i don't think it will be enough to...

fork() bomb explanation in terms of processes? [closed]

linux,operating-system,fork,system,virus
I am just wondering how a fork bomb works, I know that there are similar questions but the answers aren't quite what I am looking for (or maybe I just haven't been able to come across one) How does it work in terms of processes? Do children keep being produced...

How does read(2) in Linux C work?

c,linux,system
According to the man page, we can specify the amount of bytes we want to read from a file descriptor. But in the read's implementation, how many read requests will be created to perform a read? For example, if I want to read 4MB, will it create only one request...

Run a C program from within a C program

c,runtime,system,sh
The question pretty much explains itself I have three different C programs and to try and compare their efficiency I tried to test their runtime by making them run several times varying their parameter (which is proportional to time taken) and write how long it takes each program to run...