Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.physics > #625912 > unrolled thread
| Started by | Jeff-Relf.Me @. |
|---|---|
| First post | 2017-03-30 01:54 -0700 |
| Last post | 2017-04-10 13:53 +0000 |
| Articles | 20 on this page of 49 — 15 participants |
Back to article view | Back to sci.physics
I found a CostFree INN ( Usenet ) server that allows HTML. Jeff-Relf.Me @. - 2017-03-30 01:54 -0700
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-03-30 11:14 +0200
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-03-30 07:38 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. chrisv <chrisv@nospam.invalid> - 2017-03-30 07:17 -0500
No _serious programming language lacks "evil" macros ! ! Jeff-Relf.Me @. - 2017-03-30 13:07 -0700
21 lines, 74 columns, no macros. Jeff-Relf.Me @. - 2017-03-30 20:21 -0700
Re: No _serious programming language lacks "evil" macros ! ! Juha Nieminen <nospam@thanks.invalid> - 2017-04-03 06:12 +0000
No _serious programming language lacks "evil" macros ! ! Jeff-Relf.Me @. - 2017-04-03 00:42 -0700
Re: No _serious programming language lacks "evil" macros ! ! Juha Nieminen <nospam@thanks.invalid> - 2017-04-04 06:08 +0000
Re: No _serious programming language lacks "evil" macros ! ! Jerry Stuckle <jstucklex@attglobal.net> - 2017-04-04 09:06 -0400
Re: No _serious programming language lacks "evil" macros ! ! Jerry Stuckle <jstucklex@attglobal.net> - 2017-04-04 09:08 -0400
You know it's inlined when you can't set a break point on it. Jeff-Relf.Me @. - 2017-04-04 10:47 -0700
Re: You know it's inlined when you can't set a break point on it. Jerry Stuckle <jstucklex@attglobal.net> - 2017-04-04 14:08 -0400
Re: No _serious programming language lacks "evil" macros ! ! chrisv <chrisv@nospam.invalid> - 2017-04-04 07:23 -0500
Re: No _serious programming language lacks "evil" macros ! ! Silver-Tongued Heel <sl@im.er> - 2017-04-04 12:43 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. "jasper@shared-secrets.com" <jasper@shared-secrets.com> - 2017-04-10 00:58 +0000
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-04-10 08:36 +0200
Re: I found a CostFree INN ( Usenet ) server that allows HTML. chrisv <chrisv@nospam.invalid> - 2017-04-10 06:51 -0500
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-04-10 08:12 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-04-10 14:22 +0200
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-04-10 12:10 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-04-10 19:48 +0200
Re: I found a CostFree INN ( Usenet ) server that allows HTML. snipeco.2@gmail.com (Sn!pe) - 2017-04-10 19:12 +0100
Re: I found a CostFree INN ( Usenet ) server that allows HTML. chrisv <chrisv@nospam.invalid> - 2017-04-10 13:38 -0500
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-04-10 15:14 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Chris Ahlstrom <OFeem1987@teleworm.us> - 2017-04-10 18:52 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-04-10 19:22 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-04-10 15:13 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Snit <usenet@gallopinginsanity.com> - 2017-04-10 13:04 -0700
Re: I found a CostFree INN ( Usenet ) server that allows HTML. tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2017-04-10 22:07 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. chrisv <chrisv@nospam.invalid> - 2017-04-10 07:48 -0500
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-04-10 12:11 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Nomen Nescio <nobody@dizum.com> - 2017-04-11 07:33 +0200
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Snit <usenet@gallopinginsanity.com> - 2017-04-10 09:48 -0700
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-04-10 19:46 +0200
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Snit <usenet@gallopinginsanity.com> - 2017-04-10 11:05 -0700
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Cornelis Tromp <nobody@holland.remailer.nl> - 2017-04-11 06:41 +0100
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-04-10 08:12 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-04-10 14:22 +0200
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-04-10 12:13 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-04-10 19:44 +0200
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Snit <usenet@gallopinginsanity.com> - 2017-04-10 11:13 -0700
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Silver-Tongued Heel <sl@im.er> - 2017-04-10 15:17 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Snit <usenet@gallopinginsanity.com> - 2017-04-10 12:36 -0700
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-04-10 23:29 +0200
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Snit <usenet@gallopinginsanity.com> - 2017-04-10 14:41 -0700
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Chris Ahlstrom <OFeem1987@teleworm.us> - 2017-04-10 18:48 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Anonymous <anonymous@foto.nl1.torservers.net> - 2017-04-10 07:08 -0400
Re: I found a CostFree INN ( Usenet ) server that allows HTML. Fritz Wuehler <fritz@spamexpire-201704.rodent.frell.theremailer.net> - 2017-04-10 13:53 +0000
Page 1 of 3 [1] 2 3 Next page →
| From | Jeff-Relf.Me @. |
|---|---|
| Date | 2017-03-30 01:54 -0700 |
| Subject | I found a CostFree INN ( Usenet ) server that allows HTML. |
| Message-ID | <Jeff-Relf.Me@Mar.30--1.54A.Seattle.2017> |
I found a CostFree INN ( Usenet ) server that allows HTML. To Register ( in German ): http://open-news-network.org/register Once registered, use: News.MB-Net.NET:119 When you post, it puts your IP address in the header. It drops all posts from anonymous remailers, and such.
[toc] | [next] | [standalone]
| From | Peter Köhlmann <peter-koehlmann@t-online.de> |
|---|---|
| Date | 2017-03-30 11:14 +0200 |
| Message-ID | <obii4i$m36$1@dont-email.me> |
| In reply to | #625912 |
wrote: > I found a CostFree INN ( Usenet ) server that allows HTML. > To Register ( in German ): http://open-news-network.org/register > Once registered, use: News.MB-Net.NET:119 > > When you post, it puts your IP address in the header. > It drops all posts from anonymous remailers, and such. Please use HTML now exclusively. You know, I have set up my newsreader to drop HTML posts completely as those come from completely clueless cretins not worth reading That way it is a win-win situation: You can post your shite, and I will not see any of it.
[toc] | [prev] | [next] | [standalone]
| From | Silver-Tongued Heel <sl@im.er> |
|---|---|
| Date | 2017-03-30 07:38 -0400 |
| Message-ID | <U66DA.231284$XG2.131093@fx08.iad> |
| In reply to | #625913 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 30/03/17 05:14 AM, Peter Köhlmann wrote: > wrote: > >> I found a CostFree INN ( Usenet ) server that allows HTML. To >> Register ( in German ): http://open-news-network.org/register >> Once registered, use: News.MB-Net.NET:119 >> >> When you post, it puts your IP address in the header. It drops >> all posts from anonymous remailers, and such. > > Please use HTML now exclusively. > > You know, I have set up my newsreader to drop HTML posts completely > as those come from completely clueless cretins not worth reading > > That way it is a win-win situation: You can post your shite, and I > will not see any of it. ROFL. Peter made a great funny. - -- Silver Tongued-Heel Korora Linux Sponsor EFF & OpenMedia Member Gab.ai: @silverslimer -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJY3O40AAoJEECBkWZkIkW3bRIP/0eQ1Tz0+RVL7w7dfaYPDNR1 Uf+yAatfj3rgQ0QFhq12vLCxDK2Y9zv3koaXg2sPxey8qmIzqafsqZOSFUQUmwyO nclHwmXy1GqCaZaEGgZL0vv1PJF8CMmb4DaMTjE6axmK/CgkOcZGBIT5+xoeVpv8 ZdSiZRFGIDxe4vDOMhovz60LcAOB9BM/HEYwv9re1F3euQL2iwQhoKZOCzEBKrbl yR6xouM+jQYZElR90J0tEgPuzNrqnjCo2s7jP2cccZrvOkdS6oAFQEi/BjWt9d3O UqH9pyPMlNcq4a83eHgV92uHs7uDpE+cbr1N7hSmGX4ZWMQKFf8ACx/CR1Kwtn8S fx1Fv3xs1ZxkguzRHD1JaMwkaRk1ozIiDH6uZXYX99mA9RhggaEJg+hpsC54Mcav 42SFdc6MqedYokkgEc0+WLCcYYyMj0UxeVheM5N6m8GLe5HbzcnevpMMYn8JnG5T yGJkHKSR3LXBmEhGEDbQ+N9yiSaeaasBoeGQDwvDaaVMhoLSAPTesTprauNMctWl z5wRUWUO1YOVaGwSWZpb2xAJhfmSCWeRCWgAg5fQwCyEEwm4LOmuEKRS87GpPJ4l rPQOgqRGYAuJ9hCg5dfvuYuyC3y04SC5BMSxWK0M9VOQfslqB6BDac6WdeMDu5tu R5dFN6yZJSlR3BwSEX1w =erbg -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | chrisv <chrisv@nospam.invalid> |
|---|---|
| Date | 2017-03-30 07:17 -0500 |
| Message-ID | <njtpdc5354qqii10m80t3htjglscka44rs@4ax.com> |
| In reply to | #625913 |
Peter Köhlmann wrote: > Relf wrote: >> >> (gibber snipped) > >Please use HTML now exclusively. > >You know, I have set up my newsreader to drop HTML posts completely as those >come from completely clueless cretins not worth reading > >That way it is a win-win situation: You can post your shite, and I will not >see any of it. I don't see HTML, either. In any case, Relf is, of course, plonked. -- "(chrisv) claims (Relf's) code is shitty. Let's see him substantiate it with some facts and a code analysis." - Ezekreep
[toc] | [prev] | [next] | [standalone]
| From | Jeff-Relf.Me @. |
|---|---|
| Date | 2017-03-30 13:07 -0700 |
| Subject | No _serious programming language lacks "evil" macros ! ! |
| Message-ID | <Jeff-Relf.Me@Mar.30--1.07P.Seattle.2017> |
| In reply to | #625922 |
2 weeks ago, you ( DFS ) showed me your "readable and maintainable" code:
int isleapyear(int yr) {
if(((yr%4==0) && (yr%100!=0)) || (yr%400==0))
{return 0;}
return -1;
} // oackac$fve$1@dont-email.me
Then I showed you my "kooky and oddly formatted" version of it:
#define isLeapYear(y) ( !( y%400 ) || y%100 && !( y%4 ) )
No _serious programming language lacks "evil" macros ! !
Shannon Entropy ( poorly ) estimates:
the minimum number of bits needed to _encode data.
But I don't want to _encode/_decode anything; even if I did,
Shannon Entropy can't predict the algorithm I'd use.
In thermodynamics "entropy" is how uniform the heat energy is;
i.e. how _spent it is, so it can't produce "Work" ( force*distance ).
In cosmology, we call this "heat death", the end of all "life".
What does "spent energy" have to do with compression ? ! nothing.
[toc] | [prev] | [next] | [standalone]
| From | Jeff-Relf.Me @. |
|---|---|
| Date | 2017-03-30 20:21 -0700 |
| Subject | 21 lines, 74 columns, no macros. |
| Message-ID | <Jeff-Relf.Me@Mar.30--8.21P.Seattle.2017> |
| In reply to | #625988 |
You ( DFS ) asked me:
> > What does "spent energy" have to do with compression ? ! nothing.
>
> What's all this overmedicated rambling about?
"Shannon Entropy" is misnomer, and I've no use for it.
> It's a tiny program - around 50 lines probably
Yours was 62 lines, 90 columns, not counting the #includes;
mine is 21 lines, 74 columns, no macros, Sh() is printf( L"\n" ); to wit:
int Len, _Len, Row, Cnt ; float Dist, BitsRow, Bits ;
wchar_t TheCh, Data[] = L"Abbcccdddd1223334444" ;
Row = Bits = 0, Len = sizeof Data / sizeof *Data - 1 ;
Sh( L"%d Glyphs in \" %s \".", Len, Data );
Sh();
Sh( L" # Glyph Cnt Dist D*log2(D) H(X) sum ");
Sh( L" -- ----- --- ------ --------- ---------- ");
Row: Row++, _Len = Len, TheCh = Cnt = 0 ;
while( --_Len >= 0 ) { wchar_t &aCh = Data[ _Len ];
if ( !aCh ) continue ; if ( !TheCh ) TheCh = aCh ;
if ( aCh == TheCh ) aCh = 0, Cnt++ ; }
if ( !Cnt ) goto Done ;
Dist = float( Cnt )/Len, BitsRow = Dist*log2f( Dist ), Bits += BitsRow ;
Sh( L" %d %c %d %.3f %.3f %.5f ",
Row, TheCh, Cnt, Dist, BitsRow, -1*Bits ); goto Row ;
Done: Sh();
Sh( L" Shannon Entropy: %.5f bits. ", -1*Bits );
Sh( L" Metric Entropy: %.5f bits per Glyph. ", -1*Bits / Len );
// 20 Glyphs in " Abbcccdddd1223334444 ".
//
// # Glyph Cnt Dist D*log2(D) H(X) sum
// -- ----- --- ------ --------- ----------
// 1 A 1 0.050 -0.216 0.21610
// 2 b 2 0.100 -0.332 0.54829
// 3 c 3 0.150 -0.411 0.95883
// 4 d 4 0.200 -0.464 1.42322
// 5 1 1 0.050 -0.216 1.63932
// 6 2 2 0.100 -0.332 1.97151
// 7 3 3 0.150 -0.411 2.38205
// 8 4 4 0.200 -0.464 2.84644
//
// Shannon Entropy: 2.84644 bits.
// Metric Entropy: 0.14232 bits per Glyph.
[toc] | [prev] | [next] | [standalone]
| From | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| Date | 2017-04-03 06:12 +0000 |
| Subject | Re: No _serious programming language lacks "evil" macros ! ! |
| Message-ID | <obsp3m$11mu$1@adenine.netfront.net> |
| In reply to | #625988 |
In comp.lang.c++ Jeff-Relf.Me wrote: > Then I showed you my "kooky and oddly formatted" version of it: Who are you talking to? > #define isLeapYear(y) ( !( y%400 ) || y%100 && !( y%4 ) ) And you immediately show the danger of using macros. Just consider what happens if you call it eg. like isLeapYear(a+b). Even when you fix the macro, there's still the problem of calling it like isLeapYear(someReallyExpensiveFunctionThatTakesAMinuteToReturn()).
[toc] | [prev] | [next] | [standalone]
| From | Jeff-Relf.Me @. |
|---|---|
| Date | 2017-04-03 00:42 -0700 |
| Subject | No _serious programming language lacks "evil" macros ! ! |
| Message-ID | <Jeff-Relf.Me@Apr.3--0.42A.Seattle.2017> |
| In reply to | #626541 |
> > 2 weeks ago, you ( DFS ) showed me
> > your "readable and maintainable" code:
> >
> > int isleapyear(int yr) {
> > if(((yr%4==0) && (yr%100!=0)) || (yr%400==0))
> > {return 0;}
> > return -1;
> > } // oackac$fve$1@dont-email.me
> >
> > Then I showed you my "kooky and oddly formatted" version of it:
> >
> > #define isLeapYear(y) ( !( y%400 ) || y%100 && !( y%4 ) )
>
> Who are you talking to?
Mr. DFS, see above; the thread ( oldest first ):
JeffRelf Jeff-Relf.Me@Mar.30--1.54A.Seattle.2017
PeterKöhlmann obii4i$m36$1@dont-email.me
MrChrisV njtpdc5354qqii10m80t3htjglscka44rs@4ax.com
MrDFS obj166$7rj$3@dont-email.me
JeffRelf Jeff-Relf.Me@Mar.30--1.07P.Seattle.2017
Juha_Nieminen obsp3m$11mu$1@adenine.netfront.net
> Consider what happens if you call it eg. like isLeapYear(a+b).
> Even when you fix the macro, there's still the problem of calling it
> like isLeapYear(someReallyExpensiveFunctionThatTakesAMinuteToReturn()).
Thanks for dreaming up scary scenarios however,
like guns and knives, macros are useful too, not just dangerous.
No _serious programming language lacks "evil" macros.
Here's some more "scary" macros for you...
MicroSoft's WinMerge uses this this algorithm:
" Dynamic Programming | Set 4 (Longest Common Subsequence) "
http://www.geeksforgeeks.org/dynamic-programming-set-4-longest-common-subsequence/
My code, below, produces the same results as WinMerge:
// ScreenShot: http://Jeff-Relf.Me/Diff.PNG
// Help/Settings: http://Jeff-Relf.Me/X.HTM
// _FileCmp(), below, records thousands of matching lines ( text ),
// LeftOlder vs RightNewer, using the "LongestCommonSequence"
// ( shortest diffs ) algorithm.
//
// BB is a pointer to the start of
// a dynamic array of ( contiguous ) pointers ( lines );
// PP points to the end of the array.
//
// BB and PP are from the LeftOlder file.
// _BB and _PP are from the RightNewer file.
_FileCmp( LnA BB, LnA _BB, LnA PP, LnA _PP, LnT &Ln ) {
int Rows = PP - BB + 1, Cols = _PP - _BB + 1 ; u64 Row = Rows, Col = Cols ;
// Allocate a " LeftOlderLines * RightNewerLines " table of 32 bit integers
// to store all LongestCommonSequence Lengths.
pInt _Table = (pInt)MallocTmp( Rows * Cols * szInt );
{ LoopRow( Rows ) { LoopCol( Cols ) {
if ( !Row || !Col ) { Table( Row, Col ) = 0 ; continue ; }
if ( aMatch ) Table( Row, Col ) = Table( Row - 1, Col - 1 ) + 1 ;
else Table( Row, Col ) = ER( Table( Row, Col - 1 ), Table( Row - 1, Col ) ); } } }
// " Ln " is a dynamic array of thousands of ( contiguous ) 64 bit pointers,
// repurosed to store two 32 bit intergers ( Row and Col ) in a pointer.
// If both files are the same, with X Lines, it'll store X RowCol pairs.
//
// The first " StoreRowColumn ", below, stores the end of the files;
// the last is first, and vice versa; it's reversed.
Zero( Ln ), StoreRowColumn;
while ( Row > 0 && Col > 0 )
if ( aMatch ) StoreRowColumn ;
else Table( Row, Col - 1 ) > Table( Row - 1, Col ) ? Col-- : Row-- ; }
Near Globals:
// Access " _Table ", a One Dimensional array, as if it were Two Dimensional.
#define Table( i, j ) _Table[ ( j ) * Rows + i ]
// F[-1] is the ( 16 bit ) length of the leading whitespace.
#define aMatch ( F = BB[ Row - 1 ], _F = _BB[ Col - 1 ], F[-1] == _F[-1] && Eq( F, _F ) )
// Store the matching lines as line numbers from LeftOlder and RightNewer
#define StoreRowColumn ( Inc( Ln ) = LnP( Row - 1 << 32 | Col - 1 ), Row--, Col-- )
LnP F, _F ;
Far Globals:
#define Zero( X ) memset( & X, 0, sizeof X )
#define Eq !strCmp
#define LoopRows( N ) int Row = -1, eRow = ( N ) - 1 ; while ( ++Row <= eRow )
#define LoopCols( N ) int Col = -1, eCol = ( N ) - 1 ; while ( ++Col <= eCol )
typedef wchar_t wchar ; typedef wchar *LnP ; typedef LnP *LnA ;
typedef int *pInt ; typedef void *Void_P ; typedef unsigned __int64 u64 ;
const int szInt = sizeof( int );
struct LnT { LnA BB, PP, maxPP ; }; LnT Ln ;
// " Inc() ", below, dynamically allocates thousands of ( contiguous ) pointers.
// When diff is done, " Temp_Heap " is simply destroyed.
template < typename TyT, typename TyA, typename TyP >
TyP & Inc( TyT & Xx, int N ) { int I_PP, I_PP_New, I_maxPP, rv, Sz, Temp_Heap = N >= 0 ; if ( !Temp_Heap ) N = 1 ;
I_PP = !Xx.PP ? -1 : Xx.PP - Xx.BB, I_maxPP = !Xx.maxPP ? 0 : Xx.maxPP - Xx.BB, I_PP_New = I_PP + N ; if( I_maxPP < 0 ) exit(1);
if ( I_PP_New < I_maxPP ) { OK: return Xx.PP = Xx.BB + I_PP_New, *Xx.PP ; }
rv = ER( 1024, 3 * I_PP_New ), Sz = 16 + rv * szPtr ;
Xx.maxPP = Xx.BB = TyA( Temp_Heap ? ReAllocTmp( Xx.BB, ++I_PP * szPtr, Sz ) : realloc( Xx.BB, Sz ) ), Xx.maxPP += rv ;
if( !Xx.BB ) exit(1); goto OK ; }
LnP &Inc( LnT &Ln ) { return Inc< LnT, LnA, LnP>( Ln, 1 ) ; }
LnP ReAllocTmp( Void_P B⁰, int Sz⁰, int Sz ) { Void_P B = B⁰ ; if ( Sz > 0 && Sz > Sz⁰ ) B = MallocTmp( Sz );
if ( B⁰ && Sz⁰ > 0 ) memmove( B, B⁰, Sz⁰ ); return LnP( B ); }
[toc] | [prev] | [next] | [standalone]
| From | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| Date | 2017-04-04 06:08 +0000 |
| Subject | Re: No _serious programming language lacks "evil" macros ! ! |
| Message-ID | <obvd94$21u7$1@adenine.netfront.net> |
| In reply to | #626546 |
In comp.lang.c++ Jeff-Relf.Me wrote: >> > #define isLeapYear(y) ( !( y%400 ) || y%100 && !( y%4 ) ) >> Consider what happens if you call it eg. like isLeapYear(a+b). >> Even when you fix the macro, there's still the problem of calling it >> like isLeapYear(someReallyExpensiveFunctionThatTakesAMinuteToReturn()). > > Thanks for dreaming up scary scenarios however, Dreaming up scary scenarios... Something like isLeapYear(a+b) is not a stretch in any way. It's something that anybody would write. And your macro would give the wrong answer.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2017-04-04 09:06 -0400 |
| Subject | Re: No _serious programming language lacks "evil" macros ! ! |
| Message-ID | <oc05jg$p5m$1@jstuckle.eternal-september.org> |
| In reply to | #626761 |
On 4/4/2017 2:08 AM, Juha Nieminen wrote: > In comp.lang.c++ Jeff-Relf.Me wrote: >>>> #define isLeapYear(y) ( !( y%400 ) || y%100 && !( y%4 ) ) > >>> Consider what happens if you call it eg. like isLeapYear(a+b). >>> Even when you fix the macro, there's still the problem of calling it >>> like isLeapYear(someReallyExpensiveFunctionThatTakesAMinuteToReturn()). >> >> Thanks for dreaming up scary scenarios however, > > Dreaming up scary scenarios... Something like isLeapYear(a+b) is not > a stretch in any way. It's something that anybody would write. And your > macro would give the wrong answer. > And it is easily fixed by coding the macro correctly: #define isLeapYear(y) ( !( (y)%400 ) || (y)%100 && !( (y)%4 ) ) You can code incorrectly in *any* language. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2017-04-04 09:08 -0400 |
| Subject | Re: No _serious programming language lacks "evil" macros ! ! |
| Message-ID | <oc05mv$p5m$2@jstuckle.eternal-september.org> |
| In reply to | #626795 |
On 4/4/2017 9:06 AM, Jerry Stuckle wrote: > On 4/4/2017 2:08 AM, Juha Nieminen wrote: >> In comp.lang.c++ Jeff-Relf.Me wrote: >>>>> #define isLeapYear(y) ( !( y%400 ) || y%100 && !( y%4 ) ) >> >>>> Consider what happens if you call it eg. like isLeapYear(a+b). >>>> Even when you fix the macro, there's still the problem of calling it >>>> like isLeapYear(someReallyExpensiveFunctionThatTakesAMinuteToReturn()). >>> >>> Thanks for dreaming up scary scenarios however, >> >> Dreaming up scary scenarios... Something like isLeapYear(a+b) is not >> a stretch in any way. It's something that anybody would write. And your >> macro would give the wrong answer. >> > > And it is easily fixed by coding the macro correctly: > > #define isLeapYear(y) ( !( (y)%400 ) || (y)%100 && !( (y)%4 ) ) > > You can code incorrectly in *any* language. > (too fast on the send button) That still doesn't solve the problem of isLeapYear(j++). But it doesn't make macros any more or less evil than other statements. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Jeff-Relf.Me @. |
|---|---|
| Date | 2017-04-04 10:47 -0700 |
| Subject | You know it's inlined when you can't set a break point on it. |
| Message-ID | <Jeff-Relf.Me@Apr.4--10.47A.Seattle.2017> |
| In reply to | #626796 |
Jerry Stuckle, Juha Nieminen, Mr. DFS... this would be be better:
inline int isLeapYear( int y ) { return !( y%400 ) || y%100 && !( y%4 ); }
You know it's inlined when you can't set a break point on it.
Previously ( Jeff-Relf.Me@Mar.29--1.34P.Seattle.2017 ), I asked DFS: <<
Why reinvent the "mktime()" wheel, doesn't Python have it ?
i64 aDate ; tm DayRec = {};
DayRec.tm_mon = Month ; // 0..11
DayRec.tm_mday = DayOfTheMonth ; // 1..31
DayRec.tm_year = Year - 1900, aDate = mktime( &DayRec );
You can add 200 days to DayRec.tm_mday,
and call mktime( &DayRec ) to normalize .tm_mday to 1..31,
adjusting .tm_mon and .tm_year accordingly. >>
He didn't answer.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2017-04-04 14:08 -0400 |
| Subject | Re: You know it's inlined when you can't set a break point on it. |
| Message-ID | <oc0na4$obr$2@jstuckle.eternal-september.org> |
| In reply to | #626851 |
On 4/4/2017 1:47 PM, Jeff-Relf.Me@. wrote:
> Jerry Stuckle, Juha Nieminen, Mr. DFS... this would be be better:
>
> inline int isLeapYear( int y ) { return !( y%400 ) || y%100 && !( y%4 ); }
>
> You know it's inlined when you can't set a break point on it.
>
That isn't a macro.
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
[toc] | [prev] | [next] | [standalone]
| From | chrisv <chrisv@nospam.invalid> |
|---|---|
| Date | 2017-04-04 07:23 -0500 |
| Subject | Re: No _serious programming language lacks "evil" macros ! ! |
| Message-ID | <m247eclb5l1fpvdlffn6nrjebhk7l9cm3g@4ax.com> |
| In reply to | #626541 |
Juha Nieminen wrote: >In comp.lang.c++ Jeff-Relf.Me wrote: *plonk*
[toc] | [prev] | [next] | [standalone]
| From | Silver-Tongued Heel <sl@im.er> |
|---|---|
| Date | 2017-04-04 12:43 -0400 |
| Subject | Re: No _serious programming language lacks "evil" macros ! ! |
| Message-ID | <X2QEA.150545$I%4.42752@fx10.iad> |
| In reply to | #626791 |
On 2017-04-04 8:23 AM, chrisv wrote: > Juha Nieminen wrote: > >> In comp.lang.c++ Jeff-Relf.Me wrote: > > *plonk* LOL. -- Silver Tongued-Heel OpenMedia & EFF Member Gab.ai: @silverslimer
[toc] | [prev] | [next] | [standalone]
| From | "jasper@shared-secrets.com" <jasper@shared-secrets.com> |
|---|---|
| Date | 2017-04-10 00:58 +0000 |
| Message-ID | <XnsA752B6EE5BED8YVOK28@0.0.0.1> |
| In reply to | #625913 |
On 30 Mar 2017, Peter =?UTF-8?B?S8O2aGxtYW5u?= <peter-koehlmann@t-online.de> posted some news:obii4i$m36$1@dont-email.me: > wrote: > >> I found a CostFree INN ( Usenet ) server that allows HTML. >> To Register ( in German ): http://open-news-network.org/register >> Once registered, use: News.MB-Net.NET:119 >> >> When you post, it puts your IP address in the header. >> It drops all posts from anonymous remailers, and such. > > Please use HTML now exclusively. > > You know, I have set up my newsreader to drop HTML posts completely as > those come from completely clueless cretins not worth reading > > That way it is a win-win situation: You can post your shite, and I > will not see any of it. Now if you could only make Linux as useful and user fiendly as Windows.
[toc] | [prev] | [next] | [standalone]
| From | Peter Köhlmann <peter-koehlmann@t-online.de> |
|---|---|
| Date | 2017-04-10 08:36 +0200 |
| Message-ID | <ocf90k$3n0$1@dont-email.me> |
| In reply to | #628119 |
jasper@shared-secrets.com wrote: > On 30 Mar 2017, Peter =?UTF-8?B?S8O2aGxtYW5u?= > <peter-koehlmann@t-online.de> posted some > news:obii4i$m36$1@dont-email.me: > >> wrote: >> >>> I found a CostFree INN ( Usenet ) server that allows HTML. >>> To Register ( in German ): http://open-news-network.org/register >>> Once registered, use: News.MB-Net.NET:119 >>> >>> When you post, it puts your IP address in the header. >>> It drops all posts from anonymous remailers, and such. >> >> Please use HTML now exclusively. >> >> You know, I have set up my newsreader to drop HTML posts completely as >> those come from completely clueless cretins not worth reading >> >> That way it is a win-win situation: You can post your shite, and I >> will not see any of it. > > Now if you could only make Linux as useful and user fiendly as Windows. Why would I remove userfriendlyness and usefullness from linux to dumb it down to "windows standards"?
[toc] | [prev] | [next] | [standalone]
| From | chrisv <chrisv@nospam.invalid> |
|---|---|
| Date | 2017-04-10 06:51 -0500 |
| Message-ID | <g8smecd0e609bukfv31j8qknqo9gfsesiq@4ax.com> |
| In reply to | #628181 |
Peter Köhlmann wrote: > jasper@shared-secrets.com wrote: >> >> Now if you could only make Linux as useful and user fiendly as Windows. > >Why would I remove userfriendlyness and usefullness from linux to dumb it >down to "windows standards"? People tend to forget about the struggles that they have with Windows. Finding and installing all the software needed to make it useful, defending against malware... -- "The people I know using Windows have had zero infiltrations since 98 give or take" - Hadron "works for me (and everyone I know)" Quark
[toc] | [prev] | [next] | [standalone]
| From | Silver-Tongued Heel <sl@im.er> |
|---|---|
| Date | 2017-04-10 08:12 -0400 |
| Message-ID | <cFKGA.122780$Fv2.17107@fx02.iad> |
| In reply to | #628199 |
On 2017-04-10 7:51 AM, chrisv wrote: > Peter Köhlmann wrote: > >> jasper@shared-secrets.com wrote: >>> >>> Now if you could only make Linux as useful and user fiendly as Windows. >> >> Why would I remove userfriendlyness and usefullness from linux to dumb it >> down to "windows standards"? > > People tend to forget about the struggles that they have with Windows. > Finding and installing all the software needed to make it useful, > defending against malware... Doing all of that isn't very difficult; it's doing everything necessary to get _rid_ of the malware which made its way onto your system despite all of your best efforts that is difficult. -- Silver Tongued-Heel OpenMedia & EFF Member Gab.ai: @silverslimer
[toc] | [prev] | [next] | [standalone]
| From | Peter Köhlmann <peter-koehlmann@t-online.de> |
|---|---|
| Date | 2017-04-10 14:22 +0200 |
| Message-ID | <ocft93$trg$2@dont-email.me> |
| In reply to | #628203 |
Silver-Tongued Heel wrote: > On 2017-04-10 7:51 AM, chrisv wrote: >> Peter Köhlmann wrote: >> >>> jasper@shared-secrets.com wrote: >>>> >>>> Now if you could only make Linux as useful and user fiendly as Windows. >>> >>> Why would I remove userfriendlyness and usefullness from linux to dumb >>> it down to "windows standards"? >> >> People tend to forget about the struggles that they have with Windows. >> Finding and installing all the software needed to make it useful, >> defending against malware... > > Doing all of that isn't very difficult; it's doing everything necessary > to get _rid_ of the malware which made its way onto your system despite > all of your best efforts that is difficult. > It is not "difficult". It is impossible
[toc] | [prev] | [next] | [standalone]
Page 1 of 3 [1] 2 3 Next page →
Back to top | Article view | sci.physics
csiph-web