Programming :: Notice: Uninitialized String Offset: 1 In [PHP]?
Nov 8, 2010
This code is giving me the above said error, this code was written by me 2 years back, can't remember the cause of error at this moment, please help !
Code:
function remove_spaces($input,$i)
{
[code]....
View 8 Replies
ADVERTISEMENT
Mar 10, 2011
M busy upgrading one of my clients old Debain etch boxes to Lenny but i keep on getting this error.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/Debconf/Config.pm line 22.
debconf: delaying package configuration, since apt-utils is not installed dpkg: unrecoverable fatal error, aborting: syntax error: unknown user `root' in statoverride file E: Sub-process /usr/bin/dpkg returned an error code (2)
View 1 Replies
View Related
Apr 14, 2011
I'm currently teaching myself perl. I'm trying to write a program that unscrambles words by comparing each element in the array. There is an input file where you type the words to be unscrambled and there is a word list file containing approximately 1300 words. After everything has been processed the program is supposed to paste those words to an output file.
Code:
#!/usr/local/bin/perl
#use strict; #always add this in the beginning of code.
#use warnings; #always add this in the beginning of code.
#open(INFILE, '<', 'sample.txt'); # For reading
#open(INFILE, '>', 'sample.txt'); # For writing
#open(INFILE, '>>', 'sample.txt'); # To append .....
View 4 Replies
View Related
Oct 22, 2010
copy string a to string b and change string b with toupper() and count the chars
View 3 Replies
View Related
Jun 26, 2011
I want to strip the process name from the hosts - i did it with the code below.
I have two questions - is there a more compact way to strip off the process names? usalso i want to get rid of the errors after extracting the hostname. It is complaing about $arry[1]. using my $arry[1] is not allowed. Assigning the slice to a value, as is 'my $sliced_arry = $arry[1]; print $sliced_arry , does not work either.
Code:
Use of uninitialized value in pattern match (m//) at newcomm_stats.pl3 line 7, <NEWCOMM> line 16 here i get what i want - just the host name, but still get those nasty errors. assigning a value to $1 does not work, and localizing $1 with 'my' is not allowed.
Code:
View 4 Replies
View Related
May 3, 2011
I've been trying to understand pthread in C a little better. So I made a simple program that takes in a string from the command line and creates a thread to print the string. I've looked online and copied the basic concepts but there are something things I'm confused about. The programs works just fine, but I have questions. Here's what I have so far.
[Code]....
One thing I'd like to know is why the 3rd argument in the pthread_create function which is my SendMessage function needs to be typecasted to a void pointer and then send the address of the function. Also as for the 4th argument, I would see typecasting to void pointer in some of the pthread examples I saw online, but in my case I'm passing a char pointer, would this be correct? In which case would I ever want to pass a void pointer?
Do I need a pthread_exit(NULL) in my main and in the SendMessage function? If so, why? I added the sleep() function so that I could let the pthread_exit function in my SendMessage function execute first. I simply saw that the online examples on pthread had pthread_exit() in both locations.
View 6 Replies
View Related
Jun 18, 2010
I'm looking for a function (prefer POSIX, but Linux specific would do if it has to) to get the current timezone offset. For my location, eastern USA, that should be -14400 when daylight time is in effect, and -18000 otherwise.
View 1 Replies
View Related
Dec 30, 2010
I'm using pyqt3 for my app and am lost on even how to attempt this task... On a vinyl cutter to have the blade pivot it must be offset from the center of the shaft it's on so say for example a .25mm offset would leave a .25mm unwanted vinyl attachment when the cutting is done. I somehow have to average or extrapolate that .25mm xy coordinate and add it to the hpgl plot file as a PUx,y; command? I have enclosed a simple sample file that has three images in it. In the corresponding hpgl file everything between the PU commands that are starting with PD are the code for that image (star for eg the pu to move to next image and then all PD for the next image and so on, so once the formula or procedure is figured out it can be applied to as many images there are in the file. Placing the new command at the head of each image PD group. Since there are absolute and relative cutters I enclosed the same exact plot for both types as the coordinates on relative can be negative numbers. Only PU and PD commands and a ";" as a command delimiter as sometimes many commands are on one line.The offset variable will come from a spinbox but .25 is good for an example.
View 14 Replies
View Related
Oct 20, 2010
I have a column of datetime entries which I sorted to removed duplicate entries.
I have still lots of entries which are adjacent to each other by 1 second.
How would I go about removing any entries which have an offset of the previous or after entry by 1 second?
Code:
View 5 Replies
View Related
Oct 16, 2010
I have a set of lines as ahown below:
Leon went to school
Leon came back from school..
Leon had dinner...
I have to replace the line containing "dinner" by a single string LUNCH...
View 2 Replies
View Related
Feb 25, 2011
I need to creates string suffixes out of a Reference string. for eg. suffixes of abcdefg will be
1)bcdefg
2)cdefg
3)defg
and so on...
create an array of pointers to point to the first few characters and then use that pointer to print the rest of the string.But when i print using the pointer i get GARBAGE values! shudn't std::cout<<ptr[w] print the string following the char it is pointing to? why do i get garbage values?
View 9 Replies
View Related
Apr 18, 2010
So if I'm given a location of a file like:
How can I just take the type of the file at the end? I know I can use strrchr() for a period to get the pointer to the period just before file type. Is there a build in string function that will just take the rest of the string from a certain point on forward in the string? I know it wouldn't be much work to make it myself, but I figured I would find out if it already existed before doing it.
View 9 Replies
View Related
Mar 13, 2010
Code:
The error is:
Code:
What I want to do is take input of ip4 as a string, convert it to an integer to add 1 to it, then reconvert it back to a string. Its not working.
My full code is:
Code:
View 1 Replies
View Related
Dec 8, 2010
i'm getting an undefined offset for the associative arrays [28-46] in this format.
[Code]....
i have read that i can prevent the notices by doing the following, but it's not working for me
PHP Code:
[Code]....
View 5 Replies
View Related
Oct 12, 2009
I've been given a custom-made string class which handles string, wstring and bstr. It has a number of methods and assignment operators to convert to and from different types. The app I work on compiles happily in VS6 and VS2008, but when trying to compile in Redhat (version 4.1.1 in Redhat 5.0)
[code]....
View 4 Replies
View Related
Nov 11, 2010
I have the following two type of strings1: A/D2: A/C/DI am trying to write a subroutine to check whether all of the letters in string 1 appears in string 2. If yes, return true. If not, return false. In the above example, all the letters (A and D) in string 1 are also present in string 2, so I return true.
View 4 Replies
View Related
Mar 26, 2011
Do I have the convert the int to a string using stringstream then convert the string to a char? or is there a more direct way?Also is there a way to tell the length of a int?
View 5 Replies
View Related
Nov 24, 2010
I have a serial port program which is reading a string .if(read(readfd,sResult,1)>0)where sResult is unsigned char sResult[10];if sResult is array of 10 then iam getting string perfectly but if iam making sResult only as unsigned char I am getting NULL value CODE BELOW
Code:
unsigned char sResult;
main()
{
readfd = open("/dev/ttyUSB0", O_RDONLY);
if (readfd == -1)
{
perror("READ: open_port: Unable to open /dev/ttyUSB0-
[Code]...
View 2 Replies
View Related
Feb 14, 2010
I have a clean install of Fedora 12 and trying to mount a second hard disk with data created under Fedora 8. Nautilus lists the hard disk and can see all the folders and files under Places > Computer. However, Nautilus only lists hte hard disk (/dev/sdc) but no partitions (e.g. sdc1, sdc2) under Filesystem. LVM shows Partition1, Partition2 and UnPartitioned space under /dev/sdc. LVM shows Partition2 as 'uninitialized Disk Entity /dev/sdc2'. If I try to 'Block Initialize' Partition2 (which is the largest listed partition), LVM warns all data in the partition will be erased. A partition with all the data is on the hard disk because Nautilus can see it but the partition is not listed under /dev/sdc so I can mount it.
View 7 Replies
View Related
Mar 8, 2010
When I run ddclient with an existing ddclient.cache file I get errors saying "uninitialized value" and the remote IP address does not get updated. This pretty much renders ddclient useless. If I delete the cache file then things work fine and the IP address *does* get updated (if need be). I happen to be running version 3.7.3 of ddclient but I've tried this with ddclient 3.8.0 and the result is exactly the same except that the line number in the error changes to line 2030.
Here's the code at that line number :
Code:
if ($config{$host}{'login'} eq '') {
warning("null login name specified for host %s.", $host);
I'm running ubuntu ( 9.04 I think ) and using zoneedit.com for dynamic dns.
Here's a transcript showing the problem.
root@ruby:/var/cache/ddclient# ddclient
[Code]...
View 7 Replies
View Related
Jan 6, 2011
I always manually check Update Manager and there are updates, but I never received any kind of notice indicating such. I thought some sort of popup or notice was supposed to appear in the panel or something to alert me that updates are available? Am I mistaken? Is there a setting I need to activate be alerted that updates are available?
View 9 Replies
View Related
Jun 20, 2011
i have upgraded a laptop to 11.04. doing so broke the wireless but i have fixed it.
i do not want the user to upgrade anymore so how do i turn off any future upgrade notices in the update manager?
View 1 Replies
View Related
Sep 13, 2010
I want normal substring of a string that actually is a url as follows
SITEURL/main.php?page=122&type=download_file&fileID=9&user Id=user1&org=org1&mainmenu=main1&submenu=sub1
What I want is a substring like below
org1_user1_main1_sub1
View 5 Replies
View Related
Dec 8, 2010
Which effect does the $ before the string have? This $ before a double-quoted string is used in many initscripts on Fedora 13, but not on Ubuntu 8.04.
View 2 Replies
View Related
Sep 20, 2009
I'm having problems completing my school exercises with awk.
Heres the desired outcome:
Code:
./my_awk 2
ACG GAG ATT AGG AGG ATC CCA CCA
CAC AGG ACG GAG ATT AGG AGG ATC
So it generates data in group of threes, 8 groups per row and prints it. My problem is that I can't seem to get awk to append stuff to string so I could print it nicely to screen. It just prints empty lines per the parameter given to it.
Heres my code so far:
Code:
#!/bin/sh
awk -v rows=$1 '
BEGIN {
[code]....
View 2 Replies
View Related
Jul 6, 2010
Iam trying to check a value less than or equals 0.The value iam getting is after doing grep a file . but its throwing error .
Code:
When i execute this it throws
Code:
View 8 Replies
View Related
Dec 27, 2008
I need to extract a price from a string, this may vary in the future so it may be 12.99 or 14.99. i thought a sed command might crack it and i need to write to a file:<td><b class="priceLarge">?6.99</b>I need to extract the price 6.99(with no ?)so extract anyhting between "> and </B> and write it to a file such as tmp1.txt .
View 1 Replies
View Related
Oct 23, 2010
i am compiling the following program in linux. it's in c language. after the compilation with gcc when i run the executable file. it asks for input. but when i enter a name. i prints "Segmentation fault" and then terminate the program. can you please help me.
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
[code]....
View 1 Replies
View Related
Aug 23, 2010
I am trying to monitor how long an ldap search takes and maybe notify or something that a search takes longer than say 10 seconds.
Code:
tail -n 1000 /var/log/ldap.log
for SRCH in $( cat monitorldap.log |grep 'SRCH'); do
echo search string is
echo $SRCH
[Code]....
ok, so to start off with it doesn't appear to get the whole line, just a piece "Aug". How can I get the whole line into a variable so I can then cut it up into the pieces I need?
View 4 Replies
View Related
Oct 29, 2009
I've got a problem...
a[0] = 22
echo $[a[0]]
echoes 22 - that works fine
[code]...
View 5 Replies
View Related