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,862 other subscribers

Archive for the ‘C++’ Category

The C language specification describes an abstract computer, not a real one – The Old New Thing – Site Home – MSDN Blogs

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 »

Choose your chart type & Amount of profanity in git commit messages per programming language (via: andrewvos.com)

Posted by jpluimers on 2014/03/07

Funny charts at andrewvos.com – Amount of profanity in git commit messages per programming language.

The source is online too: AndrewVos/github-statistics.

And it led me to this really nice way of choosing your chart type.

Click to enlargeRead the rest of this entry »

Posted in .NET, C#, C++, Development, Java, JavaScript/ECMAScript, Perl, PHP, Ruby, Scripting, Software Development, Web Development | 2 Comments »

At #SXSW 2014 this week, Embarcadero Launches Appmethod, A New Multi-Device Development Platform For Native Apps (via: @TechCrunch)

Posted by jpluimers on 2014/03/06

The @appmethod secret.

The @appmethod secret.

Wow. Out of the blue, I just read Embarcadero Launches AppMethod, A New Multi-Device Development Platform For Native Apps | TechCrunch. And I’m impressed.

In short:

At SXSW 2014 (which is running now, its agenda has a schedule from March 7th till March 16th), Embarcadero announces appmethod, to be released in beta on March 18th, 2014 for building native cross platform applications. Many have found out you can apply for the beta at www.appmethod.com.

More and more people are bumping into the appmethod link, for instance on FaceBook, on Google Plus, at Delphi Bistro and #Appmethod starting with the @appmethod secret by Joy Ruff.

Below are a few my observations from following all of the above links. Read them, especially the TechCrunch. I expect interesting posts from others to follow really soon now (:.

I’m only a few hours ahead of you readers, but I’m having a positive vibe just for these reasons: Read the rest of this entry »

Posted in Android, C++, Delphi, Delphi XE5, Development, iOS Development, JSON, Mobile Development, Object Pascal, OS X FMX, Pascal, SOAP/WebServices, Software Development | Tagged: , , | 15 Comments »

Faking num lock, caps lock and scroll lock leds – About My Code

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 »

Cyber-Dojo: practice unit-tested programming in pairs/groups using Katas

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 »

Interesting SO question: What are the experiences with using unicode in identifiers?

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:

  • file names
  • identifiers

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 »

.NET/C#: Igor Ostrovsky wrote a few great MSDN magazine articles helping you write better threading code

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 »

2 More Old Micro Cornucopia issues on BitSavers from 1986

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: , | 1 Comment »

Time for a golden oldie: Pragmatic Software Development Tips

Posted by jpluimers on 2013/05/09

From the century start era of The Pragmatic Bookshelf | The Pragmatic Programmer, a – still valid – list of Pragmatic Software Development Tips.

From Care About Your Craft, via DRY, Some Things Are Better Done than DescribedKeep Knowledge in Plain Text, Work With a User to Think Like a User, Find the Box, and many others till Sign Your Work.

–jeroen

via: The Pragmatic Bookshelf | List of Tips.

Posted in .NET, C++, Cloud Development, COBOL, CommandLine, Delphi, Development, Fortran, iSeries, Java, Pascal, RegEx, Scripting, Software Development, Web Development, xCode/Mac/iPad/iPhone/iOS/cocoa | 3 Comments »

More Old Micro Cornucopia issues on BitSavers from 1987 and 1988

Posted by jpluimers on 2013/04/08

Last quarter, 11 issues of Micro Cornucopia appeared on BitSavers including the final May 1990 issue.

This month, another 7 issues appeared, most of which cover a form of Pascal in one or more of the articles and advertisements:

A fun thing to notice are the advertisements for Modula-2. Logitech Modula-2. Yes though the Logitech Wikipedia page does not mention it at all, Logitech didn’t only sell mice, keyboards and web-cams. They had more products. Being Swiss, they were big in Modula-2. And Bitsavers has a PDF of that too: Logitech_Modula-2_86_1.0_Feb84.pdf

The only issues still to be scanned are #28 till .

–jeroen

via: New Micro Cornucopia issues on BitSavers including the Final May 1990 issue « The Wiert Corner – irregular stream of stuff.

Posted in Assembly Language, BitSavers.org, C, C++, Delphi, Development, History, Pascal, Software Development, Turbo Assembler, Turbo Pascal, x86 | Tagged: , , , , | 2 Comments »