Saturday, March 6, 2010

comp.lang.c - 8 new messages in 7 topics - digest

comp.lang.c
http://groups.google.com/group/comp.lang.c?hl=en

comp.lang.c@googlegroups.com

Today's topics:

* usage of size_t - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/19e0ad96d01b9898?hl=en
* how to get out of double for loops? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/535cb24e8f02aec3?hl=en
* Stylistic questions on UNIX C coding. - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c/t/51d2b24a60d73f18?hl=en
* A bit resistant to disruption - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/a5ddb7c1aa07c7e5?hl=en
* Can characters ever be promoted to 'unsigned int'? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/587c62aac32134b4?hl=en
* #### GAYS VS LESIBIANS FOUGHT FOR XXX #### - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/24647af7f0c04af7?hl=en
* Invitation to Codefest 10 - Online Coding Festival - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/7188b5a197bd73f1?hl=en

==============================================================================
TOPIC: usage of size_t
http://groups.google.com/group/comp.lang.c/t/19e0ad96d01b9898?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Mar 5 2010 5:26 pm
From: Keith Thompson


lawrence.jones@siemens.com writes:
> Keith Thompson <kst-u@mib.org> wrote:
>> My current opinion is that (a) an implementation is permitted to
>> allow the creation of objects bigger than SIZE_MAX bytes, (b) an
>> implementation is definitely not *required* to allow the creation
>> of such objects, and (c) most or all implementations do and should
>> disallow the creation of such objects, simply by making size_t big
>> enough to represent the size of any possible object.
>
> From what I remember of the discussions, the sense of the committee is
> that implementations should not allow the declaration of objects bigger
> than SIZE_MAX bytes, but there's really no way to forbid it in the
> standard.

Why couldn't it be a constraint violation (at least for non-VLAs)?

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

==============================================================================
TOPIC: how to get out of double for loops?
http://groups.google.com/group/comp.lang.c/t/535cb24e8f02aec3?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Mar 5 2010 5:33 pm
From: MBALOVER


Thanks a lot, guys.

This group is really helpful.

I learn a lot from your answers.

Best

==============================================================================
TOPIC: Stylistic questions on UNIX C coding.
http://groups.google.com/group/comp.lang.c/t/51d2b24a60d73f18?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, Mar 5 2010 6:01 pm
From: lacos@ludens.elte.hu (Ersek, Laszlo)


In article <LeadnUHKaP2DCgzWnZ2dnUVZ8vxi4p2d@brightview.co.uk>, Tim Streater <timstreater@waitrose.com> writes:
> On 05/03/2010 22:29, Ersek, Laszlo wrote:
>> In article<lnmxymsesg.fsf@nuthaus.mib.org>,
>> Keith Thompson<kst-u@mib.org> writes:
>>
>>> Would you even consider writing '7 == x' rather than 'x == 7'
>>> if C's equality and comparison operators were more distinct?
>>>
>>> For example, consider a hypothetical C-like language in which the
>>> equality operator is spelled "=" and the assignment operator is
>>> "<-", and "==" is a syntax error. (Yes, that would quietly break
>>> "x<-1"; let's ignore that.)
>>>
>>> In such a language, would you ever write "if (7 = x)" in preference
>>> to "if (x = 7)"? If so, why?
>>
>> No, I would not have picked up the "7 == x" style in that case.
>>
>> For example, Pascal has := for assignment and = for equality (IIRC :)). Even
>> in C, I started out with "x == 7". I was occasionally bitten by
>> "if (x = 7)" typos. Not very frequently, and most of the time caught by
>> compiler warnings. However, on some forum somebody brought up "7 == x"
>> explicitly, and after giving the idea my unrelenting attention :) for a
>> minute or two, I liked it so much that I trained myself to it.
>
> What about maintenance? Someone later will look at that and waste half a
> day trying to see if there's some reason it's written that way.

You are right.

In a pro setting, I'll participate when the coding style is set, and
then I'll follow it. If no coding style is set at all, I'll have my
share of the guerilla development. I may hint at the necessity of a
coding style, but I won't fight for it, because I hate politics, and
some co-workers always take it as an attack on their authority. I help
with creating guidelines the best I can when I'm asked, but I'm no
enforcer.

In a hobbyist setting, like I've been coding C recently, I don't care.
(The word being "hobby", not "unpaid job". (Hobby doesn't imply low
quality (hopefully!), just that I'm my boss and my customer.)) I don't
code for users and I work alone. I code for myself and am happy if
others benefit too. (... Though it seems they can prod me into more
work.)

Cheers,
lacos


== 2 of 2 ==
Date: Fri, Mar 5 2010 10:45 pm
From: Richard Heathfield


Ersek, Laszlo wrote:
> In article <LeadnUHKaP2DCgzWnZ2dnUVZ8vxi4p2d@brightview.co.uk>, Tim Streater <timstreater@waitrose.com> writes:
>> On 05/03/2010 22:29, Ersek, Laszlo wrote:

<snip>

>>> However, on some forum somebody brought up "7 == x"
>>> explicitly, and after giving the idea my unrelenting attention :) for a
>>> minute or two, I liked it so much that I trained myself to it.
>> What about maintenance? Someone later will look at that and waste half a
>> day trying to see if there's some reason it's written that way.
>
> You are right.

No, he isn't. :-) Anyone who wastes half a day on understanding 7==x is
not the kind of person you want maintaining C code in the first place.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within

==============================================================================
TOPIC: A bit resistant to disruption
http://groups.google.com/group/comp.lang.c/t/a5ddb7c1aa07c7e5?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Mar 5 2010 6:59 pm
From: Thad Smith


Francois Grieu wrote:
> Thad Smith wrote :
>>
>> After having two previous attempts shot down, I have two more
>> proposals.
...
>> State ba Powerup sequence
>> p1 00 p1, p2, s1
>> p2 01 p2, p1, p2, s1
>> s1 11 s1, p2, p1, p2, s1
>> s2 10 erase a (a=0)
>>
>> On powerup, perform the indicated powerup sequence. Powerup in s2
>> erases a, all others erase both bits and return to s1. With power on,
>> toggle bit a to go from s1 to s2. Going from s2 to s1 is a program
>> without erase.
>
> Well, let's attack that..
>
> We are moving from s1 to s2, thus erase a;
> disruption occurs, cells are left 1?
>
> On power-up we read 11, that is s1, and proceed to move to p2
> that is erase b; disruption, cells are left ??
>
> On power-up we read 10, and erase a (that's during bRead);
> cells are now ?0; we believe we are in state s2 (the test
> program lights in some color)
>
> Disruption occurs outside bRead/bToggle (with the light on),
> after bRead, thus with the bit supposedly stable.
>
> On power-up we read 00, and proceed to s1 without disruption;
> we believe we are in state s1 (the test program lights in
> some other color). This breaks the stability rule, bust.
>
> If there is a solution with two cells, I quit programming.

It's been a while now. Here is another attempt at minimal bit implementation.
This is another "game" solution (powerup activity for both resting states). The
powerup operations can be done on the first call to read the non-volatile bit.

State ba Powerup sequence
s0 00 erase b,a
s1 01 erase b, p3, p2, p3, s1
p2 10 erase a, p3, s1
p3 11 s1, p3, p2, p3, p1

The resting states are s0 and s1.
Programmed transitions:
s0 to s1: s0, s1
s1 to s0: s1, s0

The programmed transitions are a bit erase or program on "a". After the powerup
sequence is done both bits are stable.


--
Thad

==============================================================================
TOPIC: Can characters ever be promoted to 'unsigned int'?
http://groups.google.com/group/comp.lang.c/t/587c62aac32134b4?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Mar 5 2010 7:08 pm
From: markhobley@hotpop.donottypethisbit.com (Mark Hobley)


Tim Rentsch <txr@x-alumni2.alumni.caltech.edu> wrote:
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
> and read section 6.2.5, paragraph 8.

For the benefit of those of us who hate having to fire up a pdf reader, just
to try and follow a usenet thread, that paragraph simply reads:

For any two integer types with the same signedness and different conversion
rank, the range of values of the type with smaller integer conversion rank is
a subrange of the values of the other type.

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/


==============================================================================
TOPIC: #### GAYS VS LESIBIANS FOUGHT FOR XXX ####
http://groups.google.com/group/comp.lang.c/t/24647af7f0c04af7?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Mar 5 2010 10:23 pm
From: malathi 1104


#### GAYS VS LESIBIANS FOUGHT FOR XXX ####

http://sites.google.com/site/nitesexy

FOR FURTHER INFORMATION VISIT & DOWNLOAD INFORMATIONSS

http://sites.google.com/site/nitesexy

==============================================================================
TOPIC: Invitation to Codefest 10 - Online Coding Festival
http://groups.google.com/group/comp.lang.c/t/7188b5a197bd73f1?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Mar 5 2010 10:56 pm
From: noobcoder


Hello,

With immense pleasure we, on behalf of Department of Computer Engineering, IT-BHU, invite you to participate in an Online Coding festival, Codefest http://itbhu.ac.in/codefest , which had started on 25th January and will last till 31st March, 2010. It includes exciting competitions on Application Development, Algorithms, Programming & Logic and Mathematics and is open for participation from students & professionals all over the globe.

There are prizes worth more than 260,000 INR (approx $5600) in this mega event besides certificates and goodies.

Till now there have been about 1800 registrations on the website from more than 540 different institutions round the globe which includes more than 80 professional participants.

Event Details

* Manthan : An algorithm intensive programming competition on the lines of ACM-ICPC, to be hosted on Codechef. Scheduled on Mar 14. Prizes worth more than 40,000 INR. Codechef T-shirts for winners.
* Perplexed! : Hughes Systique sponsored C obscure Programming Competition, to get in-depth knowledge of C. Scheduled on Mar 21. Prizes worth more than 25,000 INR. Codechef T-shirts for winners.
* MathMania : An event with Challenging Mathematical Problems as in Project Euler. Scheduled on Mar 13. Prizes worth more than 20,000 INR.


Register and form your teams now!
Still have any doubts? Please go through our FAQ . Post your queries at Codefest forum or email us at codefest@itbhu.ac.in.

Team Codefest.
Visit us at http://itbhu.ac.in/codefest/
Follow us at http://twitter.com/c0defest
Mail us at codefest@itbhu.ac.in

---
frmsrcurl: http://compgroups.net/comp.lang.c++/


==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c?hl=en

To unsubscribe from this group, send email to comp.lang.c+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate