Debian Programming :: Returning Different Values For Same Code?
Sep 11, 2014
I am developing a script to automate some database setup, but I have an issue I cannot figure out. I prompt for some input with whiptail and select a default if nothing is entered. However, if you do not enter anything, it normally returns 0, but this time it is returning an empty value.
Code: Select all # This one does work!
# Set the source path
TMPPATH=$(whiptail --backtitle "Linux Build Configuration"
--title "Source-Code Path"
--inputbox "Default: $SRCPATH" 0 60
3>&2 2>&1 1>&3)
[Code] ....
So what is wrong with the second code?
View 1 Replies
ADVERTISEMENT
Jan 26, 2010
Wikipedia won't load! It keeps returning code 200 (ok) along with 0 bytes of source...
View 2 Replies
View Related
Jun 23, 2010
I am facing the problem of calling cfitsio library from C program in linux. when i am givingthe option "gcc -o CreateLevel1DataFitsFile CreateLevel1DataFitsFile.c -lm -lcfitsio
"i am getting following error
/usr/lib/../lib/gcc/i386-redhat-linux/3.4.4/../../../libcfitsio.a(getcolj.o)(.text+0x7065):/backup/Astrosat/learning/cfits/cfitsio/getcolj.c:3098: more undefined references to `__xtoll' follow
[code]...
View 2 Replies
View Related
Feb 12, 2010
I have having some trouble working with wide characters, which is,
Sample code:
TCHAR fname[512];
_tcslcpy(fname, L"/root/Desktop/all/TheGrandTunnels.fgc", 512);
[code]...
View 4 Replies
View Related
Jan 23, 2010
I've got a strange bug that I cannot figure out how to solve. Here is the function.
Code:
int getnexttab(char input[], int index, int length)
{
[code]....
View 14 Replies
View Related
Mar 21, 2011
I have created an object where I pass a string and a long value to it <in Java>, currently I am adding the values to my Object so I can then add it to a list like so:
Code:
List myList;
ImageObject io;
for(i = 0; i < 10; i++)
[code]....
This is what the object currently looks like:
Code:
public final class ImageObject<name, time>
{
public String name = "";
public long time = 0;
[code]....
View 1 Replies
View Related
Sep 14, 2010
I have a very simple bash script:echo -n Create home directory?:
read HOMEDIR
if [ $homedir="y" ] || [ $homedir="yes" ]; then
homeval=" --makehomedir"
[code]...
View 6 Replies
View Related
May 28, 2010
I am getting following assertion in my application:
pthread_mutex_lock.c:275: __pthread_mutex_lock: Assertion `(e) != 35 || (kind != PTHREAD_MUTEX_ERRORCHECK_NP && kind != PTHREAD_MUTEX_RECURSIVE_NP)' failed.
all my mutexes are of type PTHREAD_MUTEX_RECURSIVE and as per all the man pages/tutorials, EDEADLK error is to be returned for mutex of type PTHREAD_MUTEX_ERRORCHECK ONLY.I really should not be hitting this assertion.Would some kinda weird memory corruption be causing this? Or is there something more to it that I am not aware of.I am using linux kernel 2.6.2, glibc 2.5 on PPC.
View 8 Replies
View Related
Sep 29, 2010
we have a multi threaded program on Linux where one thread is waiting on poll() system call with event set to POLLIN, & another thread has closed the same socket fd (which is passed to poll) , but the poll() did not return, is this the expected behavior? From man page of poll we found that the poll should return POLLNVAL if the socket fd is closed, is my understanding correct or is there any bug in the poll()?In Solaris we observed that the poll system call is returning with POLLNVAL if the socket is closed.
View 3 Replies
View Related
Dec 5, 2013
What is the complete process of integrating live chat software.
View 2 Replies
View Related
Sep 15, 2014
Whats the bash script for like, how synaptic package manager runs ..
When you run synaptic it ask for root password ..
How do I do this in bash script?
View 5 Replies
View Related
Mar 30, 2011
I need to rewrite the selenium java code into its equivalent php code.
View 5 Replies
View Related
Sep 11, 2011
I installed the stable version of Debian last night (Debian GNU/Linux 6.0 l) and whenever I come out of suspend, the video card's fan stays at full speed. When I do a regular reboot, this doesn't happen.
Normal behavior is for the fans (cpu and gpu) to go to full speed for a few seconds and then settle on a slower (quieter) speed.
The hardware involved is:
Dell Vostro 400
01:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GT] (rev a2)
The install is vanilla (as in "I haven't messed with drivers or configuration files - yet"). Also, keep in mind that I'm a newby - I've just switched to Debian after about two months of Ubuntu and am not too familiar with where everything is or what commands I need to do what, so instead of telling me to change the sync parameters in the nvidia configuration, I need to know exactly what parameter in exactly what file.
View 1 Replies
View Related
Oct 12, 2010
i am having two small issues with a function i have made.sorry if it is a mess, i am still learning bash.the first is calling the nonpersistssh function (second line) and assigning the return value to nonpersistdiag.the function returns 1, but nonpersistdiag seems to only contain 0. i am unsure on how to proceed.the second problem is the nested else clause on line 10. it is a syntactical error. how would i declare it correctly?
Code: function endsession(){
nonpersistdiag=$[nonpersistssh]# a function that returns an exit code
sudo /etc/init.d/ssh stop; sshdiag=$?
[code]....
View 6 Replies
View Related
Sep 20, 2010
I have a strange iptables issues. I have just built a new Debian install and starting adding some real basic rules (see below) the problem seems to be that the localhost itself can't get any returning traffic. That is, it seems to be allowed outgoing traffic but not the connected, returning traffic. Ordinarily allowing Established Connections would resolve this, see the rule below, but it hasn't. Why this doesn't work. Removing the last DROP in the INPUT chains obviously makes the traffic work!
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -j ACCEPT -p tcp --dport 22
iptables -A INPUT -j ACCEPT -s x.x.x.x
iptables -A INPUT -j ACCEPT -s x.x.x.x
iptables -A INPUT -j ACCEPT -s x.x.x.x -p tcp --dport 80
iptables -A INPUT -j ACCEPT -s x.x.x.x -p tcp --dport 8080
iptables -I INPUT 1 -i lo -j ACCEPT
iptables -A INPUT -j DROP
View 3 Replies
View Related
Nov 11, 2010
I can use hexedit to manually edit one or two hex values in a binary file, but if I want to change many of the, this is impractical. Is there any tool that will take parameters like Code: someTool filename byteNumber replacementByte ?
View 3 Replies
View Related
Jul 2, 2009
The idea is to make a website to check the availability of domains and it works but its not pretty yet. Below is what i have till so far:
## this is the API from my domain registrar.
<?php $client = new SoapClient('http://api.sync.com/?wsdl');
## I have a search box that sends the request to this page
$var = $_GET ["s"];
## remove the most common subdomains from the request.
$var=eregi_replace("www.", "", $var);
$var=eregi_replace("mail.", "", $var);
$var=eregi_replace("ftp.", "", $var);
$var=eregi_replace("pop.", "", $var);
$var=eregi_replace("smtp.", "", $var);
## remove any TLD extension from the request.
$split = explode(".", $var);
$main = $split[0];
$arraysize = sizeof($split);
for ($x=1; $x<$arraysize; $x++) {
$tld .= "." . $split[$x];
}
## login to the API
$paramLogin = array('handle' => 'randall', 'password' => 'password');
## match the domain with any possible TLD
$varcom = $paramAvailDomain = array('sld' => $main, 'tld' => 'com');
$varnet = $paramAvailDomain = array('sld' => $main, 'tld' => 'net');
$varorg = $paramAvailDomain = array('sld' => $main, 'tld' => 'org');
$varbiz = $paramAvailDomain = array('sld' => $main, 'tld' => 'biz');
$varinfo = $paramAvailDomain = array('sld' => $main, 'tld' => 'info');
$vareu = $paramAvailDomain = array('sld' => $main, 'tld' => 'eu');
$varnl = $paramAvailDomain = array('sld' => $main, 'tld' => 'nl');
$varbe = $paramAvailDomain = array('sld' => $main, 'tld' => 'be');
$varde = $paramAvailDomain = array('sld' => $main, 'tld' => 'de');
$varcouk = $paramAvailDomain = array('sld' => $main, 'tld' => 'co.uk');
$varorguk = $paramAvailDomain = array('sld' => $main, 'tld' => 'org.uk');
$varname = $paramAvailDomain = array('sld' => $main, 'tld' => 'name');
$varmobi = $paramAvailDomain = array('sld' => $main, 'tld' => 'mobi');
$varin = $paramAvailDomain = array('sld' => $main, 'tld' => 'in');
$vartv = $paramAvailDomain = array('sld' => $main, 'tld' => 'tv');
$varcn = $paramAvailDomain = array('sld' => $main, 'tld' => 'cn');
$varws = $paramAvailDomain = array('sld' => $main, 'tld' => 'ws');
$varnu = $paramAvailDomain = array('sld' => $main, 'tld' => 'nu');
$varbz = $paramAvailDomain = array('sld' => $main, 'tld' => 'bz');
$varcc = $paramAvailDomain = array('sld' => $main, 'tld' => 'cc');
## this requests the domain.COM and domain.NET
$varcom;
$varnet;
?>
<div id="content">
## below prints the result
<?php
print "<html><body><pre>";
$result1 = $client->__soapCall('Login', $paramLogin);
echo "<b>Result Login:</b>
" . print_r($result1, true);
$result15 = $client->__soapCall('AvailabilityDomain', $varcom);
$resvarcom = var_dump($result15, true);
$result15 = $client->__soapCall('AvailabilityDomain', $varnet);
$resvarnet = var_dump($result15, true);
print "</pre></html>";
?>
<?php
## the returned array looks like this
Result Login:
Array
(
[code] => 200
[message] => Login succesful
)
array(3) {
["code"]=>
string(3) "200"
["message"]=>
string(20) "Domain not available"
["result"]=>
object(stdClass)#236 (1) {
["status"]=>
string(5) "TAKEN"
}
}
bool(true)
array(3) {
["code"]=>
string(3) "200"
["message"]=>
string(16) "Domain available"
["result"]=>
object(stdClass)#232 (1) {
["status"]=>
string(4) "FREE"
}
}
bool(true)
?>
## till so far it works
What I need to do is to make this ugly looking reply in to something more readable, basically if TAKEN print occupied and if free print its yours to grab. I have been struggling with the in_array function but i'm not getting anywhere close in getting it to work.
View 2 Replies
View Related
Jul 11, 2010
I have been reading the Wikibook on C Programming for quite some time and am up to the variable part. I did learn several new things, like that too many variables hog memory.
What I want to know is how to assign a variable to the keyboard (in the C/C++ family) as such that the user has to type it in.
View 2 Replies
View Related
May 23, 2010
I have the following snippet HTML code:
Quote:
<table id="profile">
<tr>...............</tr>
<tr>
<td width="40%">
[Code].....
How can pass values in args[0] and args[1] to Perl/CGI script?
View 2 Replies
View Related
Jun 13, 2009
I created a class which has to return an array. My problem is I need to return 3 entries per record for example:
Code:
array(
"2009-06-13", "John", "Doe";
"2009-06-13", "Paul", "Simon";
"2009-06-12", "Frank", "Herbert";
);
Can this be done? What is the syntax? Where is the documentation? If this can't be done, How would you return this to a class without using a DB?
View 3 Replies
View Related
Feb 24, 2009
I have a application in C++, and now I have two class. MyDialog is the class that main function launch. In MyDialog class there are four elements and when I click over theese elements, there is a MousePressEvent that launch other class, Touchpad class. So, in some moments, I have loaded two class. My question is, how can pass a value from Touchpad class to MyDialog class, when I close (destroy) Touchpad class. In a few words, is it possible to communicate values between class?
View 5 Replies
View Related
Jan 24, 2010
Does anyone know what the Inet/AMD instruction 'nopl' is or does anyone know where I can find a list of hex values for the Intel/AMD instructions. nothing important is waiting on this reply.
[Code]...
View 3 Replies
View Related
Jan 24, 2011
I have a variable in which the data is stored as below:
variable_test=0m0.001s 0m0.001s 0m0.001s 0m0.001s 0m0.001s 0m0.001s .....an so on.
There are lots of values in format like "3m1.057s" are stored in variable_test separated with an space between two such values. For exapmple, value is "3m1.057s" I need to save different parts of a value in three separate array variables such as the
var_hour=3
var_min=1
var_sec= 057
tell if this can be done using "awk". A "WHILE" loop might be used to separate and store theses values I guess?
View 1 Replies
View Related
Jul 24, 2011
Whats wrong with this:
Code:
#include <stdio.h>
int main(int argc, char *argv[])
{
if(argv[4] == "-verbose")
{
printf("Verbose is on");
[Code]...
View 2 Replies
View Related
Oct 30, 2010
I have a function that returns a boolean value, True of False. Is there any convention whether 0 = False or 0 = True? It should be obvious, 0=False, 1=True. However programs usually return 0 on success and reserve higher numbers for error values. I.e. if the program finishes successfully (function int main() finishes successfully ), it returns 0 - and that contradicts that 0 should be false.
And especially if I want a function to do some computations on parameters passed by reference and return success status. Should it return 1 (true) for success, or should it return 0 for success - like any Unix program does?
Is there any convention for this?
View 1 Replies
View Related
Mar 23, 2010
I'm creating my personal site in HTML/CSS and Perl/CGI. I have a list of links:
Quote:
<a name="link1" href="/cgi-bin/script.cgi">value1</a>
<a name="link2" href="/cgi-bin/script.cgi">value2</a>
<a name="link3" href="/cgi-bin/script.cgi">value3</a>
<a name="link4" href="/cgi-bin/script.cgi">value4</a>
<a name="link5" href="/cgi-bin/script.cgi">value5</a>
I want capture values of "value*" in <a> tags with script.cgi.
View 8 Replies
View Related
May 13, 2010
Code:
DWORD type = REG_NONE;
int i = 0;
[code]....
View 14 Replies
View Related
Mar 24, 2011
We are running some script to generate below values however we don't need the first level output as it always shows cpu % as 0.0.
(We dont need following part:
NAME STATE CPU(sec) CPU(%)
XXX -----r 55567 0.0
[code]....
View 10 Replies
View Related
May 5, 2010
I am trying to import variable values from a profile file to a perl program.
I am using the below command for doing it.
Quote:
system (". /opt/bbfb/bin/setbbfbenv $codeset");
the above command does make variable values available to the running perl program..
Can some one help me on this front..
View 1 Replies
View Related
Feb 1, 2011
I have written a code on Linux that searches a long dictionary. I have used hsearch() function but the problem is it does not work. This is my code://Search the count values from the dictionary.
Code:
#define _GNU_SOURCE
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<search.h>
#include<inttypes.h>
#include<math.h>
[Code]...
I open each DIC file, get the word from it and search the hash table and extract the key from it. The problem with the above code is that it is able to make the hash table but it returns NULL when searching. It should not return NULL in any case because all words from DIC files are there in the dictionary. I am not able to figure out why?
View 1 Replies
View Related