Programming :: How To Write UI-independent Code
Jan 11, 2011
How do you write a program that is independent of the UI (the functionality is a library, and you have, for example, CLI and GUI interfaces as separate apps). The problem I have is how to report status and prompt the user from within UI-independent code? I could split it into parts that do not require any user interaction, but then most of the functionality will be in the UI, not the backend.
View 10 Replies
ADVERTISEMENT
Jan 7, 2010
I have source code that plays video stream, and can open a remote video file if provided with a URL. But I have a problem getting video from ...... the URLs I get look like:
[URL]
and my code expects something like [URL] I need to modify the code, such that it will find the actual file.
View 1 Replies
View Related
Jun 19, 2010
I'd like to write a Makefile for my CUDA/C++ code but I didn't know how things work with CUDA, I mean there is a nvcc compiler but I don't know what I've got to do with this.
Do I have to firstly run nvcc and then g++ or only nvcc to compile my CUDA/C++ code ? I found nothing on the web explaining such basic things .
View 1 Replies
View Related
Apr 28, 2011
I am writing some code in matlab and I would like to do some reading of how to write cleaner code and how to name variables and write comments. One more questions. Let's say that I find for example a file that has really nice structured comments. For example specific format commenting function inputs, outputs author code. Can afterwards copy and paste and use someone's comments format or this is might some copyright problem?
View 1 Replies
View Related
Jan 21, 2011
I'm trying to write some code that involves creating a function to return a vector iterator.I'm not sure what is wrong.
Code:
template <typename T> class VectorTemplate
{
[code]....
View 4 Replies
View Related
Aug 31, 2010
i'm trying to spawn a daemon-like java process from php on a unix environment, keep the pid for reference and keep it completely independent from httpd processes. I'm using the following code
$command = 'java -cp /myApp/ MyApp';
exec('nohup '.$command.' >> /myApp/myLog.txt 2>&1 & disown & echo $!', $pid);
$pid = (int)$pid[0];
But it gets killed when you httpd restart. I just want it never to get killed except if i call "kill $pid" command.
More Info: [URL]
View 2 Replies
View Related
Mar 30, 2011
I need to rewrite the selenium java code into its equivalent php code.
View 5 Replies
View Related
Apr 30, 2011
i need to make a to-do list for my project, everything is fine so far. but i really dont have a clue on writtiing this part: we need to write a programme that takes input from a text file then either encrypt or decrpyt it. according to the ASCII code of this charecters the user should give us his/her own keyword then the program will save the output in a new file .
[code]....
View 4 Replies
View Related
Nov 14, 2010
I'm a noob in Ubuntu. I need the program which will help me to learn different ubuntu commands. I often forget them and after reinstall I don't want to search them in Google. Now I write them in the standard text editor and my code looks like this:
Restore MBR:
Delete GRUB (fixmbr)
Ubuntu terminal then:
sudo apt-get install ms-sys
sudo fdisk -l
[Code]...
View 2 Replies
View Related
Mar 18, 2011
I am trying to write a C++ Code to read write a XML file in C++.I researched a lot and find xerces is used for that but I am not able to write the code for that.Please provide me some links on how to run a code that R/W a xml file in C++.
View 1 Replies
View Related
Apr 25, 2010
I try to write a code that allows ns to simulate the operation of the leach protocol in a network but I can not find documentation that would allow me to do that. how should be the configuration of nodes and the base.
View 1 Replies
View Related
Jan 24, 2011
I have a 8 core computer, which has 8 logical processor in total. I want to create 8 process(nodes). Each node is mapped to each logical processor. The order is code...
I wrote the code as below, could you please see whether it is correct? code...
View 3 Replies
View Related
Feb 9, 2010
how to write secure code for bash scripts in general? Strangely I didn't found anything in google and in the forum so far. If someone here is willing to review a bash script for me (about 600 lines).
View 6 Replies
View Related
Aug 3, 2010
i need to write a c code to ping IP addresses which are read from a text file and need to log the response time in another text file.
View 4 Replies
View Related
Apr 18, 2011
I am trying to write a script (especially C-shell) to execute a fortran code that reads in parameters from keyboard typing. I will have to process this .F code for many times with the parameters the same for all my data files, therefore, I don't have to type in everytime I execute the .F code. But I don't know what is the command in c shell to read in a text files that contains all the parameters I want and can make the shell read in appropriately to feed the .F code.
View 3 Replies
View Related
Jun 6, 2011
I am working on a project with a lot of vector math and I'd like to find a way to speed it up.eading about SSE, but I've found no explanation on how to actually use it in code (was looking for some kind of hello-world example, complete with compilation instructions).Does the gcc compiler automatically make use of SSE, if you add the -sse(2,3) option on the command line? Or are their specific functions/libraries you need to call?
View 12 Replies
View Related
Feb 7, 2010
This tutorial is meant for Ubuntu 9.10 Karmic Koala, but it might work in earlier or later versions as well. I wrote this tutorial mostly because it took me a full day of work using lots of help from people on #mpd and #pulseaudio from the FreeNode IRC server.The goal is to get the MPD daemon working using PulseAudio, but without it being dependent on the X server or a session. To do that we must configure PulseAudio to run in system-wide daemon mode (which is not recommended by the developers, but in this case we do not have a choice). This means it will be using the /etc/pulse/system.pa config file instead of the usual /etc/pulse/default.pa. We must also make sure the appropriate user/group permissions are set, or PulseAudio will be rejecting the connections.The result will be an interrupt-less music environment, not dependent on the X server. Meaning we can for example log out and log in without the music having to stop for even a second. Switching TTYs (Ctrl+Alt+Fx) will also keep the music playing (not possible by default). All that and PulseAudio will still be able to detect and configure all your devices automatically.
Instructions: Make sure you add your username to the following system groups: pulse, pulse-access and audio.Do that by going to System --> Administration --> Users and Groups.Click the unlock button (the one with a picture of some keys), then click Manage Groups. In the list of groups that pops up, for each of the previously mentioned groups click "Properties" and select all the users that you want to have this functionality.
View 9 Replies
View Related
Jul 4, 2010
I'm buying a new memory stick online, but on the page I'm buying it from, it says "OS Required: Microsoft Windows XP, Apple MacOS X 10.1.2, Microsoft Windows Vista / 7" so I'm wondering does this mean it won't work in Linux (Ubuntu)? Because i thought that flash drives were independent of OS.
View 8 Replies
View Related
Oct 22, 2010
How to set independent configuration for each of the workspace, the 4 workspace that could be switched from the bottom-right corner?Gnome supports 4 workspace, but now it seems on my computer all of them share the same wallpaper, same files and folders on the desk, and the same google gadget. But I'd like to put different kind of files on different Gnome desktop. How should I do?
View 1 Replies
View Related
Apr 16, 2010
We are normally using IPC for exchange of data between multiple threads or processes. Out of following IPC which are platform independent and why they are platform independent?
1. FILEs
2. Socket
3. Named Pipes
4. Shared Memory
5. Message Queue.
View 1 Replies
View Related
May 23, 2011
Is there, by chance, a fancy name to describe code that must be in a program but will never be executed? In one of my (Haskell) programs, I have some error-handling code that must be in the program to keep the compiler happy (due to the type checking). However I know that, due to the logical structure of the program, it is impossible for the code to be evaluated. I am curious if there is a technical name given to code that must exist but cannot be executed.
View 6 Replies
View Related
Jan 14, 2011
I went to compile some "oldish" glx code. The code compiles great but when I go to run it I get a crash. With X Error of failed request: BadMatch (in .....running ddd causes my whole system to lock up when I call the glx function XOpenDisplay. After a few attempts I thought I'd download a demo from the net, I choose nehe opengl tutorial 2, I compiled and ran but even on a net tutorial I get the same error
./lesson02
XF86VidModeExtension-Version 2.2
Got Doublebuffered Visual!
[code]....
View 1 Replies
View Related
Jul 20, 2011
I have the following code:
Code:
#!/bin/bash
function dx {
[Code].....
So essentially, it finds dx files, sorts them by numbers at the beginning, then performs the dx function I made (loops over all of the #-protein.dx and #-water.dx files).
It works fine when I'm running it on Ubuntu 11.04. However, when I try to run it on OSX, I get the following error:
Code:
mh320m01:DA_R02 janickij$ ./MOD_Loop_Tuber_Script.sh
find: illegal option -- t
find: illegal option -- y
[Code]....
View 9 Replies
View Related
Jan 5, 2010
I work as a linux sysadmin, and are now and then developing scripts that might be of use for others. I'd like to be able to share these, and for less trivial projects maybe create a central repository or something that others may upload updates/patches to etc.
View 10 Replies
View Related
Apr 10, 2010
I have a little test program consisting of a NASM source file and a C source file.How do I turn them into a single program?
Code:
section .data
msg db 'Hello, World!', 10
[code]....
View 14 Replies
View Related
Feb 23, 2011
whichever source code I go through I find these three lines of code written what do they actually mean and what is their function?
[code]...
View 6 Replies
View Related
Sep 26, 2010
creating independent sub-domains on my VPS.To describe this in clear words below is the example:I have a domain named as demo.com and k it as test1.demo.comand i have only one IP address assigned to me, which points to demo.com.So how can i set this sub-domain so that I will serve as a separate entity
View 5 Replies
View Related
Feb 16, 2011
I want to write a c program with some shell scripts.Now For a simple C program. I am Setting a variable called val2 in bash, now I want to use bash variable val2 in C code. How do I do that?The above doesn't work (coz its spawning a different memory space and when shell script ends the variable dies with it as per my research but how do I keep them in same memory space)Also Is there any Good reference where they teach how to integrate C and Bash Together?
View 5 Replies
View Related
Mar 23, 2011
Can you find an alternative for Code: wc -l using grep?
View 1 Replies
View Related
Mar 28, 2011
Looking for code to add 5 numbers in assembly? I want to use array for input of those 5 numbers. No problem if the output is 1 digit(0....9).
View 3 Replies
View Related