John de la Garza | 20 Oct 00:14 2014

Re: byte copy

On Mon, Oct 20, 2014 at 12:12:06AM +0200, Bogdan Cristea wrote:
> 
> > On 20 Oct 2014, at 00:10, John de la Garza <john <at> jjdev.com> wrote:
> > 
> > On Sun, Oct 19, 2014 at 11:42:26PM +0200, Bogdan Cristea wrote:
> >> 
> >>> On 19 Oct 2014, at 23:32, John de la Garza <john <at> jjdev.com> wrote:
> >>> 
> >>> Can anone see why these two pieces of code would behave differently?
> >>> They are used in a mergesort merge
> >>> 
> >>> the top one ends up with c (cp points to an offset in c)
> >>> 1 2 3 1
> >>> 
> >>> the bottom one (not commented out)
> >>> results in 1 2 3 4 (correct)
> >>> 
> >>>       /*
> >>>       if (alen == 0)
> >>>               memcpy(cp, bp, blen);
> >>>       else if (blen == 0){
> >>>               memcpy(cp, ap, alen);
> >>>       }
> >>>       */
> >>>       if (alen == 0)
> >>>               while (blen--)
> >>>                       *cp++ = *bp++;
> >>>       else
> >>>               while (alen--)
> >>>                       *cp++ = *ap++;
(Continue reading)

John de la Garza | 20 Oct 00:10 2014

Re: byte copy

On Sun, Oct 19, 2014 at 11:42:26PM +0200, Bogdan Cristea wrote:
> 
> > On 19 Oct 2014, at 23:32, John de la Garza <john <at> jjdev.com> wrote:
> > 
> > Can anone see why these two pieces of code would behave differently?
> > They are used in a mergesort merge
> > 
> > the top one ends up with c (cp points to an offset in c)
> > 1 2 3 1
> > 
> > the bottom one (not commented out)
> > results in 1 2 3 4 (correct)
> > 
> >        /*
> >        if (alen == 0)
> >                memcpy(cp, bp, blen);
> >        else if (blen == 0){
> >                memcpy(cp, ap, alen);
> >        }
> >        */
> >        if (alen == 0)
> >                while (blen--)
> >                        *cp++ = *bp++;
> >        else
> >                while (alen--)
> >                        *cp++ = *ap++;
> > 
> > 
> > if you want to read it with more context see below
> > ---------------------------------------------------
(Continue reading)

John de la Garza | 19 Oct 23:44 2014

byte-copy

firgured it out...

I was passing size, but needed to pass size * sizeof(int)
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

John de la Garza | 19 Oct 23:32 2014

byte copy

Can anone see why these two pieces of code would behave differently?
They are used in a mergesort merge

the top one ends up with c (cp points to an offset in c)
1 2 3 1

the bottom one (not commented out)
results in 1 2 3 4 (correct)

        /*
        if (alen == 0)
                memcpy(cp, bp, blen);
        else if (blen == 0){
                memcpy(cp, ap, alen);
        }
        */
        if (alen == 0)
                while (blen--)
                        *cp++ = *bp++;
        else
                while (alen--)
                        *cp++ = *ap++;

if you want to read it with more context see below
---------------------------------------------------

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

(Continue reading)

Yichao Yu | 16 Oct 22:31 2014
Picon

Re: Show application performance/errors from pseudo file

Resend as plain text.

On Thu, Oct 16, 2014 at 4:01 PM, Yichao Yu <yyc1992 <at> gmail.com> wrote:
>
>
> On Thu, Oct 16, 2014 at 3:50 PM, Daniel Hilst Selli <danielhilst <at> gmail.com>
> wrote:
>>
>> I'm writing a new application and would be nice to have a pseudo file
>> showing its status, just the way that procfs does with kernel.
>> I'm looking for sugestions, I want to `cat' files contents and have
>> something similar to /proc/meminfo
>>
>> First I think using named pipes, but, AFAIK, pipes would retain data
>> writed until someone read it, what I thought is a kind of read
>> hook that only show data when asked for. Here are a few requisites,
>>
>> - Don't retain data
>> - Don't generate disk I/O
>> - Vanish when application stops
>> - Work with a simple cat or something similar..
>
>
> You should have a look at fuse[1].
>
> [1] http://fuse.sourceforge.net/
>
>>
>>
>> With that in mind I think about using unix domain sockets.. it seems to
(Continue reading)

Daniel Hilst Selli | 16 Oct 21:50 2014
Picon

Show application performance/errors from pseudo file

I'm writing a new application and would be nice to have a pseudo file showing its status, just the way that
procfs does with kernel.
I'm looking for sugestions, I want to `cat' files contents and have something similar to /proc/meminfo

First I think using named pipes, but, AFAIK, pipes would retain data writed until someone read it, what I
thought is a kind of read
hook that only show data when asked for. Here are a few requisites,

- Don't retain data
- Don't generate disk I/O
- Vanish when application stops
- Work with a simple cat or something similar..

With that in mind I think about using unix domain sockets.. it seems to fit all requisites, for
the fourth requisite I could use netcat, that is almost cat,

Cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

dp | 8 Oct 20:41 2014
Picon
Picon

(unknown)

       auth 9628bfa8 subscribe linux-c-programming \
         dee.pi <at> att.net

--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Vladimir Murzin | 16 Sep 15:47 2014
Picon

(unknown)

unsubscribe linux-c-programming
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Benjamin Siegmund | 25 Aug 17:30 2014
Picon

Help improving the future of debugging

Dear C Developers,

since 1974 researchers and software developers try to ease software
debugging. Over the last years, they created many new tools and
formalized methods. We are interested if these advancements have
reached professional software developers and how they influenced their
approach. To find this out, we are conducting an Online Survey for
Software Developers. From the results we expect new insights into
debugging practice that help us to suggest new directions for future
research. So if you are a software developer or know any software
developers, you can really help us.  The survey is, of course, fully
anonymous and will take about 15 minutes to fill out. Feel free to
redistribute this message to anyone who you think might be interested.
The survey can be reached at:

http://www.uni-potsdam.de/skopie-up/index.php/689349

Thank you for your interest,
Benjamin Siegmund
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

support51 | 24 Aug 20:12 2014

A recommendation from His & Hers Benz Are On Order. Are Yours?


Hello,


Hey Friend,

Justin Corelli spends a lot time pinching himself to 
make sure he’s not dreaming.

After struggling with money for years, banking $12,000 
a day is now the norm for him.

What would YOU do with money like that?

Justin has two Mercedes Benz’s on the way!

Here’s how he’s doing it:

==> http://pakerpaker.14million.cpa.clicksure.com


Aussie Millionaire Stan Lutz is opening the door to a 
new life for a fortunate few lucky people.

You don’t need any experience and you don’t need a lot 
of money to start out with.

But when he takes you “under his wing”…

The HUGE PROFITS start coming in OVERNIGHT!

(Continue reading)

Ziyan Zhou | 18 Aug 06:46 2014
Picon

New comer say hello.

Hi All,

A test email. I'm sorry to trouble you.

Thanks
zy
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane