Archive for the ‘C’ Category
Posted by jpluimers on 2015/09/02
If ever in need to translate C/C++ headers or code to Delphi, this refernece by Rudy Velthuis – a dentist with a strong interest in programming – is the best I could find: Rudy’s Delphi Corner – Pitfalls of converting.
It is written in a pretty version agnostic way, and covers the vast majority of conversion topics.
And it has been updated over time numerous times.
–jeroen
Posted in Borland C++, C, C++, C++ Builder, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 10 Comments »
Posted by jpluimers on 2015/06/18
Almost two years ago, I wrote “the only issues missing are #28, #30 and #31.”. As of mid May any more:
All of them are from the 5th anniversary year.
–jeroen
via 2 More Old Micro Cornucopia issues on BitSavers from 1986 « The Wiert Corner – irregular stream of stuff.
Posted in 6502 Assembly, Assembly Language, BitSavers.org, C, C++, Development, History, Pascal, Software Development, Turbo Pascal | Leave a Comment »
Posted by jpluimers on 2015/01/22
Wow: I feel like having lived under a stone for 8 years, as RosettaCode has been alive since it was founded in 2007 by Mike Mol.
The idea is that you solve a task and learn from that, or learn by seeing how others have solved tasks or draft tasks.
So in a sense it is similar to the Rosetta stone: it has different languages phrasing the same tasks.
There are already a whole bunch of languages on RosettaCode (of which a few are in the categories below), and you can even suggest or add your own languages.
When you want to solve tasks, be sure to look at the list unimplemented tasks by language that leads to automatic reports by language (for instance two of the languages I use most often: C# and Delphi).
I’m sure there are lots of programming chrestomathy sites, even beyond the ones, and it feels very similar to programming kata sites.
–jeroen
Posted in .NET, APL, Awk, bash, Batch-Files, C, C#, C++, COBOL, CommandLine, Delphi, Development, Fortran, FreePascal, Java, JavaScript/ECMAScript, Lazarus, Object Pascal, Office VBA, Pascal, Perl, PHP, PowerShell, PowerShell, Prism, Scripting, sed script, Sh Shell, Software Development, Turbo Prolog, VB.NET, VBS, VBScript, Visual Studio and tools, Web Development | Leave a Comment »
Posted by jpluimers on 2014/04/09
Interesting read:
The C language specification describes an abstract computer, not a real one – The Old New Thing – Site Home – MSDN Blogs.
In other words: any language that merges null behaviour in the underlying storage will have a problem somwehere.
So if you want to have true nullable types, your null flag should be stored outside the underlying storage.
The .NET framework 2 and up, most database management systems and many other environment support that.
But most languages don’t support it for pointer types. So there will be portions of address spaces either inaccessible, or only accessible when skipping the null pointer checks.
Note that the thread above contains some very interesting bits, for instance this one:
Matt 28 Mar 2013 5:58 PM #
@MarkY “Dereferencing null is undefined? Cool! I thought it was guaranteed to crash, just like a false assertion or something. So crashing is the OS guarantee, not the language guarantee apparently.”
Nope. It’s not an OS guarantee either. The OS won’t ever normally allocate memory at address zero, but there’s nothing to stop you telling it to. Try doing “VirtualAlloc(1, 4096, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)” on your pre-Windows8 machine.
In fact, this is the reason why null-dereferences in kernel mode are often exploitable as elevation of privilege attacks. The null-page is mappable and within the user-addressable region of memory, so if the kernel dereferences a null pointer, it reads attacker controllable data.
And btw, this is the reason why on Linux and Windows8+ you can’t map the null-page.
–jeroen
via: The C language specification describes an abstract computer, not a real one – The Old New Thing – Site Home – MSDN Blogs.
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Borland C++, Borland Pascal, C, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, C++ Builder, Database Development, Delphi, Development, Pascal, Quick Pascal, Software Development, Turbo Pascal, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »
Posted by jpluimers on 2014/01/21
I remember doing this in DOS ages ago (in the Turbo Pascal 5 era) for exactly the same reason: flash the keyboard LEDs to indicate some event was happening, but I’ve yet to find back the source code.
Here is how to do it in Windows using either C# or C: Faking num lock, caps lock and scroll lock leds – About My Code.
–jeroen
via: c# – Way to turn on keyboard’s caps-lock light without actually turning on caps-lock? – Stack Overflow.
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, Development, Pascal, Software Development, Turbo Pascal | Leave a Comment »
Posted by jpluimers on 2013/11/07
Wow, I’ve been living under a stone (:
Just discovered the online Cyber-Dojo by Jon Jagger. It is an online manifestation of a Coding Dojo. Both have been there for years, and I think both are brilliant.
They take the concept of a Dojo as being a place to practice sports like martial arts in a pair or group setting with a series of Katas or practices.
Katas in a Dojo are a means for performing deliberate practice in order to learn new things. For instance, acquire new movement techniques, learn about your balance, gain strength, all in both a physical and mental way.
The aim of both is do more deliberate practice.
When performing Coding and Cyber Dojo, you should use Test Driven Development using pair programming and BabySteps. Those help you to slow down, as one of the Dojo Principles is for Katas to slow down. It reminds me of the “if you are in a hurry, sit down” mantra and is a key part of the Coding/Cyber Dojo Principles too.
The aim is to learn, and part of that is to first un-learn and open you to new thoughts. That’s why it is so cool that the Cyber-Dojo provides you with:
- a bunch of pre configured programming languages*,
- preformulated practices** (including a few cyber-dojo refactorings),
- a small boilter plate to get started.
You’d think they speed you up, but that is not their aim. Like a regular Dojo it gives you an pre-set environment and gives you piece of mind to get started.
The Cyber Dojo does without a Sensei, whose purpose in a Coding Dojo is to ask questions in order to guide the participants.
That’s why it is good to use the Cyber Dojo as part of a Coding Dojo: basically the Cyber Dojo provides a standardizes set of tools to quickly setup a Coding Dojo.
Cyber Dojo languages
(a prime number, so the table is a bit distorted)
| C |
Go |
PHP |
| C# |
Haskell |
Perl |
| C++ |
Java-Approval |
Python |
| Clojure |
Java-Cucumber |
Ruby |
| CoffeeScript |
Java-JUnit |
Ruby-Rspec |
| Erlang |
Javascript |
Cyber Dojo practices
Many of the practices come from rosettacode.org.
| 100 doors |
Harry Potter |
Print Diamond |
| Anagrams |
LCD Digits |
Recently Used List |
| Bowling Game |
Leap Years |
Reversi |
| Calc Stats |
Mine Field |
Roman Numerals |
| Count Coins |
Monty Hall |
Tennis |
| Diversion |
Number Names |
Unsplice |
| Fizz Buzz |
Phone Numbers |
Verbal |
| Game of Life |
Poker Hands |
Yahtzee |
| Gray Code |
Prime Factors |
Zeckendorf Number |
–jeroen
via:
Posted in .NET, Agile, C, C#, C++, Development, Java, JavaScript/ECMAScript, Perl, PHP, Scripting, Software Development, Unit Testing | 3 Comments »
Posted by jpluimers on 2013/10/29
Toon Krijthe posted an interesting question to SO.
Though 5 years old, I think it stilll is very valid one:
At my work, we have decided to stay with the ANSI characters for identifiers. Is there anybody out there using unicode identifiers and what are the experiences?
For all projects I work on (in various Languages like English, German, Dutch or other), I stick to ASCII characters (not even ANSI) for:
I also try to abstract the non-ASCII strings into places where I am sure that the encoding is preserved (for text files, I prefer UTF-8), or where these characters are properly escaped.
What is your take on this?
–jeroen
via: uniqueidentifier – What are the experiences with using unicode in identifiers – Stack Overflow.
Posted in .NET, Agile, AS/400 / iSeries / System i, C, C#, C++, COBOL, Continuous Integration, Delphi, Development, F#, Prism, Scripting, Software Development, VB.NET, Visual Studio and tools | 4 Comments »
Posted by jpluimers on 2013/09/17
Igor Ostrovsky wrote a few very nice MSDN magazine articles. Not all of them have ended up in the list at MSDN magazine, so here is a more complete list:
Though the articles show the majority of sample code in C#, the actual topics are of great interest to any developer writing .NET code or interfacing to it.
Some keywords in his articles: Read the rest of this entry »
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, .NET CF, C, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, Delphi, Development, F#, LINQ, PLINQ, Prism, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »
Posted by jpluimers on 2013/07/17
2 more issues got on-line both close to a 100 pages each:
So the only issues missing are #28, #30 and #31.
–jeroen
via: More Old Micro Cornucopia issues on BitSavers from 1987 and 1988 « The Wiert Corner – irregular stream of stuff.
Posted in Assembly Language, BitSavers.org, C, C++, Development, History, Pascal, Software Development, Turbo Pascal, Turbo Prolog, x86 | Tagged: Media, technology | 1 Comment »