Tag Archives

Archive of posts published in the category: programming

ABAP Programming Model for SAP Fiori – Part – 8

CRUD Operation in SAP BOPF

From our data model of Airline which we have created, there are three Composite Interface views. It is always good practice to add semantic business object annotations to the composite interface views. Because Basic Interface views has to be reused in other applications as well, so we apply business object annotations on Composite interface views. To generate a BOPF business object based on the three composite CDS views, we must add several @ObjectModel annotations to the views.

In the Airline root view (ZAPF_I_AIRLINE), we must add the annotations on the header level.

Below is the list of BOPF Business Object annotations.

# BOPF BO Annotations Purpose/Relevance
1. @ObjectModel.modelCategory: #BUSINESS_OBJECT Indicates that the CDS view represents a BOPF business object.
2. @ObjectModel.compositionRoot: true A business object is represented as a hierarchical tree of nodes, and by adding this annotation, a view is characterized as the root view of the node hierarchy.
3. @ObjectModel.writeActivePersistence: ‘SCARR’ This annotation specifies where created or updated data must be stored or deleted from.
4. @ObjectModel.transactionalProcessingEnabled: true To enable the transactional run-time for the view, this annotation is used. This annotation can only be added to Root view of BOPF hierarchy. Also, this annotation has to be added along with @ObjectModel.writeActivePersistence: ‘SCARR’.
5. @ObjectModel.createEnabled: true,
@ObjectModel.deleteEnabled: true, and @ObjectModel.updateEnabled: true
With these annotations, we specify which operations will be supported by the transactional runtime. When we set everything to true, then all operations are supported by our Airline root node.
6. /* Associations*/
To build up the business object node hierarchy, we must also annotate the association to Flight Info. and Flight schedule views as a child association.
7. /* Associations*/
@ObjectModel.association.type: [#TO_COMPOSITION_PARENT,#TO_COMPOSITION_
Views that don’t represent the root node of the hierarchy must also specify their root node association, which, in our case, is equivalent to the parent association.

Lets apply the above BOPF BO annotations in our Airline model.

Root view – Airline
Flight Info.
Flight Schedule

On activation of the transactional or business object views, the BOPF runtime will generate a business object together with several structures and table types based on the CDS view field structures. The generated BOPF object has the same name as the
root CDS view, in our case, ZAPF_I_AIRLINE.

BO tree of Airline Data Model

To enable our existing consumption views for transactional processing via the generated BOPF business object, we must add some of the @ObjectModel annotations on the header level. To the Airline Consumption view (ZAPF_C_AIRLINE), we must add the annotations given as below


Programming | Cadalyst

Features, advice, and instruction for creating custom programming code for AutoCAD.


1 Jul, 2003

By: Tony Hotchkiss

AutoLISP Solutions: Pick the attributes you want to purge from multiple drawings.


1 Jul, 2003

By: Barry Bowen

What programming language should you learn?


1 May, 2003

By: Bill Kramer


1 May, 2003

By: Barry Bowen

Common language automates tasks.


1 Apr, 2003

By: Tony Hotchkiss

Create AutoCAD polylines from point data stored in spreadsheets.


1 Mar, 2003

By: Bill Kramer


1 Mar, 2003

By: Barry Bowen

Shareware may solve your programming problem.


1 Mar, 2003

By: Barry Bowen

Shareware may solve your programming problem.


1 Mar, 2003

By: Barry Bowen

Shareware may solve your programming problem.


1 Feb, 2003

By: Tony Hotchkiss

AutoLISP Solutions: Learn how to use AutoLISP to make changes in multiple documents.

Source Article


Programming | Year 4 Classroom Blog

As a school we are really taking a full part in the Hour of Code week, today is the turn of Year 4.
Mrs Henry is very excited about your lesson as – The Force Awaken… Star Wars Coding!
One part of BEST you really need to do in coding is S – stick at it! Sometimes it isn’t always easy and takes a few goes. Before you ask your teacher for help there is a lot you can do for yourself – the VIRTUAL STUCK STATION! The program will show you videos – don’t skip them, but listen carefully as they will teach you what you need to know! Also if your code is wrong the computer will give you hints so you know what you are missing!
Best of luck
Mr Connolly
The Code Master!
Take me to the code challenge

As a school we are really taking a full part in the Hour of Code week, today is the turn of Year 4. 😀

Mrs Henry is very excited about your lesson as – The Force Awaken… Star Wars Coding!

One part of BEST you really need to do in coding is S – stick at it! Sometimes it isn’t always easy and takes a few goes. Before you ask your teacher for help there is a lot you can do for yourself – the VIRTUAL STUCK STATION! The program will show you videos – don’t skip them, but listen carefully as they will teach you what you need to know! Also if your code is wrong the computer will give you hints so you know what you are missing!

Best of luck

Mr Connolly

The Code Master!

Take me to the code challenge

As a school we are really taking a full part in the Hour of Code week, but unfortunately Year 4 might miss out!  But don’t worry with swimming cancelled this week we will try our coding today 😀

Mrs Henry is very excited about your lesson as – The Force Awaken… in coding!

One part of BEST you really need to do in coding is S – stick at it! Sometimes it isn’t always easy and takes a few goes. Before you ask your teacher for help there is a lot you can do for yourself – the VIRTUAL STUCK STATION! The program will show you videos – don’t skip them, but listen carefully as they will teach you what you need to know! Also if your code is wrong the computer will give you hints so you know what you are missing!

Best of luck

Mr Connolly

The Code Master!

Take me to the code challenge

Hour of code


As a school we are really taking a full part


Beginning C++ Programming – From Beginner to Beyond Exams


Beginning C++ Programming – From Beginner to Beyond Exams, Obtain Modern C++ Object-Oriented Programming (OOP) and STL skills needed for game, system, and application development.

  • NEW
  • Created by Amir Magdy
  •  English


Which programming language is often seen as a badge of honor among software developers? C++

Which programming language can you learn that when added to your resume, will often get you a job interview? C++

Which programming language is routinely ranked in the top 5 programming languages by popularity, and been consistently in the top 10 for close to 20 years? C++

Why you should learn C++

Much, if not most of software written today is still written in C++ and this has been the case for many, many years.

Not only is C++ popular, it is also a very relevant language. If you go to GitHub you will see that there are a huge number of active C++ repositories and C++ is also extremely active on stack overflow.

There are many, many leading software titles written entirely or partly in C++. These include the Windows, Linux and Mac OSX operating systems!

Many of the Adobe products such as Photoshop and Illustrator, the mySQL and MongoDB database engines, and many many more are written in C++.

Leading tech companies use C++ for many of their products and internal research and development. These include Amazon, Apple, Microsoft, PayPal, Google, Facebook, Oracle and many more.

Can you see how learning C++ will open up more career opportunities for you?

If more professional companies are using C++, it stands to reason that there is going to be more of a demand for C++ programmers.

But the main reason programmers should probably learn C++ is because it is so powerful!

What do I mean by powerful?

C++ is super fast, and is a general purpose programming language that supports both procedure and object oriented programming making it very flexible.

It can scale easily. And it can be portable as well.

C++ can do many things that other languages just can’t.

That’s why nearly every major language has a way to interface with code written in C++.

Since C++ has influenced so many languages, if you know C++ you’ll likely see elements from C++ in new languages you learn.

Is C++ difficult to learn?

With all the power and flexibility of C++ comes complexity.

There is no question that C++ is one of the most complex programming languages out there.

But with the right instructor, and the right training, you really can get up to speed with C++ quickly, and that’s what this course is all about.

What will I learn in this course?

The course assumes no previous experience with C++ (or even programming in general), and you will end up with the skills to create your own programs in C++.

Key topics covered include.

* Looping with while, do/while for, range-based for statements and recursion

* Performing calculations and displaying results

* Functions

* Pointers

* Using existing classes and creating


post your awesome batch files! – Programming

@echo off
color 2e
title CMD Snake Game    -Aaron
if “%~1” == “startGame” goto :game
if “%~1” == “startController” goto :controller

set “choice=”
2>nul >nul choice /c:yn /t 0 /d y
if errorlevel 1 if not errorlevel 2 set “choice=choice /cs”
if not defined choice (
  2>nul >nul choice /c:yn /t:y,1
  if errorlevel 1 if not errorlevel 2 set “choice=choice /s”
if not defined choice (
  echo ERROR: This game requires the CHOICE command, but it is missing.
  echo Game aborted. :(
  echo A 16 bit port of CHOICE.EXE from FREEDOS is available at
  echo http://winsupport.org/utilities/freedos-choice.html
  echo A 32 bit version from ??? suitable for 64 bit machines is available at
  echo http://hp.vector.co.jp/authors/VA007219/dkclonesup/choice.html
  exit /b

set “keys=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789”
set “keyFile=key.txt”
set “cmdFile=cmd.txt”
set “highscoreFile=last score on !difficulty!.txt”

copy nul “%keyFile%” >nul
start “” /b “%~f0” startController 9^>^>%keyFile% 2^>nul ^>nul
cmd /c “%~f0” startGame 9^<%keyFile% ^<nul

2>nul (>>”%keyFile%” call )||goto :close
del “%keyFile%”
exit /b

setlocal disableDelayedExpansion
title %~nx0

set “up=W”
set “down=S”
set “left=A”
set “right=D”

::Both max to 99! And width to 40 and height to 25!
set “width=40”   max=99
set “height=25”  max=99
:: max playing field: (width-2)*(height-2) <= 1365

set /a cols=width+1, lines=height+10, area=(width-2)*(height-2)
if %area% gtr 1365 (
  echo ERROR: Playfield area too large
  >”%cmdFile%” (echo quit)
if %lines% lss 14 set lines=14
if %cols% lss 46 set cols=46
mode con: cols=%cols% lines=%lines%

set “spinner1=|”
set “spinner2=/”
set “spinner3=-“
set “spinner4=”
set “spinner5=O”
set “spinner6=$”
set “spinner= spinner1 spinner2 spinner3 spinner4 spinner5 spinner6”

set “space= “
set “bound=*”
set “food=+”
set “head=@”
set “body=O”
set “death=X”
set “playerSpace=%space%%food%”

set “xDiff%up%=+0”
set “xDiff%down%=+0”
set “xDiff%left%=-1”
set “xDiff%right%=+1”

set “yDiff%up%=-1”
set “yDiff%down%=+1”
set “yDiff%left%=+0”
set “yDiff%right%=+0”

set “%up%Axis=Y”
set “%down%Axis=Y”
set “%left%Axis=X”
set “%right%Axis=X”

set “delay1=20”
set “delay2=16”
set “delay3=12”
set “delay4=7”
set “delay5=5”
set “delay6=3”
set “delay0=0”

set “desc1=Mega Slow”
set “desc2=Crawler”
set “desc3=Slow”
set “desc4=Normal”
set “desc5=Fast”
set “desc6=Insane”
set “desc0=Impossible”

set “spinnerDelay=3”

set /a “width-=1, height-=1”

set LF=^

set ^”n=^^^%LF%%LF%^%LF%%LF%^^”

:: setErr
:::  Sets the ERRORLEVEL to 1
set “setErr=(call)”

:: clrErr
:::  Sets the ERRORLEVEL to 0
set “clrErr=(call )”

set getKey=%n%
for %%# in (1 2) do if %%#==2 (for /f “eol= delims= ” %%1 in (“!args!”) do (%n%
  set “validKeys=%%1″%n%
  set “key=”%n%
  ^<^&9 set /p “key=”%n%
  if defined key if “!key!” neq “:” (%n%
    set /a key-=1%n%
    for %%K in (!key!) do set “key=!keys:~%%K,1!”%n%
  for %%K in (!key!) do if “!validKeys:%%K=!” equ “!validKeys!” set “key=”%n%
)) else set args=

set draw=%n%
for /l %%Y in (0,1,%height%) do echo(!line%%Y!%n%
echo Mode=!Difficulty!%n%
echo Score=!score!

set test=%n%
for %%# in (1 2) do if %%#==2 (for /f “tokens=1-3” %%1 in (“!args!”) do (%n%
  for %%A in (“!line%%2:~%%1,1!”) do if “!%%3:%%~A=!” neq “!%%3!” %clrErr% else %setErr%%n%
)) else set args=


set plot=%n%
for %%# in (1 2) do if %%#==2 (for /f “tokens=1-3” %%1 in (“!args!”) do (%n%
  set “part2=!line%%2:~%%1!”%n%
  set “line%%2=!line%%2:~0,%%1!!%%3!!part2:~1!”%n%
)) else set args=

:: start the game
setlocal enableDelayedExpansion


Erlang for Concurrent Programming – ACM Queue

January/February 2020 issue of acmqueue
The January/February 2020 issue of acmqueue is out now

Subscribers and ACM Professional members login here



Download PDF version of this article

Erlang for Concurrent Programming

Designed for concurrency from the ground up, the Erlang language can be a valuable tool to help solve concurrent problems.

Jim Larson, Google

Erlang is a language developed to let mere mortals write, test, deploy, and debug fault-tolerant concurrent software.1 Developed at the Swedish telecom company Ericsson in the late 1980s, it started as a platform for developing soft realtime software for managing phone switches.2 It has since been open-sourced and ported to several common platforms, finding a natural fit not only in distributed Internet server applications, but also in graphical user interfaces and ordinary batch applications.

Erlang’s minimal set of concurrency primitives, together with its rich and well-used libraries, give guidance to anyone trying to design a concurrent program. Erlang provides an effective platform for concurrent programming for the following reasons:

  • The language, the standard libraries (Open Telecom Platform, or OTP), and the tools have been designed from the ground up for supporting concurrency.
  • There are only a few concurrency primitives, so it’s easy to reason about the behavior of programs (though there are limits to how easy this can ever be).
  • The implementation makes the simple primitives fast and scalable, and makes effective use of modern multicore hardware, eliminating the need for more complex mechanisms.
  • The execution model eliminates some classes of errors from unsynchronized access to shared state—or at least makes these errors more noticeable.
  • The model of concurrency is natural to think about and requires no mathematical sophistication.
  • The environment makes failures detectable and recoverable, making it possible to deploy a less-than-perfect system in the field that can nonetheless maintain high availability.
  • The concurrency model maps naturally to distributed deployments.

This article introduces the Erlang language and shows how it can be used in practice to implement concurrent programs correctly and quickly.

Sequential Erlang

Erlang is built from a small number of sequential programming types and concepts, and an even smaller number of concurrent programming types and concepts. Those who want a full introduction can find several excellent tutorials on the Web,3 but the following examples (required by functional programming union regulations) should convey the essentials.

As shown in figure 1A, every file of Erlang code is a module. Declarations within the file name the module (which must match the filename) and declare which functions can be called from other modules. Comments run from the percent sign (%) to the end of the line.

Factorial is implemented by two functions. Both are named factorial, but they have different numbers of arguments; hence, they are distinct. The definition of factorial/2 (the two-argument version) is split into two clauses, separated by a semicolon. When factorial/2 is called, the actual parameters are tested against the patterns in each clause head in turn to find the first match, then the body (after the arrow) is evaluated. The value


ABAP Programming Model for SAP Fiori – Part – 10

Action in BOPF

Action has the literal meaning in BOPF. Do something. We can create an Action to an existing business object node by carrying out the following steps,

  • Open the business object (ZAPF_I_AIRLINE).
  • In the business object editor, click on Go to the Root Node link.
  • Select Actions tab, and choose New.

A dialog appears, where we must specify the details of the action:

  • Name: Enter the name of the action; in our case, we enter “Set URL”.
  • Description: Enter description that describes the purpose of the action, for instance, “Set the URL”.
  • Implementation Class: We can simply accept the suggestion that will lead to the generation of a global ABAP class or enter an already existing class that implements the interface /bobf/if_frw_action~execute. We will call the class ZCL_A_LOCK_APF_I_AIRLINE.
  • Instance Multiplicity: Select multiple node instances here, as we want the action to operate on several Airlines to enable mass processing of URL set.
  • Parameter Structure: Standard proposed structure will be filled in it.

Below code can be used to do the actions part.

DATA(lt_airline)= VALUE ztiapf_airline().
” Retrieve
iv_node =is_ctx-node_key
it_key =it_key
et_data =lt_airline
-url=’www.google.com’.”Set URL
” Update the node instance with the changed status
iv_node =is_ctx-node_key
iv_key = -key
iv_root_key = -root_key
is_data = REF#()
it_changed_fields = VALUE#(
( zif_i_airline_c=>sc_node_attribute-zapf_i_airline-url)

Custom button will be visible and upon clicking the button, URL will be set as per in the code snippet. In the next chapter, lets see Determinations of BOPF.

ABAP Programming Model for SAP Fiori

We are planning to start an Instructor Led Paid Online Practical Training on ABAP Programming Model for SAP Fiori. If learning this new programming model is in you study kitty, you may want to register and enroll in this course. Please register using below link and we will provide more information to the registered participants.

Introduction to ABAP Programming Model for SAP Fiori Training – Registration Form

Please follow our LinkedIn Page, LinkedIn Group, Facebook Page, Twitter and Instagram.

Save our number +1-646-727-9273 and send us a Whatsapp message ‘LEARN’ to be part of our Learning Community.

All SAP Fiori Tutorials

Check BOPF Tutorials

Previous articleABAP Programming Model for SAP Fiori – 9 – Use of Determinations in BOPF
Next articleABAP Programming Model for SAP Fiori – 11 – Enabling Draft Functionality for Transactional Apps


Source Article


Show HN: Intro to Python and Programming for non-CS majors

Hi there,

I am a PhD student in Operations Research and developed an Introduction to Python & Programming course for the Bachelor program at a business school.

Due to Corona, I got a chance to video tape it thoroughly (should have done that earlier).

Maybe someone here finds my lectures (playlist: https://www.youtube.com/playlist?list=PL-2JV1G3J10lQ2xokyQow…) useful or knows someone who does. The recordings are 25 hours in total. If you do the readings and exercises, you should allocate 90 – 120 hours roughly.

The GitHub repo is really an interactive book in Jupyter notebooks: https://github.com/webartifex/intro-to-python

As I didn’t study CS myself, I think I provide another angle for newbies.

Pull requests with improvements are highly welcome. The materials contain lots of references to the Python community as well. I love this community: I started without any knowledge of Python in 2014 and the many conference talks and repos really help when learning.

Stay safe everybody, Alex

Forgive me if I missed this, but I would highly recommend talking about virtual environments, pypi, and the existence of other things like pipenv.

The environment/dependency management story for Python is such a tire fire and I wish someone introduced me to it from a reasonably high level at the very beginning of my time with Python.

It doesn’t have to dig deep. Just needs to talk about what these things are, why they exist and why it’s such a challenge.

Too often I think people skip over these topics, considering them as nothing more than a means to an end. But by far and wide my largest challenges with Python has been environment and dependency management.

I agree that this is important.

My personal choice is to use pyenv together with poetry on a Linux machine.

Yet, please understand that I teach this course to absolute (!) beginners. That is why I chose to use the Anaconda Distribution in class, which comes with every package installed that I want my students to study.

Making your first steps in programming is hard enough and so I want to keep the “boiler plate” as small as possible.

But dependency management will be part of the more “advanced” lectures I will do in the future.

I hear you. There’s probably no one “right” answer because as I type this, I’m already conflicted with my own opinion. There’s already a mountain of important topics to teach.

What’s on my mind is that all of the “meta” parts of programming are usually seen as “boilerplate” when they make up such a critical part of “authoring” meaningful software.

I’m approaching this concern from my personal experience in university. I took a 100 level “CS for Non-CS majors.” We did all the formal CS stuff like talking about variables, functions, loops, recursion, etc. but by the end of the course I was still never taught how to take my java applications and package them in a way that I could share with my friends. It felt very much, “you can do so much


UNC-TV provides educational programming to keep North Carolina children learning while schools are closed

North Carolina’s public school are closed due to the COVID-19 crisis but students can continue to learn by watching UNC-TV.

The state’s public television station has begun to air programming for students in grades 4-12  to complement remote learning opportunities provided by North Carolina schools.

The programs are designed for use by parents, caregivers and educators while schools are closed. The state’s public schools will remain closed until May 15, or longer.

Educational programming is available online, on air and through PBS LearningMedia for students in pre-kindergarten through high school .

N.C. Department of Public Instruction will link online and printable material and activity ideas that complement the UNC-TV lessons. Districts are encouraged to print the materials and the programming schedule to distribute at meal sites or mail to students.

“We’re excited about this additional learning resource for students and families during this challenging time across our state and nation,” said Angie Mullennix, director of innovation strategy and interim director of K-12 standards, curriculum and instruction for DPI. “We thank UNC-TV for working with us to help fill the gap left by the unfortunate, but necessary, school closures.”

UNC-TV’s educational programming block will be available over the air and streamed live at unctv.org/athomelearning. The programming is available Monday-Friday, from 8 a.m. to 1 p.m., for grades 4-8 and from 1 p.m. to 6 p.m., for grades 9-12 (actual times may vary, please check the weekly schedule online at unctv.org/ahl).

Additional programming for children in grades pre-K through third grade is available on UNC-TV’s Rootle 24/7 PBS KIDS channel, as well as weekdays during a seven-hour block, from 6:30 a.m. to 1:30 p.m., on UNC-TV.

Source Article


Is Biden Correct? Should Coal Miners Learn Programming?

On January 4, 2020, Joe Biden commented on his presidential campaign tour, in front of a rally of Mid-Westerners, that coal miners should learn how to program. Implying that their skills and industry are obsolete. Dust!

The media responded by commenting about his supposed aloofness. Some outlets simply reported on and broadcasted audio clips of his speech, while others condemned his supposed gaffe and called him insensitive.

Throughout the years, many have commented about the lack of modern opportunities in locales where coal mining is a large profession. Some experts believe workers should learn new skills or enter emerging industries such as solar and tech. Biden’s comment ignites an interesting question: can coal miners become successful programmers?

Decline of the Coal Industry

According to the Brookings Institute, there’s been a 40 percent decline in domestic coal-fired generation in the past decade. The causes behind the slump is due to many factors which includes environmental concern, global economics, and new technologies and methods. The accumulation of greenhouse gases has simmered on the minds of a many people, motivating bureaucrats and lawmakers to implement policies that limit coal production. California cities with ports have implemented measures to limit coal imports and exports, previous President Obama imposed carbon limits on new and existing coal-fired plants, and Mid-West states are fighting hard to undo EPA carbon mandates and coal-mining safety measures. Flat electricity demand plus low global demand for U.S. coal exports contribute to the decline of domestic coal-mining. Inexpensive energy sources such as natural gas and renewable technologies have worked to increase the slump of domestic coal production.

Employment decline is a result of these trends. Despite President Trump’s 2016 campaign promises to revitalize the coal industry, the latest 2018 workforce statistics for coal mining points to a -1.3% growth rate for the industry over the next 10 years. The number of employees working in the industry has declined by 30,000—starting with around 85,000 workers in 2009 and declining to just over 50,000 in 2019 (source: BLS.gov). Workers in the industry still deal with the health hazards of black lungs, and then there are pollution concerns—making employment less attractive among millennials. Renewable energy jobs such as solar installers and wind turbine technicians, and software developers, are included in a list of fast-growing jobs among millennials.

Makeup of Coal Industry Workers

Since we’ve detailed why there’s a decline in coal-mining, let’s look at industry roles which might be affected. The basis of these roles’ sizes is based on data from Datausa.io.

The biggest categories of workers are machine operators and front-line supervisors. Together they make up around 55% of the workforce. They use the equipment to dig for coal and supervisors oversee all employee efforts—scheduling, managing tasks, enforcing company policies, and reporting to higher management. Around 11% of the workforce is composed of technicians and electricians, while 2% are made of engineers and welders. The rest consist of management and administrative functions.

Can Coal Industry Workers Become Successful Programmers?

Programming isn’t just typing code;