Search Results

Search: Posts Made By: homeboy
Forum: Programming 01-07-2012
1,492
Posted By Corona688
It's writing 20 bytes to an array 4 bytes long,...
It's writing 20 bytes to an array 4 bytes long, rampaging 16 more bytes across memory it shouldn't, trashing things like local variable values, function parameters, and return locations, all of which...
8,401
Posted By ahamed101
Trapping kill is not possible, atleast as far I...
Trapping kill is not possible, atleast as far I know. May be you can optimize the script for better performance and cpu utilization. If you can present the script, m ay be we can have a look.

But...
Forum: Programming 03-11-2011
2,693
Posted By jlliagre
It isn't the same, at least with my tests here....
It isn't the same, at least with my tests here. cin.sync() doesn't flush the buffer so I experience the same issue with it. Reading cin in a string breaks the endless loop.
4,346
Posted By radoulov
I don't know, I asked on c.u.s., this is the...
I don't know, I asked on c.u.s., this is the releveant part of the Advanced Bash-Scripting Guide (http://tldp.org/LDP/abs/html/io-redirection.html):

# Redirecting only stderr to a pipe.
exec...
Forum: Programming 03-07-2011
1,991
Posted By Corona688
and left the remaining 99% of the structure as...
and left the remaining 99% of the structure as garbage, looks like. See 'man sigaction', most of them are important.
Forum: Programming 03-06-2011
1,238
Posted By odys
I would suggest to have array of integers to...
I would suggest to have array of integers to permute. It can be initialized with A[i]=i
so no need to sort strings.
Then use permuted indexes to access strings.
Forum: Programming 03-06-2011
1,991
Posted By achenle
So, what are the contents of your "struct...
So, what are the contents of your "struct sigaction sa" when you make the call to sigaction()?
6,373
Posted By Scott
A : would mean "true". I tested a . in bash (not...
A : would mean "true". I tested a . in bash (not in Ubuntu) and it throws an error.

If your user was missing a home directory, you probably just forgot to specify it when running useradd.

You...
6,373
Posted By Scott
You logged in as someone who had no home...
You logged in as someone who had no home directory, and despite not being able to create a file, you copied a file called "script" into that directory?

So you copied a file, something you are...
Forum: Programming 03-04-2011
2,241
Posted By Corona688
You should be using references though! Otherwise...
You should be using references though! Otherwise it creates a copy ever time which is very slow. You just have to make it a const reference.
Forum: Programming 03-04-2011
2,241
Posted By Corona688
The objects don't have to be const, it's enough...
The objects don't have to be const, it's enough that your function treats them as such; it's a safety feature. The references being const stops you from writing any members, and prevents you from...
784
Posted By Perderabo
If ten people log in for 5 hours the total is 50...
If ten people log in for 5 hours the total is 50 hours. This is still true if all ten people are actually the same guy.
Forum: Programming 02-16-2011
1,483
Posted By Corona688
template<class ForwIter,class Predicate> ...
template<class ForwIter,class Predicate>
ForwIter std::remove_if(ForwIter beg,ForeIter end,Predicate op)
{
//A copy of "op" is created inside find_if effectively
// as a local...
Forum: Programming 02-14-2011
2,597
Posted By pludi
Those projects where there's enough to be done...
Those projects where there's enough to be done aren't small projects, that much is true. Check freshmeat.net (http://freshmeat.net) for projects using C++ on Linux released under the terms of the GPL...
Forum: Programming 02-14-2011
2,597
Posted By pludi
From my point, the whole idea of programming (no...
From my point, the whole idea of programming (no matter what language) is to implement algorithms to solve certain problems. With C++ (and other OOP languages) many of the often-used algorithms are...
2,095
Posted By Perderabo
$ exec ksh $ set +o emacs vi $ # now press up...
$ exec ksh
$ set +o emacs vi
$ # now press up arrow key
$ ^[[A


Note that ^[ is the escape character. In that script \e also represents the escape character.
5,134
Posted By Perderabo
pidof is a program that returns pids that are...
pidof is a program that returns pids that are already running. A child process is needed to get pidof running. Then pidof scans the running processes are reports its findings then exits. It does...
2,095
Posted By Franklin52
Maybe this is what you're looking for: ...
Maybe this is what you're looking for:

https://www.unix.com/shell-programming-scripting/107637-detect-f5-pressed.html
5,134
Posted By jim mcnamara
What is this script supposed to do? ...
What is this script supposed to do?

PIDS=$(pidof sh $0)


creates a child process; I do not see any wait command. What is it you want the script to do?

One standard way to create multiple...
2,588
Posted By Corona688
What's this $_? The PID is $! The evals do...
What's this $_? The PID is $!

The evals do nothing, yes.

Could you copy-paste your script exactly as you have it? I think there must be some slight error somewhere that's throwing it off.
...
2,588
Posted By Perderabo
I tried that code. I set TIMEOUT to 7 and I...
I tried that code. I set TIMEOUT to 7 and I replaced hanging_jobs with "sleep 3" and "sleep 100". The code works fine. I removed the evals and tried it again. Still works fine. While those...
5,506
Posted By Scrutinizer
Remarkable. + is not a concatenation character in...
Remarkable. + is not a concatenation character in awk, but it does something here. But what?
....
I think I figured it out. The + sign forces what follows into numerical context, but also what...
2,533
Posted By Corona688
'file2' can be any length, but it actually has to...
'file2' can be any length, but it actually has to load all of file1 into memory at once! On a 32-bit computer, this may not even be possible even if you have gigs of memory due to 32-bit addresss...
Forum: Programming 01-25-2011
6,535
Posted By Perderabo
Just look at the return code. All system calls...
Just look at the return code. All system calls return -1 if they fail and they set errno. If you fstat an fd that is not open the fstat will fail. It will return -1 and set errno to EBADF. If it...
Forum: Programming 01-24-2011
6,535
Posted By Perderabo
I would just close 7 and then dup until I finally...
I would just close 7 and then dup until I finally get 7. Then close 4 through 6 or whatever. But if 5 was already open, the dup loop will go from 4 straight to 6 and in this case you should not...
Showing results 1 to 25 of 27

 
All times are GMT -4. The time now is 05:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy