Programming :: Wcslen / _tcslen Not Returning Correct Value?

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


ADVERTISEMENT

Programming :: Simple Bash Script Not Returning Correct Value?

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

Programming :: Gcc Returning Undefined Reference?

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

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 View Related

Programming :: C Function Not Returning An Integer After Comparing It To A Char?

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

Programming :: Java Passing Iterators To New Objects And Returning Them?

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

Programming :: Pthread_mutex_lock Returning EDEADLK For A Mutex Of Type PTHREAD_MUTEX_RECURSIVE

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

Programming :: Poll() System Call Not Returning When The Socket Is Closed Locally?

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

Programming :: In Correct File Is Empty?

Jun 17, 2010

I am using embedded Linux. File open is successful. The file has all the permissions. It is present in current directory too. The size is about 27KB. But s.st_size says it is zero.

inputFileName = "abc.mp3";
FILE* inFile = NULL;
inFile = fopen(inputFileName, "r+b");

[code]...

View 2 Replies View Related

Programming :: Javascript To Verify Correct URL?

May 31, 2011

Lets say I have a site "Website1.com"

On that site I want to run a little javascript that verifies that the site was accessed as "Website1.com" and not "dev-Website1.com"

If it was accessed correctly, nothing happens. If it was accessed incorrectly, it displays an error saying "You are trying to access this site incorrectly."

What is the simplest way to accomplish this?

View 1 Replies View Related

Programming :: Atoi() Not Giving Correct Answer?

Jun 20, 2010

i m using atoi() to convert char value to int. and then passing that int as a swtich variable.switch goes in a case and exectuing that particualr function but returning 0 value....for example: i am finding no of process() and system up time().when switch program goes in system up time it gives right values means correct no of days, hrs , min and sec but when it goes in no of process() it gives 0 answer.

View 8 Replies View Related

Programming :: Correct Way Of Spawning Parallel Jobs?

Mar 18, 2010

I need to spawn 2 processes in parallel and each takes an hour or so to finish. Is the following one of the correct ways of using `at` in a script run by crontab?

Code:
#!/bin/bash
# define the env var, cd, etc... assume everything ok up to this point
date +"The start time is %H:%M:%S"
rm -f a.fin
at now <<END_OF_AT
do_a &> a.log

[Code]....

View 2 Replies View Related

Programming :: Expect/TCL - Unable To Get The Correct Results

Feb 8, 2011

I'll post the entire code here, and then specifically highlight what is just failing in a fashion I'm apparently incapable of fixing a few hours later:

Code:

#!/usr/bin/expect
# The script should be called with a file in the directory called sshServerList
# That file has the following format:
# Line # | Contents of line

[code]....

I've had all kinds of different results and problems, but I've never been able to successfully log into multiple servers, though the first server in the list most times works okay (though might not on this iteration). I'm a bit hack and slash and I would be very greatful not only for a solution, but any tips on how I should have done this and places where I could clean up my code.

View 1 Replies View Related

Programming :: Bash Script To Correct The Filenames

Apr 11, 2011

I have a directory that has a bunch of files and directories under it that I need to correct the filenames of. In fact, I plan on running this as a cronjob to keep checking filenames for certain characters. I want directories and filenames with spaces or pluses (+) to have those certain characters replaced with underscores (_). I know that this will involve sed but I'm not sure what else. A simple shell script would handle it.

View 1 Replies View Related

Programming :: Not Getting Right Output To Correct Terminal Window

Jun 17, 2010

I have a server client prog in which server is my 'agent' and client is 'manager'. Following is the code for both agent and manager. I want my agent to send what manager is requesting. But it is not working the way I want. The parameters which manager is requesting, agent has to send to manager but in this program result for those parameters is shown on agent's own terminal window. Where as I want them on manager's window. Secondly, there result is not correct, means it is giving ' 0 K ram and 0 no of process....

Code:
//code for MANAGER
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h> .....

View 2 Replies View Related

Programming :: Sudoku - Calculate The Correct Box For A Given Square?

Apr 8, 2011

Im doing a sudoku-solver as a school assigment in Java. It is supposed to solve both 6x6, 9x9 and 12x12 boards.Im pretty much done with my algorithm(brute force), but I'm having a hard time figuring out how to calculate the right Box for a Square. I found this snippet:

Code:

// calculate BoardPos for index, where index is 0..80
void loadBoardPosFromIndex(BoardPos &pos, int index) {
pos.index = index;

[code]...

This works on 9x9 boards, but I really dont get the math behind this, and how I can create a generic rule for both 6x6, 9x9 and 12x12 boards.

View 4 Replies View Related

Programming :: Correct Package To Install Javadoc On Fedora?

Nov 2, 2010

Anyone knows what is the correct package to install javadoc on Fedora???

View 3 Replies View Related

Programming :: GDB Doesn't Provide The Correct Line In The Source Code

Jan 23, 2011

I found a strange problem when I use gdb in eclipse to debug. When I step in the program, the register RIP(I'm using x86_64 machine and that's EIP in 32 bit mode) shows correctly but the line stepping in the source code may be far from the correct line. For example, when there is no loop in the source code, the RIP keeps on increasing and the current instruction pointer goes back to several lines back. I'm sure the source code is the right one because I when I checked the memory and local variables after several lines the values are all correct. The source code has many empty lines and does it matters with GDB?

View 3 Replies View Related

Programming :: Correct / Common Directory Tree For Software Packages?

Mar 16, 2011

I found it easiest to embed narp into the gtk+-2.0 installation because all I needed to do was tweak the Makefile.am and Makefile.in files and let configure do the rest.This is a hack. I've failed at getting my own makefiles to work.

Would anyone point me in the right direction on how to properly make an installer for Linux? Also, what is the correct/common directory tree for Linux software packages? Any more suggestions on proceeding with this project using community standards?

View 2 Replies View Related

Programming :: Check If The User Is In Correct Directory Before Executing Bash Script

Dec 10, 2010

I have been searching for 90 minutes for something that I "think" should be fairly easy. I'm pretty new to Bash Scripting so I could be completely wrong. Then again it may be a weird request to even need something like this. But here it is.I have a script written to convert data from one of our software version to another. The only thing I need to add to it is a "check to make sure the user running the script is in the /tmp directory".

View 7 Replies View Related

Ubuntu :: Gdb Not Returning To Prompt

Jun 6, 2010

i'm trying to make a backtrace of nautilus (as described here: URL...to fill a bug report but it doesn't work.after i "attach PID" to the nautilus-process and do "continue" it's not possible with ctrl-c to return to the (gdb)-prompt. the wiki-page above says:"If the program hangs but doesn't crash you can press ctrl+c in gdb while the program is frozen and then continue with the next step".

View 1 Replies View Related

Ubuntu :: Sleeps Again After Returning From Sleep

Feb 2, 2010

I configured Dell Latitude D620 to go to sleep mode (suspend to ram) when i close the lid. It suspends ok and then I open the lid. It wakes up ok, but few seconds after goes to sleep again! So I need to press the power button to force it to wake up.

Sleep button works just fine. /etc/acpi/sleep.sh from console too.

/etc/acpi/events/lidbtn

Code:
event=button[ /]lid
action=/etc/acpi/sleep.sh
update:

I noticed that it always goes to sleep again when I wake up laptop by opening the lid. For example if I run /etc/acpi/sleep.sh, pm-suspend or press the sleep button laptop goes to sleep, then i close the lid and when i open it back - the problem occurs.

View 4 Replies View Related

Ubuntu :: Wikipedia Won't Load - It Keeps Returning Code 200

Jan 26, 2010

Wikipedia won't load! It keeps returning code 200 (ok) along with 0 bytes of source...

View 2 Replies View Related

Ubuntu :: Locate Not Returning Any Results / Force It To Do?

Feb 6, 2010

Bit of a strange one - locate is not finding any files ??
I'm running xubuntu karmic and 'locate' is actually 'mlocate' so doesn't allow the -u switch.

Is there some way of forcing it to reindex?

View 2 Replies View Related

Ubuntu :: Screensaver Returning Error Message With GLX

Feb 14, 2010

I don't know what I'm missing or what I did to break it, but most screensavers that I have end up returning this error message:
"X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 135 (GLX)
Minor opcode of failed request: 19 (X_GLXQueryServerString)
Serial number of failed request: 16
Current serial number in output stream: 16"
This is also the output of glxinfo. Did I somehow break something in my graphics driver?

View 4 Replies View Related

Ubuntu :: Returning To A Menu In Bash Script?

Feb 7, 2011

Im constructing a menu for a program using case. I have all my normal input options mapped out but i want to have a * ) option so that if something else is inputed, it displays "Incorrect input" and then resumes the normal menu function. How do I do this? Ideally, I'd like it to display "Incorrect Input" and then accept more input for the menu.

View 2 Replies View Related

Networking :: Box With 3 Dedicated IP's All Returning The Same Single IP Address?

Jan 20, 2010

I have a linux box, which was given to me by a company with 3 dedicated IP addresses. My goal was to setup ssh tunnels on all three dedicated IP Addresses.

Via Putty, i am successfully able to create a tunnel to the box's on IP1 IP2 and IP3 - that is i can make incoming connections on all three IP's.

However, my problem lies when i attempt to USE the tunnel. AIn all instances, regardless of the IP i actually tunneled into the box with, it returns IP1 as an outgoing connection, i.e if i setup IE to use the tunnel, it will return my IP as IP1, even though i have created the tunenl via IP2/IP3.

What id liek to accomplish is that when i create a tunnel via IP1, then outgoing connections go via IP1, and when i create a tunnel via IP2, then outgoping connectiosn go via Ip2 etc.

After discussing this with a colleague of mine, he infomed me he had the same problem at one point, and that some configuration on the box was required - however he was unable to recall.

View 2 Replies View Related

Networking :: Why Is Udhcpc Is Returning Etho0 Instead Of Eth0

May 3, 2011

I'm building a very small netbootable client, using a stripped down custom kernel and busybox v.1.18.4 (stable) with the embedded ifconfig and udhcpc applets

after startup, the initrd is loaded, and the proc, sys, dev and pts folders are properly created and mounted.

/proc/net/dev properly contain eth0 as an ethernet device.

in the init script I execute a background call to udhcpc passing the dhcp.script properly to udhcpc, and dhcp.script is then executed when the bound event occurs.

what I cant get past is udhcpc is passing back the interface evironment variable as etho0 (thats, 'eth' lowercase 'o' and a zero '0', when it should be passing 'eth0', thats 'eth' and zero '0')

I know I could hardcode the eth0, but i was hoping for a somewhat smarter system.

View 2 Replies View Related

General :: Pam_mysql_check_passwd() Returning 6 - Pam_mysql Authentication?

Aug 2, 2011

I'm having trouble with my pam_mysql authentication.'ve double checked my md5 password but its correct.What should I be looking at? My /etc/pam.d/system-auth is completely identical to my other server (that works), but this one is somehow reporting that my password is wrong.I've bolded out the questionable output.Here's my error log while trying to connect:

Code:
Aug 2 16:16:21 la2 sshd[8006]: pam_mysql - option verbose is set to "1"
Aug 2 16:16:21 la2 sshd[8006]: pam_mysql - option db is set to "hidden"

[code]....

View 3 Replies View Related

Server :: BIND Not Returning Windows DNS Hostnames

Jan 5, 2010

I have a situation where I have two DNS servers - a BIND one for our Unix hosts and a Windows Server DNS one for the Exchange and other Windows hosts. I set up the BIND server to slave from the Windows one, which it seems to do just fine.

Windows DNS has entries like "_gc._tcp.domain.local" in it, which are needed for domain logins, etc.

However, when I try to use nslookup on those entries, it fails when querying the BIND server. When I do a domain transfer with dig, I get all the answers I expect.

This failure means that the Windows boxes can't query the BIND server for the answers they need. By default, from DHCP, it is the BIND server they get, so that's a big problem. If I manually switch their DNS to the Windows server, it works perfectly.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved