The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,769 other followers

Archive for the ‘C’ Category

Teach Yourself C++ in 21 days…

Posted by jpluimers on 2019/10/10

[WayBackAbtruse Goose: Teach Yourself C++ in 21 days…

Via: [WayBack] “How to learn programming in 21 Days” – CodeProject – Google+

Read the rest of this entry »

Posted in C, C++, Development, Fun, Software Development | Leave a Comment »

This is why I try to avoid C, as it means handling code from others that shoot in foots

Posted by jpluimers on 2019/08/07

Via [WayBack] Hello, I’m translating some C code to Delphi and found something that surprise me…is it logical that this code compiles ? – Paul TOTH – Google+

Maintaining C means you need to be aware that other people like shooting at foots (yes, that is a grammar error by intent):

#include 
#include 

void test();

void test2() {
  test();
}

void test(char *msg) {
  printf("test called '%s' (%d)\n", msg, strlen(msg));
}

void main() {
  test2();
}

Of course!? with gcc under Ubuntu the result is

test called 'test' (4)

Code is derived from [Archive.isgit hub user fogleman project Craft search db_worker_start

The thread has some nice comments.

–jeroen

Posted in C, Development, Software Development | Leave a Comment »

Design Patterns & Refactoring

Posted by jpluimers on 2019/07/16

Design Patterns and Refactoring articles and guides. Design Patterns video tutorials for newbies. Simple descriptions and full source code examples in Java, C++, C#, PHP and Delphi.

Source: [WayBackDesign Patterns & Refactoring.

And indeed a lot of examples in Delphi too; few sites have that: Delphi site:sourcemaking.com.

–jeroen

Via: [WayBack] I stumbled upon this yesterday, very informative, accessible and also with Delphi examples – among other languages. – Steffen Nyeland – Google+

Posted in .NET, C, C#, C++, Delphi, Design Patterns, Development, Java, Java Platform, PHP, Scripting, Software Development | Leave a Comment »

Calculating CRC with a tiny (32 entry) lookup-table | Lentz family blog

Posted by jpluimers on 2019/06/27

For my archive:

I happened to notice that the Arduino OneWire library uses a 256 entry lookup table for its CRC calculations.

I did some research on this topic in 1992-1993, while working on Bulletin Board Systems, FidoNet code and file transfer protocols.

These days memory is not at a premium on most computers, however on Arduino and microcontroller environments it definitely is, and I happen to know that table-lookup CRC can be done using two 16-entry tables!

So I’ve dug up my documentation and code from the time, and applied it to the CRC-8 calculation for the Maxim (Dallas Semiconductor) OneWire bus protocol.

I think this provides a neat trade-off between code size and speed.

License For any of the below code, apply the following license (2-clause “simplified” BSD license), which should suffice for any use. If you do require another license, just ask.

Source: [WayBack/Archive.isCalculating CRC with a tiny (32 entry) lookup-table | Lentz family blog

The example on the page is for the CRC-8 implementation used in the [WayBack] 1-Wire Communication protocol – Wikipedia.

The generator works for CRC-8, CRC-16 and CRC-32 polynomials and can be downloaded here:

–jeroen

 

Posted in Algorithms, C, Development, Software Development | Leave a Comment »

WouterVanNifterick/C-To-Delphi: C To Delphi converter

Posted by jpluimers on 2019/06/25

For my link archive: [WayBack] WouterVanNifterick/C-To-Delphi: C To Delphi converter

Via: [WayBack] Does anyone know of a C/C++ to Delphi converter? – Michael Riley – Google+

–jeroen

Posted in C, Delphi, Development, Software Development | 2 Comments »

 
%d bloggers like this: