LIVE! Monday at 9 AM PST – Podcast Episode on Programming Books

On Monday this week David, Craig, and Jim discuss some of their favorite programming books, both focusing on Delphi and C++ specific ones, and general programming topics.

Slides

Posted in podcast, Video podCast | Leave a comment

Collecting Multiple Pages of REST Results in a Single MemTable

I’ve run into this a few times, where a REST Service returns results in pages, so you have to make multiple passes to get all the data. One thing I love about the RAD REST Client Library is the ability to store all the data in the FDMemTable where you can work on it. Unfortunately when you can only get part of the results that limits the functionality. Here is a simple solution to get all the pages in a single FDMemTable.

What you need is a second FDMemTable. My first one is called MembersTempTable, and it is attached to the Response Adapter. The second one is called MembersMemTable and it will hold the complete set of data.

  // Drop any existing data
  MembersMemTable.Close; 
  
  // Get the first page 
  MembersRequest.Params.ParameterByName('limit').Value := '50';
  MembersRequest.Params.ParameterByName('offset').Value := '0';
  MembersRequest.Execute;

  // This clones the FDMemTable
  MembersMemTable.CopyDataSet(MembersTempTable, 
    [coStructure, coRestart, coAppend]);

  // Now we add the other tables
  MembersMemTable.BeginBatch();
  try
    // Repeat until we don't get a full page
    while MembersTempTable.RecordCount = 50 do
    begin
      // Start with the next page
      MembersRequest.Params.ParameterByName('offset').Value := 
        (MembersMemTable.RecordCount - 1).ToString;
      MembersRequest.Execute;
      // Append those records into our FDMemTable
      MembersMemTable.CopyDataSet(MembersTempTable, [coAppend]);
    end;
    MembersMemTable.IndexFieldNames := 'id';
  finally
    MembersMemTable.EndBatch;
  end;
Posted in REST | Leave a comment

LIVE! 13-Feb-2018 Delphi Web Frameworks

Join Craig, David, and Jim as they discuss Delphi Web Frameworks LIVE!
13-Feb-2018 at 12 AM CST [other timezones]

Planning to discuss some of the following . . .

 

Posted in Video podCast | 5 Comments

Delphi and the Blockchain: More than just Bitcoin and Cryptocurrency

Here is the replay of my webinar on Delphi and the Blockchain. We start with some basics of Bitcoin and cryptocurrency, but we look specifically at some simple examples of what the blockchain is and how to use it.

Agenda

  • Cryptography Basics
  • Cryptocurrency Overview
  • BitCoin, Ethereum, & PascalCoin
  • Digital Contracts
  • Bitcoin price tracking
  • Mining – Proof of Work
  • Blockchain Overview
  • Blockchain Chat
  • Other Blockchain Usages

More information:

  • Blockchain is an emerging technology – there is still a lot to learn and discover
  • Everyone is focused on the Bitcoin gold rush, but Blockchain may have the bigger/longer impact
  • Read the original whitepaper bitcoin.org/bitcoin.pdf
  • More information
  • Stay tuned to Delphi.org for code and more

[Delphi Blockchain Examples]

 

Posted in webinar | 8 Comments

Single Board Computers and Delphi Discussion LIVE!

Craig and Jim discussed Single Board Computers (SBC) and Delphi in this Live Episode of The Podcast at Delphi.org

If you are wanting to target these boards from Delphi remember if it is an ARM processor you will want to run Android, and if it is an x86 then you will want to run Windows or Linux. Here are some links to some of the single board computers we discussed:

  • MinnowBoard MinnowBoardby NetGate is an x86 based SBC that includes configurations with Dual Ethernet, which is great for creating network appliances. It includes support for both Linux and Windows. I’ve yet to test it, but I expect it will work fine.
  • Udoo x86Udoo x86 is another x86 based SBC (thus the name – but be aware they have non-x86 boards with different names) it supports both Windows and Linux operating systems, and your Delphi apps will run swimmingly under both operating systems. There are 4 different variations of the x86 with different configurations. It includes both a Intel Braswell SOC as the main OS CPU that runs Linux and Windows, and also an Intel Curie Microcontroller that is Arduino compatible. There are GPIO pins for both boards, and the Curie pins are compatible with most Arduino shields. You have a dedicated serial connection between the two so you can create an Arduino app with Visuino that runs on the Curie, talking to various sensors and it will run independently of your Delphi app running on the Braswell.
  • LattePandaLattePanda is a Windows 10 specific SBC and comes with Windows 10 preinstalled. There are two different hardware configurations, and you can choose for it to have Windows 10 activated or use your own license. It also includes a separate Arduino compatible ATmega32u4 microprocessor, again with the dedicated serial connection between the two processors and GPIO pins for both processos. I was able to get Linux installed, but I wouldn’t recommend it as it was a lot of effort and the WiFi wasn’t compatible. You could technically install Delphi IDE on both the LattePanda and Udoo x86, but more likely you would want to use a dedicated development computer and then use the remote debugger/platform assist server on the SBC. They have a new LattePanda Alpha they recently launched on Kickstarter which significantly upgraded stats.
  • BeagleBone BlackBeagleBone is an older ARM SBC that has its own Android distro. This works better than trying to shoehorn Android onto the Raspberry Pi – while you can get it installed, the BeagleBone Black’s Android distro is much more reliable. It has the GPIO pins like a Raspberry Pi. It is a little older and but might still be a good solution for your projects.
  • Orange Piorange-pi is another Raspberry Pi type ARM device that is cheaper and designed to run Android. They have a lot of different models to choose from, and just released a new one at CES. I’ve ordered a few to test, but they should run Delphi Android apps great. I have a spreadsheet of all the different Orange Pi boards and some basic specs for easy comparison. No guarantees it is 100% correct though.
Posted in podcast, Video podCast | Leave a comment

LIVE! Episode Tuesday, January 30th, 2018

We have a whole new streaming solution that should fix all the issues we were having, so expect better audio quality this time. Join Craig, David and myself for the latest on Delphi, C++Builder and software development in general.

[YouTube]

Posted in podcast, Video podCast | Leave a comment

LIVE! Tuesday, January 23rd, 2018

You can watch live right here:

During this episode we discussed:

  • We set up our own RTMP instance on Linode to bounce the 3 streams off of for the podcast. I used Craig’s Brolly script to setup the server, and followed this guide. I used my local machine that I was streaming from to composite as well, which may have been stressing out the poor MacBook. I’ll try adding another computer to the mix next time, possibly an Amazon Workspace instance like we did for CodeRage.
  • The Delphi powered game Blast-Off launched yesterday on Steam. It is a lot of fun and looks beautiful.
  • Speaking of beautiful games created with Delphi, check out some of the latest videos by Zudomon showing off the game he is developing in Delphi. You can support it on Patreon or follow along on the Facebook developer page.
  • The team over at Grijjy has an open source Cross Platform Cloud Logger available git the GetIt packet manager or on GitHub. The Broker and LogViewer run on Windows, but the client logging code works on Android, iOS, Linux, macOS, and Windows. It has a lot of great features and is very useful.
  • There is an art and a science to writing good questions. Eric S. Raymond started it with his How to Ask Questions the Smart Way back in 2004. I created a blog post Jon Skeet of Stack Overflow fame also made a blog post about Writing the Perfect Question, which he shorted into a checklist on Stack Overflow Meta. I’ve got a blog post on the subject as well. Following these steps are also good troubleshooting too.
    We've tried nothing and we're all out of ideas.
  • We also discussed some DevOps best practices
    • You need a literal backup of all the machines
    • Keep all your code in source control
    • Be sure you also have an offsite backup
    • You need to be able to rebuild your development machine quickly
      • This includes bringing up a new developer
      • Same process is used to set up a dedicated build machine
    • If you use a database, you don’t have a database unless you have a script to rebuild it, and it is in source control
      • A script or some other system to manage the schema and lookup tables
      • Versionable
    • Use Virtual Machines to manage development environments
      You should have a dedicated build server – this proves your process to build a development machine works
    • Might as well setup CI too
  • When discussion version control hosting consider the following:
    • GitHub has free open source repositories with free collaborators, but you can pay for private repositories
    • BitBucket has free private repositories, and Jira integration, but you pay for collaborators
    • SourceForge just launched a huge new update
    • GitLab is an exciting new alternative that also allows free self hosting
Posted in podcast, Video podCast | Leave a comment

Join us for a LIVE Video Episode of the Podcast at Delphi.org

Tomorrow will be a live episode of the Podcast at Delphi.org

You can join us live on YouTube with your questions and comments, or catch the replay posted here. Stay tuned tomorrow for details on how to join.

This is our first time with this new format and would love to get your feedback. We’ll also appreciate your patience as we work out the technical details.

Posted in News, podcast, Video podCast | Leave a comment

Get Ready for the New Programmers!

U.S. News an World Report just ranked Software Developer as the best job for 2018. They use data from the U.S. Bureau of Labor and Statistics to rank jobs based on pay, job security, mental engagement, stress, room to advance, satisfaction, and work-life balance. Since you are here, you most likely agree with that ranking and are surprised it took so long for someone else to recognize it.

Software Developer #1 Best Job

This means we will see a lot of people interesting in software development. Anyone looking for a better job is likely to start at the top of that list and work their way down until they find one they are interested in. Not to mention everyone who sees the headlines about Software Developer replacing Dentist as the #1 Best Job. Whatever the reason, software developers will get a lot more attention.

Everyone is Focused on Software Developers

When I’m talking to people about career advice I think it is more important to choose a career that suits the individual (internal factors) than basing the decision purely on external factors like pay, etc. That being said, I honestly believe Software Development is only going to get more important. Going forward, software development and related jobs (many of which aren’t even invented yet) will consume the many of the other jobs as automation and artificial intelligence take over more aspects of our life. It all depends on which side of the automation revolution you want to be.

 

When I was really young (like 3rd grade) I knew I wanted to program computers for a living. A family friend told me that I should look for a different job because by the time I entered the career market computers would be programming themselves and there would be no jobs. I remember thinking once that happens there would be no jobs, and someone would need to teach the computers how to program themselves better.

Just recently I was in Tokyo for the 10.2 launch event. I was talking to members of the press, and one of them made a similar assertion “What is the point of releasing better developer tools when soon computers will be programming themselves?” I shared the story from when I was a kid and said that “Yes, AI is automating and consuming other jobs, but the programmer will be the last to go. Once AI’s no longer need humans to make them better there will be no jobs for anyone!”

Congratulations, you choose wisely.

So what does this mean for you, as a software developer today? Congratulation’s you choose wisely! But be prepared for a lot of people to come to you for career advice. Remember that Delphi offers a great Free Starter edition, and Embarcadero Academy is full of content for people learning to program.

Posted in Article, News | Leave a comment

Law of the Instrument and Curse of the Programmer

If you aren’t familiar with the Law of the Instrument, otherwise known as Maslow’s hammer/gavel, or the golden hammer it is often expressed as

If your only tool is a hammer, you treat everything as like a nail.

My understanding is that the law of the instrument means you are limited by instruments or tools you know how to use. For example, if you have a screw, some wood, and a hammer, then you might successfully get the screw into the wood, but a screwdriver would be a better alternative.

Law of the instrument

The law of the instrument also means an obsession with the perfection of the instruments you know. I remember back in the day when I was convinced there was no reason to bother with any other programming languages because Delphi was the best. Now I’ve spent some time using a lot of other programming languages, and so I can confidently say Delphi is the best, while I can see the value and use of other programming languages.

I believe it is worthwhile learning about new technologies, frameworks, languages, or methodologies. Then you can pick the correct one for the job. This doesn’t mean you need to be an expert in all of them, but you should know enough that you are confident in your choice.

The reverse of this is the obsession to chase new and exciting technologies and recreate things every few years. This keeps the developers entertained, but doesn’t really provide business value. Again I believe Delphi does a good job with this as it respects your existing code while moving forward to new platforms, features, and frameworks.

So what is the Curse of the Programmer?

When I’m talking to other programmers I see two behaviors. The first is, every problem they encounter in life (at work and beyond) they respond with “I could write a program to do this,” or some variation. By extension, they also cast a critical eye toward any software system (even those developed by themselves) to see how to do them better. This results in a huge backlog of projects that they create to fix problems, fix a problem better, or just out of curiosity to see if they can.

This is similar to the Law of the Instrument, but I see it more as your learning the flexibility and power of programming results in your seeing many opportunities to apply it. I’ve talked to people in other industries, and I think the general tendency is fairly universal, it is just that programming is (in my opinion) so much more powerful and flexible than many other applied technologies.

The second behavior, which is something to be more cautious about falling into, is the urge to create a “library” or “framework” instead of finishing the program at hand. For example, you are creating a program to solve a problem, and in the process, you create series of libraries just in case you need to solve similar problems.

There is value in having reusable libraries, functions, components, and frameworks. The trick is to not let the creation of them get in the way of shipping. The best way I’ve found to deal with this is to only create the library when you need it. Write your code with the appropriate level of coupling to solve the problem at hand. When you need to reuse a bit of it elsewhere, consider refactoring it into something reusable. Then as you use it in more places you can keep refactoring it and expanding it until you have a full blown framework.

How do you see the Curse of the Programmer in your life? What do you use to prevent every project from spawning a series of reusable frameworks?

Posted in Article, News | 3 Comments