Best Git strategy for workshop code (starter -> end solution)

As far as I understood your question, you want two things:

Providing a reference solution that is not visible to the students until the course is done.
Having a way for your students to define a finished solution they can (probably only virtually) "hand in"1

Providing a reference solution

To achieve this, I would just create a repository containing the reference solution when the course is done and share the link with your students.

If you have the ability to create private repositories, you could use this to check that only your students have access to the reference solution (and not also the students of the course you give next year).

Defining a finished solution

Each student has their own working repository. As it's necessary that all of them start with a given initial set of files, they could create their repository by forking a "starter pack" repository you provide. If this wasn't required, they could just create a new empty repository on their own.

To mark a state as finished, I would use branches. You could for example require your students to create a solution branch in their repository once they are done.

Having everything in one namespace (optional)

Most Git hosters allow the creation of organizations or groups. If you want to, you could create one for each course you give. This organization would then contain the working repository of each student and the reference solution when the course is done.

This would provide an easier overview for you over your students' repositories.

1 After reading through your question another time, I guess I've misunderstood the question and you only asked for a solution for the first item in my list. I think I will nevertheless share my thoughts on both - maybe they can be helpful for you or any future visitor.


A better database management system, for teaching databases

At the state college I work for we stopped teaching Access as the "intro to databases" class a while ago.  I taught the class this term using MySQL and MySQL Workbench.  We had it installed on our lab machines (windows) and I also provided a VirtualBox VM with a Linux desktop, the MySQL server, the Workbench program, and a few other goodies.

Since I ended up with 2 extra class periods after the content was all delivered, I spent a little time showing different ways of interacting with the mysql server (command line, phpMyAdmin, code interaction via PHP and Java) as well as the mysql server management from the Linux class I teach.

Our progression in our AS degree track -

Intro to SQL - all inserts, updates, selects, joins, transactions, views, stored procedures.  Nothing on creating tables - just working with existing databases and tables.

Databases 2 - all table structure and relationships, referencing back to Intro class constantly.

second semester programming classes (C++ or Java) get into workign with a database from a programming language.

For our batchelors program, there is more use of programming and databases, with students learning MongoDB.  The batchelors level programming classes all use database connectivity, although with the Android class we move from mysql or mongo to sqlite.


Self guided learning about audio processing

Yes, it requires quite a bit of mathematical knowledge, and some understanding of the different AI techniques out there (neural networks etc.).

You could tell her that a good way to go about it is first choosing the form of AI she would like to learn (here you can mention neural networks).

Next, she should try to learn about the mathematics behind the AI form she chose (computers eventually only compute, so there's math in it). For audio processing, neural networks are, in my opinion, ideal because their input can only be a collection of numbers. The key point of this part is thorough understanding of the field, which is necessary for later understanding how to use those tools correctly.

The next step is learning how to convert audio (maybe .mp3 files) to something that the chosen AI can work with. From there it's specific to the AI that she would choose, but the previous step ensures that she'll know what to do with that converted information (for neural networks - train them on that).

It really comes down to the second step. That's the biggest part, and that's where the self learning really comes into play. From what you say, I doubt she'll find it overly complex and difficult.


Is it easy for professors to get academic versions of software from IBM?

This is a question to ask on the SIGCSE mailing list. A member there was primarily an educator and now works as a sort of liaison to the SIGCSE community. She will probably respond to such a question.

I suspect that they still have grants available that, with some work on your part, might solve your needs. You might need to write up a research proposal, of course. Easy? Maybe no. Possible? Maybe yes.


What is the best layout for a Middle School computer lab?

The features that should guide your classroom layout are visibility, accessibility, and distractibility — maximizing the first two, and minimizing the third.

Visibility is simple: every student should be able to face forward easily with unobstructed view, and I should be able to see every student's face.

Accessibility, here, means that I should be able to get to every student quickly, and that students should be able to work with each other when I assign pair-programming tasks or ask them to discuss a question with neighbors.

Those first two considerations already rule out front- or rear-facing rows, and some cluster arrangements as well.

Regarding distractibility: From years of teaching and observing other teachers, I take as an axiom that lecturing to students who are looking at computer screens is an effectively pure waste of time. This has corollaries:

Screens should be less than about 120° from facing the front of the room — ruling out rear-facing screens.
Lectures should be short and focused.

At this point I should give some context about my classes:

The first cue I teach the students is "screens off!", and I say this whenever I need to address the class as a whole. (If I'm interrupting work, I first give an advance warning so they can find a stopping point and save their work.)
I ask students to bring a notepad and writing tools, for drawing or taking notes while their monitor is off.
I aim to limit lecture time to ten-minute chunks at most, punctuated with pair discussions.

Because I have the students turn off their monitors, my lectures must require either no handwritten note-taking, or minimal note-taking (which then requires me to give some explicit instruction on how to take notes).

Now, I have taught in labs with traditional rows (students facing forward, monitors back), clusters, and variations on the "inverted U" design you're talking about. Currently my lab is set up with student workstations all along the left and right walls, so that students are all facing the wall while working, and the computers are all facing inwards — very much like the last option you described, only without a central island (because the room is too small for one). This is my preferred layout.

So, I would endorse the last option you suggested, of computers along the side walls, with an optional cluster of side-facing machines in the center of the room.


I think this is a pretty common problem, especially for novice programmers. They're given an assignment and don't know how to start- in fact, they don't even know what it's asking!

I don't think this is due to a lack of "courage" - it's because they don't have the framework required to start breaking problems down yet.

I think step one is to normalize this a bit, and specifically mention that this is a common way to feel. Then walk them through the process of getting over that initial hurdle. What behavior do you want them to exhibit? Model that behavior for them.

I try to encourage people to break their problem down into smaller steps and take those steps on one at a time. There are a lot of approaches here, including:

Restate the problem in your own words.
Break the problem down into logical sub-steps.
Identify your input and output.
Think about how you'd do this without a computer, with a piece of paper and a pencil.
Do the absolute smallest thing you know you need to do, like open your IDE, or write the class or function declaration.

Another thing that I think is important is demonstrating this behavior yourself. A lot of lectures and tutorials cover the happy path of developing code. Students see how easy it is when you do it, and then get home and don't know how to start and think that must mean they're terrible programmers. In fact every single programmer feels this way, so it's important that they know this. So I recommend doing a live demo of working through a problem, including stuff like using Google, looking stuff up in the reference, making mistakes, debugging, etc.


What are the advantages/disadvantages of teaching how to implement Nodes, Linked Lists, Stacks, and Queues before showing built-in implementations?

There is one aspect not yet mentioned, though the first two answers are excellent.

Libraries usually contain only the most common data structures and those that can be used in some generic way (pun intended, I guess). But there are other data structures that you may need in your work that aren't in the library you have available. The tools you need for building the standard data structures are likely the same (or a subset) as you need for the bespoke data structures. Sometimes you want a specialized version of a data structure to be able to optimize an important algorithm. So being a tool builder is an important skill that isn't exactly the same as that of being a tool user.


Suggestions for teaching selection sort with candy

Actually, I might suggest a slightly different tact: provide a variety of candies (small boxes of nerds, Hershey's kisses, and the like) and have them selection sort by preference order.

They can also sort by height, brightness, weight, or duration of the candy experience.

And as long as you're at it, you might first have them just sort it one of those ways however they do it naturally, which can lead to a nice discussion about why we can't articulate what we're doing very well, but it's some sort of massively parallel selection sort.

Then you can do a number of sorts, culminating in your selection sort by preference order.  And at the very end, tell them all to look around at their neighbors sorts to see if there are any obvious trades that they should be making!


What are the advantages and disadvantages of cumulative vs percentage grading?

I have done both percentages and points in my career, the latter being the most recent and preferred.

Percentages:  The only advantage I can see is that, especially in high school, this seems to be the dominant way of grading, so students and teachers are accustomed to it.  Disadvantages are that students can have a difficult time tracking their progress, or knowing, for example, how well they must do on a test to keep their grade above a certain percentage.  In my experience, it also takes more time as a teacher - determining how many questions to put on a test or quiz so that percentages can be more easily calculated, for example.

As relates to programming specifically, I always struggled with the fact that I wanted programming exercises to count heavily but had a hard time making that happen with percentages.  Students, parents, and administrators expect tests to be worth more than anything else, so if I gave tests the normal 40% weight, then that left programming exercises, quizzes, and classwork (study guides or worksheets) to split the remaining 60%, and I could just never get it "right", meaning feeling comfortable with the distribution.

Points:  The major advantage of points the OP has already noted - students, parents, and teachers alike can instantly look at assignments and ascertain which assignments are worth more (I'm assuming all are using electronic gradebook of some kind), and students who want to remain at a minimum certain level find that easier to do.

Going to points solved the problem for me of knowing how much to weight each type of assignment - all assignments are weighted the same, and if I feel the assignment is worth more, I give it more points.  So I can look at how many programming exercises I assign in one semester (depending on the course, 80 to 100), determine points for those (say 10 points each), and base the points for everything else on that total.  If I determine a certain test is going to be worth 112 points because it has 56 questions, then the students see it as a large chunk, so they don't blow it off, but it is also not going to sink them if they fail it.

Rework: By extension, rework is made easier with a grading by points system.  I've also found that "extra credit" makes much more sense for students in the points system, and they are more motivated to attempt it, because they can more readily see how the extra points are going to impact their grade.


How to teach image processing and computer graphics to a blind student?

I think you can teach 2D graphics using a tactile approach on a phone or tablet.

Students are very likely to be used to tracing their fingers over a mobile device (I have watched awesome videos of blind iPhone users in action).

So position and shape change of an object could be detected by them dragging their fingers over to get auditory feedback at the edges. Ideally you want a truly tactile surface but I don't know of any such devices. I have my own reasons for wanting a computer-controlled version of one of these

For actual image processing maybe map colours to tone, so as they move their finger over an image they hear a tone vary depending on the average pixels underneath. Then, as transforms are applied, the tones would change. You could possibly teach colour theory by varying the mapping to only one channel of RGB.

Update in one of those great examples of synchronicity, a few days after writing the above I was listening to Matthias Tretter of MindNode on a podcast mention how he had been convinced to add accessibility to MindNode, a visual mindmapping product by a blind user.

His blog posting has videos showing VoiceOver in action. This is a bit tangential to the original answer but a nice anecdote about how preconceptions about the intended purpose of a tool as being visual doesn't rule it out for blind users.


How can I find someone online to mentor me on my first research paper?

I would suggest taking to professors at your institution. If the semester is in session, you can go to their office hours; otherwise, you can email your advisor or another professor who knows you. Even if it's outside their area, they should be able to steer you in the right direction.


A little Hungarian

As @talhaIrfan says, the problem is mostly syntax.

This is what I discovered when I was struggling with pointers, while at university. Other students that I introduced the idea to would start to improve shortly after learning this technique. I have also introduced it in professional environments, where the bug rate subsequently reduced.

You can do a lot to improve syntax by introducing a little Hungarian notation (I do not advocate too much of this, just enough).

You need to be consistent, unambiguous, and clear. It should allow you to read your code more easily.

I always use an underscore to separate the Hungarian notation from the rest of the name. I always append type information to the end of the name (this is consistent with what the C libraries do).

I chose a set of symbols

_pt for pointers.
_t for types, this is what the C libraries use.

Examples:

typedef struct samplestructrec *samplestruct_pt_t;
typedef struct samplestructrec  samplestruct_t;
samplestruct_t *samplestruct_pt;

Summary

Always choose good name for you objects, and don't do too much Hungarian. When I was programming in C++, we also had at the beginning of a name p_ for parameters, l_ for local, m_ for a member variable (We did this to avoid name collisions, in retrospect I think that these 3 were not needed. We could have used this. instead of m_). That was it just 5 Hungarian pre/post fixes. You don't need any more, probably less, in a strongly typed language.


Order to Teach Topics in an Intro Programming Class

I think this depends entirely on the programming language you use. Or maybe more accurately, you should choose a language that allows you to introduce the concepts in the order you want.

I would use a language called Processing, which is built on top of Java and allows you to create visual, animated programs without any boilerplate code.

I'd start with calling functions. Here's an entire Processing program:

ellipse(20, 30, 40, 50);

This program shows a window and draws a 40x50 oval at coordinates 20,30. There are other functions in Processing. Have the students draw a basic scene.

Then I'd talk about using variables. Processing has a few predefined variables that come in handy:

size(500, 500);
ellipse(width/2, height/2, 200, 200);

This program creates a 500x500 window and shows a circle in the middle of it. Have the students modify their scenes so they stretch to fit the screen, using the width and height variables.

Then I'd talk about creating variables. Have students create their own variables that allow them to move their scene around, or easily change the color, etc.

Then comes creating functions. Here's an example program:

void setup(){
   size(500, 500);
}

void draw(){
   ellipse(mouseX, mouseY, 25, 25);
}

This program shows a window that draws a circle wherever the mouse is, 60 times per second.

Hopefully this gives you an idea of Processing and the general approach. From here I'd cover these topics:

Debugging
If Statements
Animation
For Loops
Arrays
User Input
Using Objects
Creating Classes
ArrayLists
Images
Libraries
Deploying your code

Shameless self-promotion: I've put together a series of tutorials that cover all of these topics, available at HappyCoding.io. I'd be happy to help adapt these tutorials into an introductory curriculum.


Do your students pay attention when you speak?

Ask them to switch their screens off.

They don't like it if you do it too often or for too long but it's surprisingly effective, saves you having to repeat yourself unnecessarily and forces you to try to make your instructions clear and concise. If you can't see their screens you can always tell by the glare from their screens on their faces who hasn't followed instructions.


When a student submits a work that is a copy from a colleague, should you also punish the student that made the work?

This would depend on context, in my opinion. Given you know the identity of both the original author and the plagiarist, consider:

Did the original author facilitate the plagiarism, or was the code plagiarised without the original author's knowledge? Can you tell?

Clearly, if the original author was the victim of someone peeking over their shoulder, or just blatantly copying code files, then they should not be punished. But if they gave help to others despite being told that this is inappropriate, then they are equally guilty of misconduct.

It's easy for me to write this, but in practice determining whether the plagiarism was with or without consent is more difficult. I would be inclined to give the benefit of the doubt if there is any chance that one party did not intentionaly cheat.
Is there any record of the students cheating previously? If so, that might be a guide.

I would be keen to avoid punishing someone who might not have done anything wrong, but some others might not give the benefit of the doubt. It's certainly not easy to tell what exactly has gone on when two very similar works are handed in, but if you can rule out any copying without the author's awareness with certainty, then you must assume that the author facilitated cheating.

If you haven't made clear what the difference is between helping and cheating, then you can't really punish anyone fairly—if you don't clearly lay out your expectations, then you can't enforce strict rules.


How to design a cloze test for a programming language?

I don't think that an entire Cloze test is practical, and in any case, it does not assess deep understanding well.

One problem with longer Cloze examples is that they force the student not only to understand the goal, but also your particular implementation, which will often feel quite foreign to them, even if they are strong students.  A further problem with Cloze-style is that, the more blanks you leave, the more possible combinations of correct answers you leave.

I once had a student fill in a top portion, meant to initialize a variable prior to a loop, with a correct lambda statement that solved the overall problem, and then fill in the following loop fill-ins in such a way as to make sure the loop never entered.  The solution was a good one, so it received full credit.

I use a mix of problem types on my exams. Short Cloze-style questions can address syntactic understanding and the ability to accomplish very basic operations, such as identifying three compatible statements to put in a for loop to
look through an array.

Multiple choice questions are good at making sure that particular distinctions are being made. I use these to isolate what I call "cognitive traps".

Coding exercises are, indeed, hard to grade, but they are also necessary for testing whether everything can be pulled together.

If you need to bring down the grading time, you may want to consider keeping the examples short and making AP-style code rubrics, as they can make the grading far easier.


I am in an almost identical situation to you, and I suspect that many, many CS teachers around the world are in similar boats right now.
I think you're right about the fundamental truth of it; you cannot keep different students coordinated if they do different things, and you cannot have them do the same thing unless the online-only cohort can also participate.  This leaves us with the sole (unappealing) option to treat everything like distance learning.
That doesn't mean that there are no advantages to the new arrangement!

The kids who will be with you in person will be able to easily and directly ask you questions.
The kids in front of you will also be easier for you to informally poll if you want to check in and make sure that what you're saying isn't losing the majority of the people.  (When I say informally poll I also mean to just scan your eyes around the room, and use your teacher-instinct to see whether many kids seem lost.  This was very hard to do during purely online education.)
Some kids were getting lost during purely virtual instruction, and having them in person some of the time will give you a chance to talk to them face to face, and hopefully to reel those students back in.  I suspect that coming in to school at least some of the time will make the entire thing seem more real, both for you and for the students.

If your in-class kids each have an electronic device, you should make sure that they have headphones to avoid audio feedback issues.  If they don't all have devices at school, you may need to do some photocopying, or "play" your materials at them from the front of the room.
Here's to hoping that this whole mess is very temporary.


How to learn to program compiled languages efficiently when coming from an interpreted language?

Your question deserves a long discussion, but I will try to narrow it down to few points.

First, remember that you are dealing not just with a "compiled language" such as Java or C# (that could be much easier targets for you), you are dealing with C++ that was designed with backward compatibility with C as a killer feature, and C was created in late 70s. It means that C++ indeed implements numerous design decisions that look archaic/obsolete/strange for a modern learner. Say, the whole system of header files is a hacky substitute for a proper package management. Thus it would be good for you to study carefully major language features and understand the true reason why they exist. In many cases you'll find newer and better alternatives to old tools (such as std::vector objects vs. arrays)

Second, use a good IDE. For instance, if you place a cursor under printf() (or any other library function) in MS Visual Studio and hit F1, it will jump to the extensive online manual, so this is not an issue. Also you will get autocomplete features similar to those available for Python (e.g., type a variable name, then a dot, and see a list of member functions).

Third, think of a compiler as of a subsitute for REPL (and there are true REPL environments for C++, such as the one available at repl.it). When you type a Python program, you don't know anything about its correctness until you run it. In C++ you can catch many errors just by compiling. So by the time of the first run you will already eliminate all syntax errors and many other errors related to type mismatching. I was learning Python after C++, and for me a source of constant annoyance was to make sure that every single line of code is executed before I could even hope it is correct.

Thus your typical session will look like "type some lines -> compile -> type some lines -> compile -> run"). Since you are asking about "fast feedback loops", I can tell that really good C++ programmers invest considerable effort in the type system used in their code. They don't use int everywhere even if they can. They use incompatible types for incompatible entities, declare member functions as const if they shouldn't modify objects, and add static_assert statements where possible, and avoid type casting. In other words, they make the compiler do the job. In the best case, if such code compiles, it works correctly. So the real feedback loop is concentrated on the stage of compilation.

In any case, remember that C++ is a complex hardware-oriented language with long history (just look at the sheer size of Stroustup's definitive guide), so approach it with patience. Mastering it takes time, indeed, be persistent and don't expect fast results.


Is it ok to use logic programming(like Prolog) as students' first language?

I do and am currently teaching a high school student Prolog but not as a first language.

  Is it OK to use logic programming(like Prolog) as students' first language?

While you could do it I would not advise doing it, let a student do it if they asked or be on a committee that would advocate for it.

The reasons are

Prolog is so much unlike other programming languages that there are very few other resources that a student could use as references for learning it and they would be very dependent on the teacher for learning. Many of the students I teach talk to others to round out their understanding of what I teach and while I would like to think that they clearly understand everything I say and get it correct the first time that just does not happen and so the students look to other means to augment their learning. With Prolog it is not only hard to find other good resources, but also students (and especially high school students) are hesitant to seek out help of knowledgeable peers.

With regards to books, there is only one book that I would use as an introductory teaching book and that is "Prolog Programming for Artificial Intelligence (4th Edition)" by Ivan Bratko (Amazon) (WorldCat). Java or Python have several tens of books and several are suitable for an introduction. Then for advanced books, Prolog only has a handful and of that only a few are of value. To learn the true art of programming in Prolog is something that only one or two books really are of mention.

There are a few sites for learning Prolog, but many only skim the surface and of the web sites that teach Prolog most I would not recommend for a self-learner as they can leave you with more questions than answers. For more advanced topics the only web site of value I note is The Power of Prolog by Markus Triska

While there are several places to get online help with Prolog, the one I use is StackOverflow with the Prolog tag.
The key concepts to learning Prolog are not intuitive. Object-Oriented has state, and functional is stateless with pattern matching (one way). Prolog is stateless with unification (think bi-directional pattern matching). Thinking in recursion has to be natural, processing lists must be second nature, constraint problems are common, difference list, use of syntactic sugar with DCGs, the operator definitions such as xfx, xfy, xf are different than most languages, reification, SLD, logical purity, program slicing, predicates vs. functions, MGU, and other concepts not seen in other common languages.
One first has to learn unification and get it correct before moving forward. The problem here is that sometimes the class has to move forward before a student understands unification and then the rest of the course is endless confusion to the student. Also unification is symbolic and getting students to understand that abstract concept is sometimes very hard. On one test I gave to drive the point home, part of the unification test was with English letters, part with Greek letters and part with symbols like a snowman. After unification comes backtracking or backward chaining which gives Prolog non-deterministic programming. List processing is typically next and that is another topic that can lose many students. When teaching list processing I teach induction with a base case and induction step(s). Cut is another topic that loses many students and can make or break many programming solutions. The point here is that you may have to proceed slower at first and then pick up the pace or risk losing many of the students and there are many key concepts that rely on previous key concepts where only a complete understanding will suffice.

Note: I normally provide links to the keywords but here have purposefully left them out so as to give others a taste of what it means to try and understand Prolog by trying to put these ideas together by themselves. I think Prolog is great and use it weekly but I know when and where to use it appropriately.
The best concepts of Prolog are typically incorporated into other languages as libraries or calls to external systems. In particular constraint solving is very useful but systems like Z3 can be used instead for other languages.
There may be other languages that can do what Prolog can do and do more. e.g. Mercury or expand on Prolog as a proof assistant, e.g. Coq
Very few companies seek out employees who know Prolog. Universities want their graduates to get hired. Why teach a student something that won't get them hired? Also since many companies don't use Prolog, if you know Prolog and try and advocate for it in a company, you are probably going to be on the losing side. Not that I find any of this agreeable, but that is reality.
With regards to AI Prolog gives closed world answers and while that is beneficial for some AI problems, IMHO is an Achilles heal for others. As an example, when it comes to classifying pictures I would not use Prolog but a deep neural network.


Learning disabilities as a barrier - should I stop learning?

Do it for the fun of it
You say that you have made nothing of your life; You say that you have an obsession with learning CS. If so then what does it matter what the outcome is. If you enjoy it then continue to learn.
It's not you
I used to have a learning disability, but then I got a new teacher.
You seem to blame your self. Autism is not a bad thing, is is a different thing. Just because you teachers did not know how to teach you, it does not mean that you are unteachable. You showed that, when you stole that science book. I did the same think with a maths book, when in year 6. I was expected to work my way through what seemed like an endless supply of maths books. One day I took the last book several grades above where I was working. I was motivated and completed the book, I then stole the teachers grading book and marked it my self (the teachers would not help). I had got close to 100%. It was at this point that I realised that my disability was the teachers. Shortly after this I changed school, and made a lot of progress.
Autism and programming
As a software engineer I worked with a lot of people. I have Dyslexia, some were normal, some were jerks, some had autism, etc. The people with autism and some others, were not good at working with the wider company, but were very good programmers. We protected them from people they did not know well, because we valued them. We could give them jobs that they could do better than the rest of us. Everyone has strengths, but they are not all the same. Don't judge yourself or others by what they can not do, but by what they can do.
What to learn
Most importantly learn what interests you.
You have a massive advantage, because you are not aiming toward exams, or work targets. These often cause people to take short-cuts across the swamp, and to get stuck. You can learn in a way that maximises learning.
“Someone like me”
If you believe you can, or if you believe you can't, then you are correct; Your belief in your ability has a very big affect on what you can do, so carry on with you positive thinking. And when you mess-up (because you will; we all do), then just try again. Success is the ability to continue in the face of failure.
Have a watch of this video
https://www.ted.com/talks/carol_dweck_the_power_of_believing_that_you_can_improve?language=en


Here are two resources that might be appropriate, but neither is a spreadsheet model.

The first is a resource called Contagion that has just been created for the Greenfoot Java system (IDE plus resources). You can find it at the Greenroom.

The second is a section on Simulation in a book called Polymorphism Companion. The book is actually the second volume of a pair and you might need the first one also Polymorphism: As It Is Played. They are both about using polymorphism, especially in Java.

Both of these resources model a disease spreading through a population. They have various parameters you can set to get some realistic(ish) results. Think of a Disease interface, for example, with diseases of various characteristics implemented via polymorphism.


I'll start by adding the exercises I'm currently using, but please don't let this stop you from posting more!

Create a macro that inserts a header row. (Story: "Every day I download a csv file. Always the same structure, but it is missing the header row. I want a macro that inserts a formatted header above my data.")
Number formatting macro (Story: "I regularly use a certain currency format, and I hate having to dig through menus to get it. I want a shortcut for it.")
Date stamp macro ("I want a macro that puts the current date into the selected cell. I always want the current date, but I want it to stay the same and not change every day.")
Fill empty cells from above ("I need a macro that fills all the empty cells in the selected region with the value above the empty cells. A good use case is a pivot table that has been pasted as values, and is missing the values in the first column.")

On the more complex side, I have an exercise where I ask them to create a macro to copy entire rows from one sheet to the first empty row in another one.

I have a few more, but they are totally artificial practice exercises.


What is a good way to explain computer viruses?

Viruses, worms and other malware are actually just like physical infections in enough ways that I still think metaphors are the best way to educate from a basic level. Even the average home user knows that a virus scanner stops a large number of infections from ruining their PC.

The challenge comes with explaining why virus scanners are so limited - most up until now only catch what they know about. So I like to use the following:

Malware is written to control your PC or to steal your login information for online banking etc.
Your virus scanner will protect from tens of thousands of pieces of malicious software that it knows about.
Behavioural analysis tools will pick up more malware, based on what it appears to do.

But because code is written by humans, there will always be vulnerabilities, and because there are criminals, there will always be malware that will get past these, and this is why layers of security are essential. These include:

User awareness (don't visit dodgy sites, don't click on suspect emails etc)
Secure architecture (secure by design)
Extensive monitoring and logging
Understanding the threat environment
etc.


Difficulty of algorithms homework problems

Homework problems in algorithms classes often involve finding clever tricks that the professors find elegant or interesting

That seems like a strange way of teaching algorithms. It shouldn't involve trying to make the students recreate brilliant ideas from scratch (most people won't re-invent Dijkstra's algorithm when asked to find the shortest path through a graph), but rather teaching them which building blocks exist, showing them how (simple) problems can be solved using these building blocks, and then offering them related problems whose solutions are similar.

  However, it seems like most of the students who solve these problems well are students who are familiar with the tricks already, from prior experience.

In my mind, the thing your professors do get right is the idea that algorithm design isn't a algorithm itself. I believe it is to a large degree a question of experience. You build a repertoire of "tricks" that work, and then you apply them in new circumstances. What kind of "tricks"? An important aspect is about knowing what kinds of data structures fit the problem.

  Is there a way to help students catch up on these tricks and tools without giving away the answers?

As I've said, I believe programming/algorithm design is a craft, not a science. Having mentioned Dijkstra, I don't believe in his approach to algorithm design. He was very methodical and mathematical and seems to have looked at algorithms as basically a mathematical problem to solve. While this is certainly true and often offers valuable insights when dealing with difficult problems, I don't think most people work like that. If programming is a craft, then it is best learned by imitation and lots of practice.

Unfortunately, we don't have nearly enough time to let students practice, but one thing you can do is tell them how important it is to look at how other people solved problems, and provide them with good resources they can use to learn by imitation. Here's a nice one: Beautiful code.

So, to actually answer your question:

Make sure the students have a good working knowledge of the basics (e.g. how to iterate over a list, how to manipulate list entries etc)
Present a sequence of problems that lead up to the final problem. For the preliminary problems, explain what kinds of data structures are used and why, and how the algorithm operates on them.
Encourage the students to look at other people's code. Good candidates are algorithms which solve a certain problem in a way that is applicable to a lot of other domains. (For example, I first learned about atomic commits by reading a description of how subversion worked. This came in handy when I thought about how to implement database transactions. It was also closely mirrored in the way git builds hash trees, which again is closely mirrored by the bitcoin blockchain).
Finally, explain to them that you can just show them the way, but just like learning to play a musical instrument, or a sport, they'll have to invest their own time if they want to become any good.


Putting feedback comments on source code when grading

The diff is between the most recent commit and the start of the branch. It's not just the diff of the last commit, it's every commit (stacked on top of each other) since the branch's origins.

If that weren't the case, it'd be nigh impossible to provide meaningful feedback to a code review for a branch's pull request.


Advantages of teaching basic javascript through typescript

You mention that you are already using ES6, which suggests that package management and complication are not really barrier, though I would expect that many reading this problem are not setup to ensure node and npm are installed and/or may have access to git/ssh protocols for fetching dependencies or projects. So, the first thing I'd point out is that for some readers, compiling TypeScript could be a barrier that reduces is teaching value.

The second and more relevant point is that JavaScript is dynamically typed language. There is value in tools like Flow and TypeScript, especially in production systems, but there is also a great amount of value learning how to program in a dynamic type system. If you're already teaching Java, there are few better choices to teach strategies, advantages and disadvantages to dynamically typed systems. Some students will prefer that type of programming over strictly typed languages.


How to deal with very low performing students?

One elegant way to deal with this sort of problem (though it does take a lot of work) is to create a self-explanatory review packet (including a practice quiz!), give it out on day one, and promise that there will be a quiz on its contents during the second week of class.

You then don't need to spend another minute on the material in class, at least for that first week. (Especially for that first week. They should not feel hand-held at first! See below...) You might want to make help available during office hours, however.

This has a second benefit, which is that you can set a recommendation for withdrawal from the class. I would give this a soft sell: "if you can't achieve an 80% on this quiz, then the kindest thing I can do is to recommend that you drop the class. It's not to be mean, but you WILL NOT have a good time here if you haven't reasonably mastered these concepts."

By putting the onus of weeding poorly performing students back on the students themselves, you will (hopefully!) find that you get very little resistance. And folks who choose to stay on anyway will be making an active choice to work very hard going forward (or suffer the consequences).

The big brunt of the work need only be done one time; the review packet and the practice quiz can be the same every semester. It is only the quiz itself that need be changed.

While this should weed out some of the lowest performers (and give many others a much-needed review), if the students are as low-performing as you say, it might not hurt to touch on some of the harder concepts that people get stuck on when you come to them again in the class.

Hopefully you'll have much better performance in the course going forward. Best of luck!


Book recommendations for self studying Data Structures in depth in an elegant manner

You might find Data Structures and Algorithm Analysis, by Clifford A. Shaffer, to be helpful. There are versions for C++ and Java available. (The 3rd edition is old already [2013], and the prior editions were titled A Practical Introduction to Data Structures and Algorithm Analysis.)
It does get very in-depth into the field, including the mathematics involved in analysis and proofs. That said, however, my first read through it (2nd Ed.) was very helpful in many ways, and I didn't then know anything about C++.
As a 2013 book, some of the coding might be in a style or format which is no longer considered "best practice." This is likely more true for the manner in which Object Oriented Programming is utilized than for the syntactical style. The material, discussion, and analysis are still as valid as ever.

The link above is to the author's page where the PDF versions are available, along with many resources to accompany the book. Of course, if you must have a dead-tree version, they are still available, new and used, from places such as Amazon.
The author has stopped updating the PDF and print versions of the book in favor of an online version. I have not experimented with the online version, although a quick peek at it leads me to believe that it is available for "in-class" use and for independent study. As such, it might be more useful to you than the PDF version.
As a caution, I've also seen a 4th Edition with the same title, but by a different author. It may, or may not, be an updated version of the same book, done with the original author's help and blessings. Having never read the 4th Edition I cannot say if it's connected at all.

To give a better idea of the content, and layout, of the book, I am listing an abridged version of the books Table of Contents.
Contents
I  Preliminaries

Data Structures and Algorithms

A Philosophy of Data Structures (The Need for Data Structures :: Costs and Benefits) | Abstract Data Types and Data Structures | Design Patterns (Flyweight :: Visitor :: Composite :: Strategy) | Problems, Algorithms, and Programs

Mathematical Preliminaries

Sets and Relations | Miscellaneous Notation | Logarithms | Summations and Recurrences | Recursion | Mathematical Proof Techniques (Direct Proof :: Proof by Contradiction :: Proof by Mathematical Induction) | Estimation

Algorithm Analysis

Introduction | Best, Worst, and Average Cases | A Faster Computer, or a Faster Algorithm? | Asymptotic Analysis (Upper Bounds :: Lower Bounds :: Θ Notation :: Simplifying Rules :: Classifying Functions) | Calculating the Running Time for a Program | Analyzing Problems | Common Misunderstandings | Multiple Parameters | Space Bounds
3.10 Speeding Up Your Programs
3.11 Empirical Analysis

II Fundamental Data Structures

Lists, Stacks, and Queues

Lists (Array-Based List Implementation :: Linked Lists :: Comparison of List Implementations :: Element Implementations :: Doubly Linked Lists) | Stacks (Array-Based Stacks :: Linked Stacks :: Comparison of Array-Based and Linked Stacks :: Implementing Recursion) | Queues (Array-Based Queues :: Linked Queues :: Comparison of Array-Based and Linked Queues) | Dictionaries

Binary Trees

Definitions and Properties (The Full Binary Tree Theorem :: A Binary Tree Node ADT) | Binary Tree Traversals | Binary Tree Node Implementations (Pointer-Based Node Implementations :: Space Requirements :: Array Implementation for Complete Binary Trees) | Binary Search Trees | Heaps and Priority Queues | Huffman Coding Trees (Building Huffman Coding Trees :: Assigning and Using Huffman Codes :: Search in Huffman Trees)

Non-Binary Trees

General Tree Definitions and Terminology (An ADT for General Tree Nodes :: General Tree Traversals) | The Parent Pointer Implementation | General Tree Implementations (List of Children :: The Left-Child/Right-Sibling Implementation :: Dynamic Node Implementations :: Dynamic “Left-Child/Right-Sibling” Implementation) | K-ary Trees | Sequential Tree Implementations

III Sorting and Searching

Internal Sorting

Sorting Terminology and Notation | Three Θ(n2) Sorting Algorithms (Insertion Sort :: Bubble Sort :: Selection Sort :: The Cost of Exchange Sorting) | Shellsort | Mergesort | Quicksort | Heapsort | Binsort and Radix Sort | An Empirical Comparison of Sorting Algorithms | Lower Bounds for Sorting

File Processing and External Sorting

Primary versus Secondary Storage | Disk Drives (Disk Drive Architecture :: Disk Access Costs) | Buffers and Buffer Pools | The Programmer’s View of Files | External Sorting (Simple Approaches to External Sorting :: Replacement Selection :: Multiway Merging)

Searching

Searching Unsorted and Sorted Arrays | Self-Organizing Lists | Bit Vectors for Representing Sets | Hashing (Hash Functions :: Open Hashing :: Closed Hashing :: Analysis of Closed Hashing :: Deletion)

Indexing

Linear Indexing | ISAM | Tree-based Indexing | 2-3 Trees | B-Trees (B+ -Trees :: B-Tree Analysis)

IV  Advanced Data Structures

Graphs

Terminology and Representations | Graph Implementations | Graph Traversals (Depth-First Search :: Breadth-First Search :: Topological Sort) | Shortest-Paths Problems (Single-Source Shortest Paths) | Minimum-Cost Spanning Trees (Prim’s Algorithm :: Kruskal’s Algorithm)

Lists and Arrays Revisited

Multilists | Matrix Representations | Memory Management (Dynamic Storage Allocation :: Failure Policies and Garbage Collection)

Advanced Tree Structures

Tries | Balanced Trees (The AVL Tree :: The Splay Tree) | Spatial Data Structures (The K-D Tree :: The PR quadtree :: Other Point Data Structures :: Other Spatial Data Structures)

V Theory of Algorithms

Analysis Techniques

Summation Techniques | Recurrence Relations (Estimating Upper and Lower Bounds :: Expanding Recurrences :: Divide and Conquer Recurrences :: Average-Case Analysis of Quicksort) | Amortized Analysis

Lower Bounds

Introduction to Lower Bounds Proofs | Lower Bounds on Searching Lists (Searching in Unsorted Lists :: Searching in Sorted Lists) | Finding the Maximum Value | Adversarial Lower Bounds Proofs | State Space Lower Bounds Proofs | Finding the ith Best Element | Optimal Sorting

Patterns of Algorithms

Dynamic Programming (The Knapsack Problem :: All-Pairs Shortest Paths) | Randomized Algorithms (Randomized algorithms for finding large values :: Skip Lists) | Numerical Algorithms (Exponentiation :: Largest Common Factor :: Matrix Multiplication :: Random Numbers :: The Fast Fourier Transform)

Limits to Computation

Reductions | Hard Problems (The Theory of N P-Completeness :: N P-Completeness Proofs :: Coping with N P-Complete Problems) | Impossible Problems (Uncountability :: The Halting Problem Is Unsolvable)


Students use the colors for more than just interpreting the purpose of the block.  In my introductory classes, the color assists early-learners with locating the blocks within an extensive collection of choices.

When give a chunk of pre-existing code to recreate, a block's color helps communicate where in the collection to look for it.


Is there any easy to use database platform that would allow 9th graders to enter data easily (like Google Sheets), and pull data using client-side JS?

Given that you're thinking about Google Sheets as a data entry method, I understand that your goals don't extend to getting the students to implement server-side form handling. But in that case, why do you need a database? It seems to me that the requirements given can be met perfectly well by a hand-coded JSON file.


Motivation for learning C++ when you know Java

I think you're having trouble justifying the study of C++ because of the way that you're thinking about it.  If you are aiming towards the practical benefits, then you immediately get to the following trap: neither you nor your students has any idea what languages they will work with in the future, so neither you nor your students have any idea what languages would be the most practical to learn.  There are no good answers when you begin this way, and the motivations will always seem to fall a bit flat.

I might steer the students (and you!) towards a slightly different model of thinking about benefits here.  What foundational ideas about programming and Computer Science are easier to grasp in C++ than in Java?  These foundational ideas will important later, regardless of the development environment, because they are the building blocks of computational thinking.

When we teach CS, we are concept-focused and language agnostic.

This lens also provides you with the beginnings of a map through the topic itself.  You can quickly sketch out a curriculum at this point, which is best done backwards:

What are the most important concepts that you want the students to learn?

Fair warning: I am not a C++ programmer!  There may well be more important topics than these to get into, but I know that C++ gives students an opportunity to learn about pointers, pointer arithmetic, and memory management.  You could also get into casting and bit-operations, which forces the students to learn about data representation.  Each of these concepts are fundamental to computers, and much harder to learn about in Java, which abstracts them away.

Selling the language to the students is now a comparatively easier task.  You're using C++ because you get to show them some very cool things about how computers really work.

The best time to do such selling is on the first day.  By explaining #1 to them at the beginning, you alter their motivation going forward.  They want to do well on the tasks you've outlined not only because it gets them a better grade, but because they are also mastering deep, important concepts that will help them understand computational thinking.  Computational thinking will help them regardless of what they do in the future.  Heck, they could leave the field entirely; they would still have mastered a rich and powerful tool-set for thinking about problems, wherever they go.

Now we get to the planning portion:

What is the most logical ordering of those concepts?
How will you (and the students!) know that the concepts have been learned?  This could be some combination of projects and assessments.

I've grouped these together because they are a little interdependent. Sometimes step 3 will cause you to go back and modify the order in step 2, but these two steps are how you arrive at a well-organized semester.  The best tasks for #3 are also rich and interesting in their own right.  (One resource I could recommend for help finding great, motivating tasks for a given concept is this very site.)

It is extremely important that you really get a good answer for #3.  If you've done these three steps well, then the projects and assessments will now be sufficient to prove that the students understand the material.  If you've truly answered #3, and you have total trust in that, then it frees you up to spend the entire course doing one thing:

Prepare your students to do really well on those tasks.

The reason that #4 is so important is because of the social dynamic that results. You really want your students to feel like you're on their side, pulling for the same team. And if your goal, every day, is to help them master the material, then they will be able to see that you are putting tremendous effort into trying to help them.  And there are also benefits to you here; as a relatively beginner teacher (who will certainly make some mistakes along the way!), having students who are willing to cut you a little slack can make your life a lot easier as well.

Now we have a strong course structure!  Tell the students about the cool concepts they will be learning, and tell them that C++ is a great language to focus in on these concepts.  Map out the order of the concepts that you'll be covering and tell them about the projects, tests, etc.  Then come in every day, and focus in a rather laser-like way on making sure that the students are well prepared for the important tasks that you've designed.

(Apologies for the length of this response.  I wasn't trying to write a book chapter, but I am leaving the information in in the hopes that you will find it very helpful!)


What would be reasonable to include in an Introduction to AI class for a 7th-8th grade after school program?

I don't have a lot of insight into your overall problem, but there is a resource you might consider.

There is a simple game, The French Military Game, in which a person plays against the computer. The totality of game information is small enough that the computer can remember every position in every game played, so it doesn't make the same mistakes in subsequent games. While it is a known win for the human player, after 6 or so plays it is very difficult to beat the computer.

The game is available (Java) in a couple of forms at the Greenroom, a place for educators using Greenfoot. Membership is open to any interested teacher.

The FMG once appeared in Creative Computing, now defunct, as an Apple II BASIC game. It uses a bit of math, but ok at the level you are interested in.

It is, at best, a simple, even naive, introduction to machine learning.

Disclaimer: I'm not associated with Greenfoot or the Greenroom.

The game is also discussed with code in Beyond Karel J Robot though that book probably isn't a good resource for your class.

Another user here (@Ben_I.) points to an applet version with a brief explanation of the game.


I struggle to understand technical things in cs? What can I do to improve?

Here are two pianists

Lovely lady 1
Lovely lady 2

Do you realize no 2 was once no 1?

Here's an In between  stage

To get a handle on the issue you need
ten thousand hour rule

You can reduce 10,000 hours to 1000 hours and go from world class to normal professional. Perhaps 1000 to 100 and go from professional to modestly proficient.

But even@100 that's about classroom time of two typical university courses.

Put another way musical proficiency takes about 10-15 years of work, medical 5-10.
Computer/software takes 3-4. Maybe you can reduce 3 to 1.

Have you put in that 1 gruelling year of work?


How to raise students' security awareness in programming?

Make it into an assignment/game. Each student creates a project that is passed to another, randomly chosen student, to hack. Give points for both the project and the "hacking" results. The hacking assignment should also be graded.

Security has to be taught and the value learned, usually painfully. I have lived through many "no one will do that!" only to have a product, or network, broken because someone did.


Java: The Complete Reference, which edition to follow

The fundamental question is, whether your goal is to learn programming (in which case the language doesn't matter at all … theoretically at least) or to learn Java.
If you want to learn programming, the programming language and the version doesn't really matter. It only matters insofar as to understand the examples, and to understand the concepts behind the code, you need to understand the programming language. So, the code and the programming language should be as simple as possible … e.g. a language like Scheme or Smalltalk, or you already need to know the language.
If you want to learn Java, then you should use a recent book, because there has been a lot of stuff introduced that not only makes stuff easier to read and write, but that fundamentally changes the way Java programs are written.
Sun dropped the "2" from "Java 2" in 2004. That should give you an indication as to how old this book is. It covers Java 2 1.4, which was released in 2002.
You don't have to chase every version, every release, every edition, every new feature (especially with the new 6-month release cycle), but since 2002, there have been multiple new features in the Java language that fundamentally change how Java code is written:

Java 5 (2004):

Generics
Annotations
Autoboxing/Autounboxing
enums
Varargs
The enhanced for loop
[LIB] JSR166 Concurrency APIs

Java 7 (2011)

[LIB] Extended JSR166 Concurrency APIs
[LIB] NIO.2

Java 8 (2014)

Lambdas
default methods on interfaces
[LIB] The Stream API

Java 9 (2017)

modules
[LIB] Reactive Streams

Java 10 (2018)

Local variable type inference

Java 14 (2020)

switch expressions

[I bolded the ones I deem to be particularly disruptive. I marked some features as [LIB] which are library additions to the Java platform and not language features, but are nonetheless important. E.g. NIO.2 offers a whole new, much higher-level, much improved way of interacting with files. And Streams essentially mean that you will never have to iterate over a collection ever again.]
Value Types and sealed Types will bring another major shift in the near future (possibly as early as Java 15 (October 2020)). In particular, sealed Types will allow modeling Algebraic Sum Types in Java, which opens up a fundamentally different way of structuring programs.
Oracle has recently started to include so-called Previews as well, these are features that are shipped as part of an official release, so they reach a wide audience, but that are not guaranteed to be supported in future releases in that form. They may be changed or dropped completely. One of those features is records that currently ship as a preview in Java 14. While they aren't as disruptive as some of the others (Generics, lambdas, Value Types, sealed) as they are just syntactic sugar, they allow to drastically reduce the amount of code for simple data classes, and thus make it easier to see what is going on.
For example, this:
final class Point {
    private final int x;
    private final int y;

    Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int x() {
        return x;
    }

    public int y() {
        return y;
    }

    @Override
    public boolean equals(Object that) {
        if (!(that instanceof Point)) {
            return false;
        }

        var other = (Point) that;
        return x() == other.x() && y() == other.y();
    }

    @Override
    public int hashCode() {
        return x() ^ y();
    }

    @Override
    public String toString() {
        return "Point[x=" + x + ", y=" + y + "]";
    }
}

Can be written in Java 14 as this:
record Point(int x, int y) { }


How can I credit to sources I'll use for my paid or free video tutorials on YouTube or Udemy?

The most general rule is that once you cite, you are no longer plagiarizing.  You can submit someone else's entire paper, and as long as you (very clearly) note that you didn't write a word of it, and that it was someone else's paper that you found interesting, you are no longer plagiarizing, as you are no longer representing someone else's work as your own.
The standards for citation are different in different settings.  In fully formal papers, you need to cite fact-by-fact, because every contribution needs to be traced directly.  In a video, it is sufficient to say that what you're presenting isn't developed by you, but really the work of other incredible people, and that you will link to those sources at the bottom of the video.  Again, the standard is whether you represent the work as your own or not.
A setting like an instructional video does not need (and typically does not support) each fact being separately cited.  Further, no one would expect it, any more than they would expect it in a lecture at university.
Good luck creating your course!


Explaining access levels and visibility in OOP

Here's an analogy that I've used for several years, and that students seem to understand. It doesn't focus on the rules, but why we have public and private and protected.

"Most of you know that I live down at the beach. If you find yourself riding past my house, and it's hot outside, you might come to my front door, knock and ask if you could have a soda. I don't live in a gated community, so anyone can come to my front door and knock. My front door is public. However, you can't open the front door, walk right in to my kitchen, open the refrigerator door, and help yourself to a soda! My refrigerator door is not public.

My children and grandchildren, however, who live next door, think nothing of walking into the house and getting anything they like out of the refrigerator. In our house, the refrigerator is protected; my family can directly access it, but the general public cannot.

Not everything in our family is protected, though. My kids know that going upstairs, finding my Visa card, and charging a new book at Amazon, isn't permitted. My Visa card, and the contents of my wallet, are private. No one else can access them directly; they have to make a request."


Since you specifically mention high-schoolers getting started with open source, i have to recommend the Google Code-In. I participated all 4 years as a high-schooler and really learned a lot about open source.

The contest essentially has a dozen or so open-source organizations provide "bite-size" tasks. Each task is mentored, so the students have someone specific to ask questions of. There are both coding tasks and non-coding tasks (documentation, QA, outreach).

The contest itself lasts for only a month and a half (December-January), but the hope is that people get into it and stick around with the open-source projects they contributed to. Many of the grand prize winners do exactly that. See, for example, this blog post by one of the 2014 winners. You can also read my blog post, though i didn't win.

For university students, there is the Google Summer Of Code, which is a similar idea with a rather different format. You must apply to be accepted, and do a single large task, and get paid a stipend.


What are good examples that actually motivate the study of recursion?

I find a very easy to understand example for recursion is the folder structure on a computer.
Look through all folders (within a certain location) and... list all .doc files, for example.

First, you look in the location you were given and see what you're looking for... or not, but you see more folders.
Then you take each of those folders, look into them and see what you're looking for... or not, but you see more folders.
Then you take each of those folders... (you get the idea)

It's a simple function to write and understand (at least in pseudocode, actual implementations may vary^^) and a concept that's easy to grasp for even a complete beginner. Introducing the problem and the manual solution, it's already obvious that each time, the same thing happens again and again. Pseudocode implementation is equally simple to write and grasp:
function findFiles(folder) {
  look for .doc files, if found add them to fileList.txt
  look for folders
  for each found folder: findFiles(foundFolder)
}

I've used this example to explain recursion several times, and never had trouble getting the person to understand it. Even non-programmers can grasp the concept like this.


Example for Introduction to Generics in Java

While uniform collections are the obvious example, you can also build or use a Pair class in which the types of the two components are given by generic arguments. If you don't want to build it, there is a built-in class with this property: $Pair<K,V>$

But building one like it is simple enough if that is your goal.

Once you have your desired class, Write a function/method that needs to return two things instead of one. Bundle them up in a Pair.


I realize that this isn't a perfect answer since it may lack the personal contact with an instructor that may be the most valuable. However Coursera has a number of courses that might provide the necessary background if you can match their schedule.

In particular Combinatorics and Probability should teach you sophisticated counting techniques.

They also have a series of courses on Discrete Math for Computing that probably covers the rest. (Combinatorics is one of the courses in this sequence.)

The downside, however, is that you don't get much in the way of a personal touch that you get in a face-to-face environment.

Some of the various online course sites provide some tutorial help and more provide peer-to-peer contact, but the quality of the help you get with that is likely spotty. It may help you get over some of the humps, but will be less valuable for building mathematical insight.


Java or Kotlin for beginners (procedural programming knowledge is existing)?

I've been using Kotlin for two years now on an introductory course on imperative programming (bachelor's first semester) and I'm very happy with this decision. Before Kotlin, I was using Java for the same course.

Here are some of the benefits:

No need to explain what are classes on a imperative programming course, since Kotlin programs can only have a main() top level function (like C)
It is a "safe" language in the sense that it prevents most novice mistakes at compilation time (uninitialised variables, type conversion errors, etc.)
For simple interactive programs (e.g., ask two numbers and compute their sum), you don't need all the complexity of the Scanner/BufferedReader classes, just use readLine() and println() (without the System.out). This makes the initial learning curve much more pleasant.
It forces the students to think about the little things that are essential when you are taking the first steps in programming: mutable vs immutable variables, nullable vs non nullable types, mandatory variable initialisation, implicit vs explicit types, conditions as expressions, etc...
It is easy to jump to Java in later courses (than say Python or Javascript)

Most of all, from my experience students find it more motivating to learn to program in Kotlin than Java, since they have to write less to accomplish the same things while at the same time feeling protected about runtime errors.

My advice: go for Kotlin.


Improve motivation in the final part of a project based course

In my program, we have a year-long culminating capstone project which has a format that might work well for you.  Traditionally, high school seniors in this area of the world catch a disease called "senioritis" that prevents them from doing a lot of work as they enter into the last few months of high school.  It's a highly contagious disease, though once caught, you often gain a subsequent immunity (such as in college or graduate school).

We

The format of the year is:

Choose projects
Work towards completion
Give final presentations to outside judges
Final cleanup and submission

Here are the details for steps 2-4 that make this all work:

Working towards completion is done using milestones.  The students decide what the next logical part of their project is, and negotiate with the teacher what they will accomplish by the next check-in date. (They also negotiate what the next check-in date will be).

In my experience, I have to dial my students back more often than I have to push them forward. Students often have big ideas, and little sense of how long those ideas will take to enact.

I keep a public calendar of which groups I will need to see each day. With any extra time, I check in with active groups to see if they need any help.
Final presentations

We rehearse our final presentations in small assignments during the weeks leading up to the big day, and I give critiques to help improve the presentations as we go.

On the big day, we use a big(ish) venue, invite the underclass CS majors, and have a panel of outside experts as judges.

It is extremely important that the teacher not be an evaluator for the final presentations. This keeps the pressure up, both on the students, and on the teacher!
Instead, outsiders are brought in (and provided a grading rubric!) who will judge the final projects and finally presentations on their merits.  Some of these outsiders may still be from our institution, but not all of them, and no one who has been in any way involved in a project.

These final grades are averaged together, and will eventually be mixed in with the milestone grades.

But first, the student is given... a zero!

Well, not really. But the grade they receive from the judges is provisional. They have to finish up the last pieces in order to receive this grade.
Final cleanup and submission

This is the phase, usually about 2 weeks after the presentations, during which the students have to do their 'i's and cross their 't's. Is the project actually finished and documented? Do the clients have the access and support they need to actually use them? Are the projects actually submitted on GitHub to the teachers? Have the students filled out an end-of-program questionnaire?

Once those pesky boxes are all checked, students are finally awarded the grades from the presentations.

Put all together, all of these moving parts seem to prevent senioritis completely. The high fliers want to put their best foot forward for the outside experts. The strugglers work very hard to make sure that their project actually comes together before the big day. The final checklist means that I am not left with a bunch of 99% completed projects at the end of the whole process.


Why isn't Functional Programming Taught First?

The why isn't necessarily related to the relative quality or benefit of the various approaches to the first courses. But some of the comments given to the question capture part of the reasons.

First, FP isn't precisely mainstream in industry. Most programming in the real world is now is done in Dijkstra-derived languages, not McCarthy-derived ones. This may change, of course, as the world starts to recognize the benefits of FP as it previously did for OOP. As the questioner mentioned FP has advantages in some important areas. But most curricula take a look at who is hiring entry level folks and what they want to see in the person's background.

Another reason is that most of the faculty is much more knowledgeable about those mainstream things than others. If the faculty went through a long program in which almost everything is built in Dijkstra-derived languages that is what they are more likely to teach beginners. OTOH, faculty (including some folks here) who went to, just to pick a name, MIT, are more likely to start in FP, but may still be constrained by the first reason.

Most faculty still think of FP as an advanced topic and so Let and Lambda tend to come late in the curriculum, after the students have seasoning. As you suggest this is not necessary, and may not be desirable, but there is a lot of inertia.

There is always some mental disruption when a student is asked to change paradigms, since a paradigm is built on a consistent mental model that is also relatively closed, not needing outside explanations. Paradigm shift is, in general, difficult, even for experts. The HS or undergraduate curriculum is short in time so most faculty are resistant, at least a bit, to require uproar in the middle of the two or four years. Much better, it is normally thought, to treat one paradigm as the main-line and any others as nice but inessential to the main goal.

If you have a lot of chickens, you get a lot of eggs. OTOH, if you have a lot of eggs, you get a lot of chickens. Pigs, not so much.

However, if you are going to teach any given paradigm, you need to do it well. You need to make students completely comfortable in that paradigm so that when presented with a new problem they aren't confused about how to begin or what should be the next step. Languages/paradigms should fit like a comfortable pair of shoes. I'm not certain that current OOP education is as good as it could be, actually, but that is due to my own background. If we suddenly adopted FP widely, you might well think the same thing about the then state of the art concerning FP. Change happens, but it is slow and is resisted.

Students need two things at least. They need to be able to solve problems so that they can be successful in academia and/or the world of employment. But they also need to be able to think and be flexible so that they are able to move with the times as necessary. So we tend to teach one paradigm completely (for the first goal), but allow them exposure to others (for the second). Mostly it works.

I'll also note that learning new languages is actually harder than it is often represented to be. If two languages are within one paradigm and have similar concepts then it may seem to be merely a question of new syntax applied to old ideas. Java and Python have similar ideas but quite different syntax. But learning the syntax of Python as an experienced Java programmer won't make you pythonic. But changing paradigms is much, much harder, even when the syntax is nearly the same. I'll note that C++ was derived from Dijkstra's ideas primarily (via Simula), whereas Java's core concepts come from Alan Kay. If you don't understand that then you can wind up programming badly in both languages.


Problematic student at a very high level

The best way to deal with this kind of student is to head it off at the pass.  If you can get the student at the beginning, you can often prevent the problem from festering in the first place. I have a student coming in next year who I have already been warned will have this problem, and I plan to show this to my class on the first day:

I will then say something like, "For whom is this situation unfair?"

When the kids point to the fish, I will point out that it is just as unfair to the monkey.  I will then ask them to talk to a neighbor and figure out why.

I will finish up by saying that I have a promise for the fish of the class: everyone who puts in the work will be able to climb the tree.  That's MY job.  However, I have to find a way to be fair to the monkeys as well.  That means that I must reserve the right to try to find ways to push them to get better in my classroom.

If they are in that position, and can get the work done very easily, and find that I give them harder work, I ask a few things of them: (1) understand that this is fairer than it may initially feel, and (2) understand that this comes from a place of actually caring about them as people. Making more appropriate assignments for them is harder for me as well. If I didn't care about them as people, I could just let them get away with the minimum.

In essence, then, I am trying to recast making differentiated, harder assignments into something that the students will understand as both a loving act, and one that respects them deeply as individuals.


Scratch comes with a large document of day-by-day lessons along with labs.  As a side benefit, due to the exploratory nature of Scratch, creating new assignments is fairly simple.  "Create a movie about ____" or "create a small game that involves bouncing" or "create a game that responds to sounds as the controls".
Actually, that blank is great.  You can tell the students to create a "movie" or a game about any topic the kids are studying elsewhere in the curriculum, and allow them to make use of all of the techniques they've learned and explore other parts of the program.
To my thinking, it's also advantageous to use scratch concurrently with logo, since using two systems will introduce the key computer science concepts twice within two giant, open, exploratory worlds.  This increases the chances that the kids will see the parallels and really begin to absorb the computer science concepts.


How to give assignments that require heavy computational resources?

Don't.

Most computionally intensive problems can be stripped down to something that's just as instructive but runnable on any normal computer. In particular, for inexact algorithms, you can generally trade off accuracy against computational cost, and often actually get still quite good results with only a fraction of the cost of a publication-level run.

I always like to emphasize that stuff like physics simulations (which is what I work on, and have also done assignments for students) or image classification should in principle, mathematically speaking, have infinite computational cost: an image is a function from continuous 2D space to colour space, i.e. the space of images is an infinite-dimensional $L_2([0,1]^2)$ Hilbert space. When doing numerics one quickly (IMO, often too quickly and without proper thought) restricts everything down to a finite-dimensional subspace thereof, but that's to some degree arbitrary – the subspace just needs to be big enough (and suitably constructed) to still represent the features that are important for the use case.

In an image-processing example, you should definitely check how much you can downsample the images that the students should work with and still get somewhat sensible results. If necessary, choose only a smaller set of images with clearer distinguishable features, that the algorithm can pick up quickly.

If the results aren't so great with a stripped-down accuracy, well, that's actually particularly instructive, because this kind of tradeoff is absolutely crucial in real-world applications too. You may have more processing power available in a research of commercial situation, but you'll also have much higher demands in terms of data amount and needed accuracy. So, discuss these points intensively, and make a presentation of how much better the students' results look when run by you in higher resolution on a solidly powered machine.


How can I set up Eclipse/eGit/GitHub in a way that is easy for students?

To me it sounds like your students lack an understanding of the fundamentals of IDEs and Git.

  if I ask them to use the command line, they will never do it.

If they don't know git init and git clone (origin) then I'm sorry, they do not know Git, they should learn this first (along with push, pull, commit, status, fetch).

  Researching this, the stock advice seems to be to set up the repository outside of the Eclipse project. That, however, has the effect of putting all the source code outside of the Eclipse workspace, which is confusing. Worse yet, I can't then import the project correctly into another Eclipse environment.

This is another problem in itself. The high level explanation is you only need package level codebase with only the src, the bin is generated by Eclipse. You still need to create a project in Eclipse and then import the package. Any further problems should be asked on StackOverflow.

  The other method would be to put the repository (and .git) under the Eclipse project.

NO! The .git is generated by git init. Do not copy any configuration, especially hidden files from project to project.

I think you are jumping the gun here. Eclipse and Git should be separate lessons. If they are confused by both then that just means they need to learn what each of them are, before combining them.

I suggest:
Teach Eclipse, how to create projects, what packages mean, how to import, etc.
Teach Git, init, clone, pull, commit, push, status, fetch using Terminal or CommandLine for Git. Depending on the age group you might want to teach them how to resolve conflicts, what decentralized means, branching, pull requests, etc.
Now teach them Eclipse Marketplace, download plugin and integrate Git with Eclipse.

  So does anyone have a setup for Eclipse and eGit that successfully puts the entire project into version control, and is not confusing for students? And that allows the project to correctly import into Eclipse?

As all my professors do it, you need to create the repository with the project for each student and have each student clone and import into Eclipse. I'm not an educator so I don't know if there is an existing setup available online. However, I do think this is actually a very trivial task if they understand Eclipse and Git.


Tips for self-study with just a textbook and google

Your general plan seems good: Do a lot of exercises. An old proverb (Chinese, but maybe more general) is that you don't know something until you've practiced it ten thousand times. (Rule of 10,000).

I've found wikipedia to be quite good, but not perfect, for questions on mathematics. Be a little skeptical if anything seems a bit strange in an article there. I once came upon an article that seemed sketchy in part - just a paragraph or two in the middle of a long piece. I came back in an hour or two and it was gone. A professional isn't likely to be misled, but a student should be just a bit cautious.

Also, take notes. What are the most important three ideas in this section/chapter? Don't try to re-write the book, just abstract the gems. Highlighting has less impact since your brain is less engaged. You want to do things while self studying that are "active" enough that your neurons get rearranged. This is why the exercises are especially good.


How to write a grading rubric for coding assignments?

This is what I have for my Java assignments. Notice that this is not a programming course, but an algorithms course.

Compiling and running (8 points)

1.a 0 points if the program doesn't compile. No points for the rest. Grading complete.

1.b If the code compiles and runs:

a   Full points if it succeeds in all test cases.
b   0.5 deducted for each failing test case.

2. Readability and submission (2 points)

2.1 Documentation (Oracle official)
    a. 0.5 points for complete commenting
    b. 0.4/0.2/0 (%) if we detect 0-25/25-50/75-100 (%) missing comments where expected.
    You should at least use clear commenting for the following:

        a. Classes and interfaces
        b. Fields
        c. Methods, including all input parameters and return values

2.2 Indentation (Oracle official)

    a. 0.5 for appropriate indentation
    b. 0.4/0.2/0 (%) for 3/6/more violations

2.3 Submission:

(0) 1 points for (not) correctly following the requirements for submission.

I would appreciate your feedback on this.


Materials on database indexing with examples

The wikipedia entry is informative.

Database Systems: The Complete Book by Hector Garcia-Molina, Jeffrey D. Ullman, and Jennifer Widom  is probably good. Older versions of database books by Ullman have been accurate and reliable. I haven't seen the latest version, though.

Actually, most of my experience with Ullman has been his compiler books, not database. Still, though, a reliable person. More than just a random author.


Overcoming a friend's self-discouragement

I am not sure if I agree with the "monkey" part! Maybe everyone is capable of writing some code. Building serious apps is another thing...

Anyway, show her the code.org website, and let her play around for a while. If she does not like, then probably she is not fitted for this "monkey thing" :)


Grading source code in an online environment

I would suggest you use a code review tool. This is something they will likely need to be using when working in industry. So worth upskill them on it now.
You can use githubs one for free.
(You are teaching version control so that should be easy enough)
Get your students to create a pull request and review that.
You can highlite specific lines and put comments against them etc.


"Computer sciency" and "practical" exercices involving dictionaries

Some project ideas:

Implement a very basic programming language. Write the parser for them, but have them manipulate the AST (eval expressions, perform constant folding, etc). (So hey, trees are a thing...) And of course, all programming languages have variables. How do we store variables? Hey, wouldn't having dictionaries be useful...?
Use dictionaries to implement a "sparse vector" class. Use the sparse vector class to implement TF-IDF and cosine similarity. Then, use TF-IDF/cosine similarity to implement a search engine. If the students are unfamiliar with linear algebra, you can skip the "sparse vector" bit and have them implement TF-IDF directly.

Bonus! Have the students also implement page rank, which ties in to graphs.

(Want to integrate even more concepts? Have them write their own sorting algorithms to sort the final results. Go even further? Rather then using a sorting algorithm, have them implement top-k-sort on top of a heap so they efficiently select just the top k results in worst-case O(nlog(k)) time.)
Have them implement literally anything related to graphs. After all, you can pretty much always get away with implementing an adjacency list as just a dictionary of keys to some collection (a list or a set). This means that any problem where you manipulate an adjacency list can also be a dictionary assignment in disguise.

And there's a huge wealth of interesting graph problems out there -- have them implement pathfinding on a map of your local city using Dijkstra's, have them generate interesting and randomized mazes by adapting some MST algorithm, have them analyze a DAG, etc...
If you also want to integrate a bit of systems, you could maybe have the students implement a simplified version of Git. After all, git is just a DAG and all graph problems can be turned into dictionary problems. (It's also an interesting application of hashing!)

You'll probably need to give them code to do file IO for them, and maybe handwave or simplify the whole merge business, depending on how complicated it ends up being. (Or maybe not? I don't know much about the merge algorithms git uses, but it's entirely possible they could end up being interesting applications of dictionaries in their own right.)
A simpler assignment (more for CS 2 students): have the students read in simplified grammars in BNF format. Then, recursively (and randomly) traverse that grammar and generate some output. Have the students invent their own grammar -- there's room for creativity here. You could generate randomized poetry, randomized programs, etc...
Have the students do something with n-grams and Markov chains. As before, this is really just a graphs assignment in disguise -- each node is an n-gram; you store a weighted edge from one n-gram to the next.

If you want to stick with the whole "secretly a graphs" thing but keep the math part light, have the students use Markov chains to generate text. You can have a lot of fun with this -- feed in Shakespeare to generate vaguely Shakespeare-ish text, feed in your Facebook data to generate text that sounds like you... You can also experiment with doing this on a character level and try feeding in corpuses from different languages. As it turns out, auto-generated English is pretty distinct from auto-generated French.

The algorithm to do this ends up being pretty similar to how you do the BNF thing since it's just randomized graph traversal. If you wanted to make a point about the importance of abstracting and refactoring code/adapting to sudden changes in the project spec, you could perhaps tie it in here (though tbh it feels a little contrived/might be more trouble then it's worth though).

Alternatively, if you want to avoid graphs but don't mind bringing in some stats, have them do basic basic classification instead, and give them a taste of machine learning. (E.g. can you classify spam emails vs non-spam emails? Can you classify which human language some text likely came from based on letter frequencies, character n-grams, and so forth?).

My memory is a little hazy here, but I think you don't really need a graph (explicit or implicit) and just need a way of storing a discrete probability distribution. (And a dictionary is great way of doing that -- map n-grams to the probability that n-gram occurs.)

Disclosure: I did variations of assignments 1, 2, and 3 for a data structures course I just finished teaching + made them multi-week partner projects. They went reasonably well, though #1 may have been a tad ambitious.


Do you know of a complete textbook for teaching databases?

I've taught a lot of people SQL in person (over 3000), and I've had to cobble together materials out of a bunch of resources to do it.

For Exercises:
http://sqlzoo.net
http://pgexercises.com
https://www.codewars.com/?language=sql

For slides, you can use mine, just fork them and remove the branding (they are CC-licensed, the branding is just there to look nice): https://slides.com/lizh/sql-intro

Make diagrams or have students make diagrams with: https://app.quickdatabasediagrams.com/#/

Usually the way I see SQL courses go:

Start by covering enough to get them through querying- have them start with one of the exercise sets above. You may want to break it down into a few class periods - basic querying and filters, followed by joins, and then more complex joins / functions.

Next, have them model data. If you model some data for them, then present a problem for them to do in groups, they usually get the idea pretty well and can self-grade. Then, have them choose something to model individually.

Students should first try to model some data that has 2-3 relations, then model data with a many-to-one relation, then more complex relationship models (relating through 3 or 4 tables).

Some really great things to model, either as a class or as individual projects:

Books (books are great because you can start with a simple model, then factor it out to third normal form, and then identify where it would vary by application greatly, eg amazon.com vs a library, they need different data models).
Keyboard shortcuts (because you can relate them to applications, and keys)
Transit (routes and schedules and busses, most students are familiar)
Food (you can go a million different ways with this, this is a very difficult data model to do properly)
Content (users, posts, comments, upvotes, block list. Do this one yourself as an example, it's in too many walkthroughs to be a good assignment.)

If this helps, I am the CTO over at enki.com, and we have an open-source CC-licensed curriculum here: https://github.com/enkidevs/curriculum
and a free app students can use to do daily practice with SQL here: https://enki.com/


What is the CS Analog To Learning One's Multiplication Tables?

"Analogous" could mean different things, depending on which analogy you choose to make. To me, the key thing about learning multiplication tables is that you are memorising the answers to some simple questions which will appear as subproblems to many other things you have to do; so that you don't have to derive the answers again each time those subproblems occur. @Buffy's answer describes some of the fundamental abstract concepts which programmers certainly need a solid understanding of, but I would not count things like "sequence" and "alternation" as problems for which we apply solutions from memory; so I infer that @Buffy sees a different analogy to the one I do.

For the analogy as I see it, there are some commonly-occurring subproblems in imperative programming which we do use memorised solutions to. I would think of @Buffy's fundamental ideas as analogous to the ability to do multiplication, and the understanding of when/why to multiply; they should be learned before it makes sense to memorise the answers to multiplication questions. Likewise, understanding what sequential, conditional and iterative statements are and when/why to use them in a program should precede memorising how to apply them to solve particular problems.

To give some idea of the kind of subproblems and memorised-solutions I mean, the below list is not at all complete, but should help to illustrate by example:

Q: How to iterate over just some elements of a collection? A: Write a loop over the collection, and an if statement inside the loop to "filter" for just the elements you want to iterate over. The code for processing each element should go inside the if statement.
Q: How to find the sum of a collection of numbers? A: Initialise a variable sum = 0, and use a loop to do sum += x for each x from the collection.
Q: How to count the number of occurrences of something in a collection? A: Initialise a variable count = 0, and write count += 1 each time that thing is detected to have occurred.
Q: How to find the "best" (maximum, minimum, etc.) thing in a collection? A: Initialise a variable best to be the first thing from the collection, and write a loop over the remaining elements. Each time a new element x is observed, check if x is "better" than the current best, and if it is, update best = x.

These memorised solutions to commonly-occurring subproblems are closely related to the ideas of "roles of variables" as described by Sajaniemi and "plans" as described by Soloway & Ehrlich; I use the word "plans" to describe them. I'm not aware of any comprehensive list of them; I was able to think of some, which I've written about in Python and used for teaching undergraduate students (with limited success - perhaps we didn't spend long enough for the students to memorise the plans by repeated practice). I have written a similar document for Java which I don't have to hand immediately, but I can post it later if there is interest.


The Fifth Element or What Elements Are Correlated With CS Success and Does It Matter?

As I indicated in my other question, I have found that there are always a few students who don't seem to get it.  This leads me to suspect that there may well be some small number of persons who are so disadvantaged that it may be effectively impossible for them to become strong programmers.
However here are a few words of cautions:

Even if this is true, what of it? The fact that I have not figured out how to teach Johnny how to code does not necessarily mean Johnny is incapable, and I am still obligated to keep trying to find new ways to reach him.  If, in fact, he really is incapable, I will ultimately fail, but I have no way to distinguish between him and Samantha, who is entirely capable, but has yet to have some key piece of information click into place.

The number of people should be quite small.  For me it has run around 5-10% of students.  I work with a "gifted" population, so that number might be a little smaller than would be found in other populations, but it shouldn't be wildly different.  As you have pointed out, general brightness is a poor indicator.
If you're finding that >25% of your students are seriously struggling, then there are additional factors beyond "student ability" that you need to be examining.


Next year I'm planning on having some of my second and third year students build an API that can then be used by students in our mobile development classes, and possibly web development classes.

Hadn't thought of this before reading your post, but I think I may have part of the requirements be that they write documentation for the API so that the other classes can use it without having direct interaction with the authors. Since git, and specifically GitHub, is part of the task it makes sense that the documentation should be written in markdown. Seems like a good excuse to go over it in class.

A couple years ago I had a student that started teaching themselves Latex as part of an independent project. His goal was to create a calculus equation solver. He did fairly well learning Latex, but I'm not sure how I would go about bridging that in to a full class project.