recentpopularlog in

kme : advice   178

« earlier  
Kernighan's lever
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?

Pay close attention to what is actually being said: Having written code as cleverly as you can, you will suddenly face a problem that you are not clever enough to solve.

Kernighan's witty remarks provide a clue: In programming, as soon as you work at your current level, you will automatically end up in a situation where you have to work beyond your current level. By means of this very fortunate mechanism, you will leverage several basic human drives (honour, pride, stubbornness, curiosity) into providing the motivation necessary for improvement.

I call this mechanism Kernighan's lever. By putting in a small amount of motivation towards the short-term goal of implementing some functionality, you suddenly end up with a much larger amount of motivation towards a long term investment in your own personal growth as a programmer.
devel  software  debugging  advice  career  growth  kernighan 
september 2019 by kme
Sadhguru & Shekhar Kapur - On Relationships | Readable |
Sampled in: "Another Rainy Day (Trip-Hop - Lofi - Chill Mix)" (

The linked YouTube video is:

<blockquotewhen it's all about yourself you will not know the beauty of life
edm  sample  quote  advice  relationships 
july 2019 by kme
Julio Biason .Net 4.0 - Things I Learnt The Hard Way (in 30 Years of Software Development)
"A language that doesn't affect the way you think about programming, is not worth knowing." -- Alan Perlis
antipatterns  coding  programming  career  advice  tipsandtricks 
june 2019 by kme
SHA-1 collision attacks are now actually practical and a looming danger | ZDNet
should switch to (in order of preference):

* SHA-512/256
* SHA3-256
* SHA-384
* Any other SHA2-family hash function as a last resort

"...unless they're storing passwords! In which case, they should switch to (in order of preference):

* Argon2id with memory >= 32MiB, >= 2 rounds, and >= 2 parallelism
* scrypt / yescrypt with memory >= 32 MiB, >= 4 rounds, and >= 1 parellelism
* bcrypt (for PHP devs, password_hash() and password_verify() does the trick)
* PBKDF2-SHA512 with 85,000 iterations as a last resort

"But SHA1 should no longer be used anymore. No excuses," Arciszewski
sha1  cracking  crypto  hashing  algorithms  advice 
may 2019 by kme
teaching - Mimic lecturing on blackboard, facing audience - Academia Stack Exchange |
I teach mathematics at MSc and PhD levels. My preferred method of teaching is old-fashioned: talking and writing on the blackboard at the same time.

Why? Because it has many advantages:

Handwriting: imposes few restrictions on notation and illustration. (Complicated figures I could project from my laptop, but I have no need for this in my courses.)
Flexibility: whenever this is useful, it is easy to 'deviate from the script'.
Natural speed: it imposes a natural speed on the speaker. Preparing slides using LaTeX or PowerPoint and just clicking through them, I find myself proceeding way too fast.
Parallel displays: having several boards available for writing makes it easy to keep some text/examples on display on one board, while writing on another.
Dynamics: referring to information on the different boards allows me to move through the room, adding a more dynamic aspect to the lecture.
Ease: it is a low-tech way of achieving all these things simultaneously with easily available means.

The main disadvantage of this method is that I spend a significant amount of time of each lecture with my back to the audience.

Question: What would you recommend as a means of communication that combines the six features above (most importantly, the handwriting and parallel displays), but facing the audience?

@TobiaTesan I think the technology is just now (well, the 3 years ago as I was leaving school) coming into its own. I had a professor who wrote pages under a very sharp document cam, but then pressed a button to save the picture and keep it on one display while moving on to the next page. Multiply by 4 displays and you are on par with the big sliding blackboards of old, with the benefit of saving the notes for later upload (and not having to wipe old chalk off everything). – mbrig Mar 21 at 4:19
oldschool  pedagogy  teaching  blackboards  instructionalaids  advice  bestpractices 
march 2019 by kme
The role of instructors in teaching programming — Python for Biologists |
This is another aspect of programming that experience tends to render invisible: when you encounter a roadblock in programming and need to ask for help, very often it's difficult to know how to phrase the question. The lack of understanding that causes the student to need help in the first place also ensures that they're unlikely to know what question to ask, or the right way to phrase it.

Of course, later on in the learning process it usually becomes clear how mindblowingly useful programming is (and I purposefully structure my courses to get students to this point sooner rather than later). Nevertheless, one of the biggest problems many students have when learning programming is simply running out of steam and becoming demoralized – a process that is usually triggered by encountering yet another roadblock.
programming  teaching  learning  computing  workshop  advice  bestpractices 
february 2019 by kme
The Unix Shell: Instructor Notes |
Many people have questioned whether we should still teach the shell. After all, anyone who wants to rename several thousand data files can easily do so interactively in the Python interpreter, and anyone who’s doing serious data analysis is probably going to do most of their work inside the IPython Notebook or R Studio. So why teach the shell?

The first answer is, “Because so much else depends on it.” Installing software, configuring your default editor, and controlling remote machines frequently assume a basic familiarity with the shell, and with related ideas like standard input and output. Many tools also use its terminology (for example, the %ls and %cd magic commands in IPython).

The second answer is, “Because it’s an easy way to introduce some fundamental ideas about how to use computers.” As we teach people how to use the Unix shell, we teach them that they should get the computer to repeat things (via tab completion, ! followed by a command number, and for loops) rather than repeating things themselves. We also teach them to take things they’ve discovered they do frequently and save them for later re-use (via shell scripts), to give things sensible names, and to write a little bit of documentation (like comment at the top of shell scripts) to make their future selves’ lives better.

The third answer is, “Because it enables use of many domain-specific tools and compute resources researchers cannot access otherwise.” Familiarity with the shell is very useful for remote accessing machines, using high-performance computing infrastructure, and running new specialist tools in many disciplines. We do not teach HPC or domain-specific skills here but lay the groundwork for further development of these skills. In particular, understanding the syntax of commands, flags, and help systems is useful for domain specific tools and understanding the file system (and how to navigate it) is useful for remote access.

Finally, and perhaps most importantly, teaching people the shell lets us teach them to think about programming in terms of function composition. In the case of the shell, this takes the form of pipelines rather than nested function calls, but the core idea of “small pieces, loosely joined” is the same.

Installing Bash and a reasonable set of Unix commands on Windows always involves some fiddling and frustration. Please see the latest set of installation guidelines for advice, and try it out yourself before teaching a class.

Tab completion sounds like a small thing: it isn’t. Re-running old commands using !123 or !wc isn’t a small thing either, and neither are wildcard expansion and for loops. Each one is an opportunity to repeat one of the big ideas of Software Carpentry: if the computer can repeat it, some programmer somewhere will almost certainly have built some way for the computer to repeat it.

Building up a pipeline with four or five stages, then putting it in a shell script for re-use and calling that script inside a for loop, is a great opportunity to show how “seven plus or minus two” connects to programming. Once we have figured out how to do something moderately complicated, we make it re-usable and give it a name so that it only takes up one slot in working memory rather than several. It is also a good opportunity to talk about exploratory programming: rather than designing a program up front, we can do a few useful things and then retroactively decide which are worth encapsulating for future re-use.
shellscripting  unix  linux  shell  bash  butwhy  programming  sevenplusorminustwo  teaching  workshop  reference  advice  bestpractices 
february 2019 by kme
HOWTO: Get tenure |
Simpler advice would be: “Find a problem where your passions intersect society’s needs.” The rest will follow.

Doing a good job with teaching is perversely seen as a cardinal sin in some departments.

Focusing on teaching gets interpreted as a lack of dedication to research.

Let’s be clear: refusing to improve one’s teaching is morally unacceptable.

Torturing a captive audience every semester with soul-sapping lectures is criminal theft of tuition.

On metrics

Pre-tenure professors are often bombarded with metrics, targets and benchmarks to hit for tenure.

Everyone has heard horror stories of departments obsessing over specific metrics for tenure, and of the golden yet square pegs that failed to fit into round holes.

Goodhart’s law applies:

“When a measure becomes a target, it ceases to be a good measure.”

And, a quote I once heard on NPR:

“We can’t measure what counts, so we count what we can measure.”

Good departments will find a way of side-stepping metrics to judge what counts.

I realize that few patients or parents have the ability to do what I did, and they never will, until all of academic medicine goes open access.

In computer science, academic paywalls stifle.

In medicine, academic paywalls kill.
science  academia  tenure  phd  highered  advice  education  teaching  openaccess  publishing 
october 2018 by kme
Write clean code and avoid the distractions of emerging technology |
The coding hours you put in with more stable tech mean better verification of correctness due to the great amount of literature and experts in these areas and more chances to master the act of writing code for the consumption of other humans. Practical software development has always borrowed from multiple paradigms and you will find it possible to move between them when natural glide paths arise. Forcing this out of fear of being left behind is not helpful.
devel  programming  communication  forhumans  advice 
april 2018 by kme
Git: what they didn’t tell you | Steve Bennett blogs |
Don’t call any remote ‘origin’

You will never understand “git reset”‘s options

The difference between “git reset”, “git reset –soft” and “git reset –hard” is beyond your comprehension. And you probably wanted “git checkout” anyway.

Rule of thumb:

If your directory is FUBAR: git reset –hard
If you just want to throw away changes to one file: git checkout file
In all other cases, google it.
git  scm  newbie  annoyance  gotcha  advice  bestpractices 
november 2017 by kme
How I spend my first 5 minutes on a server | Hacker News
You should never even have a "my first five minutes on a server" type thing anyway. Rolling out a new server should be fully automatically operationalized. The first time you log into the server, it should be completely ready to go. It should be ready to go without you needing to log into it at all. This takes a small amount of up-front effort, and will pay off immediately when you bring up your second server.
syadmin  devops  tipsandtricks  advice  bestpractices 
may 2017 by kme
My 10 UNIX Command Line Mistakes – nixCraft
From all those mistakes I've learnt that:

Backup = ( Full + Removable tapes (or media) + Offline + Offsite + Tested )
The clear choice for preserving all data of UNIX file systems is dump, which is only tool that guaranties recovery under all conditions. (see Torture-testing Backup and Archive Programs paper).
Never use rsync with single backup directory. Create a snapshots using rsync or rsnapshots.
Use CVS to store configuration files.
Wait and read command line again before hitting the dam [Enter] key.
Use your well tested perl / shell scripts and open source configuration management software such as puppet, Cfengine or Chef to configure all servers. This also applies to day today jobs such as creating the users and so on.
sysadmin  unix  linux  acautionarytale  advice  bestpractices 
may 2017 by kme
teaching - Establishing authority in the classroom - Academia Stack Exchange

The position of TA automatically comes with a certain amount of authority, which is referred to as legitimate power. Having said that, you can increase your perceived amount of authority by demonstrating expertise in the subject area (expert power). Expertise needs to be combined with the ability to actually communicate the complex material as well. It is much harder to communicate complex information than it is to be an expert in complex information.

In addition to these skills, authority can be further enhanced through softer skills such as demonstrating care for the students and providing additional support when necessary (referent power).

A third teacher, who was much loved, never punished but kept excellent discipline, while remaining very human. He would joke with us, and then impose a mysterious stillness. In the street he looked upright, but relaxed, and he smiled easily.

I thought about these teachers a lot, but I couldn't understand the forces operating on us. I would now say that the incompetent teacher was a low-status player: he twitched, he made many unnecessary movements, he went red at the slightest annoyance, and he always seemed like an intruder in the classroom. The one who filled us with terror was a compulsive high-status player. The third was a status expert, raising and lowering his status with great skill. The pleasure attached to misbehaving comes partly from the status changes you make in your teacher. All those jokes on teacher are to make him drop in status. The third teacher could cope easily with any situation by changing his status first.

Again I change my behaviour and become authoritative. I ask them what I've done to create this change in my relation with them, and whatever they guess to be the reason — 'You're holding eye contact', 'You're sitting straighter' — I stop doing, yet the effect continues. Finally I explain that I'm keeping my head still whenever I speak, and that this produces great changes in the way I perceive myself and am perceived by others. I suggest you try it now with anyone you're with. Some people find it impossible to speak with a still head, and more curiously, some students maintain that it's still while they're actually jerking it about. I let such students practise in front of a mirror, or I use videotape. Actors needing authority — tragic heroes and so on — have to learn this still head trick. You can talk and waggle your head about if you play the gravedigger, but not if you play Hamlet. Officers are trained not to move the head while issuing commands.
teaching  advice  authority 
march 2017 by kme
teaching - Establishing authority in the classroom - Academia Stack Exchange

The position of TA automatically comes with a certain amount of authority, which is referred to as legitimate power. Having said that, you can increase your perceived amount of authority by demonstrating expertise in the subject area (expert power). Expertise needs to be combined with the ability to actually communicate the complex material as well. It is much harder to communicate complex information than it is to be an expert in complex information.

In addition to these skills, authority can be further enhanced through softer skills such as demonstrating care for the students and providing additional support when necessary (referent power).
teaching  advice 
march 2017 by kme
publications - What is the preferable way to share data? - Academia Stack Exchange
OSF and GitHub are mentioned.
Registry of Research Data Repositories ( was a new one.
collaboration  research  sharing  data  bestpractices  advice 
february 2017 by kme
ethics - Co-authors request that others do not use "he" as a pronoun - is this reasonable? - Academia Stack Exchange

Using "they" as a singular instead of "he" or "she" is no more incorrect than using "you" as a singular instead of "thou", which thou happily dost every day.
english  pronouns  language  advice  writing 
january 2017 by kme
Every successful relationship is successful for the same exact reasons — Quartz
You’re even going to wake up some morning and think, “Ugh, you’re still here….” That’s normal! And more importantly, sticking it out is totally worth it, because that, too, will change. In a day, or a week, or maybe even longer, you’ll look at that person and a giant wave of love will inundate you, and you’ll love them so much you think your heart can’t possibly hold it all and is going to burst. Because a love that’s alive is also constantly evolving. It expands and contracts and mellows and deepens. It’s not going to be the way it used to be, or the way it will be, and it shouldn’t be. I think if more couples understood that, they’d be less inclined to panic and rush to break up or divorce.
I receive hundreds of emails from readers each week asking for life advice. A large percentage of these emails involve their struggling romantic relationships.

(These emails, too, are surprisingly repetitive.)

A couple years ago, I discovered that I was answering the vast majority of these relationship emails with the exact same response.

“Take this email you just sent to me, print it out, and show it to your partner. Then come back and ask again.”

This response became so common that I actually put it on my contact form on the site because I was so tired of copying and pasting it.
7. You and your partner will grow and change in unexpected ways; embrace it

Over the course of 20 years we both have changed tremendously. We have changed faiths, political parties, numerous hair colors and styles, but we love each other and possibly even more. Our grown kids constantly tell their friends what hopeless romantics we are. And the biggest thing that keeps us strong is not giving a fuck about what anyone else says about our relationship.

– Dotti
You can work through anything as long as you are not destroying yourself or each other. That means emotionally, physically, financially, or spiritually. Make nothing off limits to discuss. Never shame or mock each other for the things you do that make you happy. Write down why you fell in love and read it every year on your anniversary (or more often). Write love letters to each other often. Make each other first. When kids arrive, it will be easy to fall into a frenzy of making them the only focus of your life…do not forget the love that produced them. You must keep that love alive and strong to feed them love. Spouse comes first. Each of you will continue to grow. Bring the other one with you. Be the one that welcomes that growth. Don’t think that the other one will hold the relationship together. Both of you should assume it’s up to you so that you are both working on it. Be passionate about cleaning house, preparing meals, and taking care of your home. This is required of everyone daily, make it fun and happy and do it together. Do not complain about your partner to anyone. Love them for who they are. Make love even when you are not in the mood. Trust each other. Give each other the benefit of the doubt always. Be transparent. Have nothing to hide. Be proud of each other. Have a life outside of each other, but share it through conversation. Pamper and adore each other. Go to counseling now before you need it so that you are both open to working on the relationship together. Disagree with respect to each other’s feelings. Be open to change and accepting of differences. Print this and refer to it daily.
relationships  advice  life  perspective 
january 2017 by kme
Ten Essential Development Practices -
One of the main reasons documentation can often seem so unpleasant
is the "blank page effect." Many programmers simply don't know how to get
started or what to say.


For a module, that documentation template might look something like this:

=head1 NAME

<Module::Name> - <One-line description of module's purpose>

=head1 VERSION

The initial template usually just has:

This documentation refers to <Module::Name> version 0.0.1.


use <Module::Name>;

# Brief but working code example(s) here showing the most common usage(s)
# This section will be as far as many users bother reading, so make it as
# educational and exemplary as possible.


A full description of the module and its features.

May include numerous subsections (i.e., =head2, =head3, etc.).


A separate section listing the public components of the module's interface.

These normally consist of either subroutines that may be exported, or methods
that may be called on objects belonging to the classes that the module

Name the section accordingly.

In an object-oriented module, this section should begin with a sentence (of the
form "An object of this class represents ...") to give the reader a high-level
context to help them understand the methods that are subsequently described.


A list of every error and warning message that the module can generate (even
the ones that will "never happen"), with a full explanation of each problem,
one or more likely causes, and any suggested remedies.


A full explanation of any configuration system(s) used by the module, including
the names and locations of any configuration files, and the meaning of any
environment variables or properties that can be set. These descriptions must
also include details of any configuration language used.


A list of all of the other modules that this module relies upon, including any
restrictions on versions, and an indication of whether these required modules
are part of the standard Perl distribution, part of the module's distribution,
or must be installed separately.


A list of any modules that this module cannot be used in conjunction with.
This may be due to name conflicts in the interface, or competition for system
or program resources, or due to internal limitations of Perl (for example, many
modules that use source code filters are mutually incompatible).


A list of known problems with the module, together with some indication of
whether they are likely to be fixed in an upcoming release.

Also, a list of restrictions on the features the module does provide: data types
that cannot be handled, performance issues and the circumstances in which they
may arise, practical limitations on the size of data sets, special cases that
are not (yet) handled, etc.

The initial template usually just has:

There are no known bugs in this module.

Please report problems to <Maintainer name(s)> (<contact address>)

Patches are welcome.

=head1 AUTHOR

<Author name(s)> (<contact address>)


Copyright (c) <year> <copyright holder> (<contact address>).
All rights reserved.

followed by whatever license you wish to release it under.

For Perl code that is often just:

This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself. See L<perlartistic>. This program is
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A

Of course, the specific details that your templates provide may vary from those shown here, according to your other coding practices. The most likely variation will be in the license and copyright, but you may also have specific in-house conventions regarding version numbering, the grammar of diagnostic messages, or the attribution of authorship.
perl  webdevel  devel  bestpractices  advice  pod  perlpod  documentation  template  solution 
december 2016 by kme
The Guide to Strong Boundaries
Victims and savers both get kind of an emotional high off one another. It’s like an addiction they fulfill in one another, and when presented with emotionally healthy people to date, they usually feel bored or a lack of “chemistry.” They’ll pass on healthy, secure individuals because the secure partner’s solid boundaries will not excite the loose emotional boundaries of the needy person.

From an Attachment Theory perspective, victims tend to be anxious-attachment types, and savers tend to be avoidant-attachment types. Or as I like to call them: crazy people and assholes. Both often push away secure-attachment types.

For the saver, the hardest thing to do in the world is to stop fixing other people’s problems and trying to force them to be happy and satisfied. For them, they’ve spent their whole lives only feeling valued and loved when they were fixing a problem or providing a use to someone, so letting go of this need is terrifying to them as well.

(Side note: I state in my book that needy behavior makes you unattractive to most people by limiting you to people of a similar level of neediness; i.e., the adage that you are everyone you end up dating. If you end up only attracting low self-esteem slobs, then you are likely a low self-esteem slob yourself. If you only attract high maintenance drama queens, then you are likely a high maintenance drama queen yourself. Oh, you queen, you.)
relationships  advice  codependency 
october 2016 by kme
Guest Blogger Starling: Schrödinger’s Rapist: or a guy’s guide to approaching strange women without being maced | Shapely Prose
So if you speak to a woman who is otherwise occupied, you’re sending a subtle message. It is that your desire to interact trumps her right to be left alone. If you pursue a conversation when she’s tried to cut it off, you send a message. It is that your desire to speak trumps her right to be left alone. And each of those messages indicates that you believe your desires are a legitimate reason to override her rights.

From the comments:
When we talk about rape as something that happens to 1 in 6 women, it is something that happens to women. Oh no, women! You have a problem! A women’s problem! That has to do with women! What are women going to do to solve this problem?

Perhaps if we rephrased that as “one in sixty (or however many) men will commit rape in his lifetime,” the problem might start to look a little different to certain people.

Statistic-wise, I did some research, which I’m good at and some math, which I’m not great at.

RAAIN published the 1/6 women is a victim of rape or sexual assault statistic.
The census estimates the female population of the US in 2008 was 154 million.
Which mean 25.5 million women will be raped or assaulted.
The male population is almost 150 million.
If we assume, for simplicity, that every sexual assault is reported and, for worst-case-scenario numbers, that every rapist will only rape 1 woman and then stop, then one out of every 5.83 men is a rapist.

Anyway, Dr. Lisak conducted research aimed at characterizing the undetected rapist. Briefly, he used a survey that just described behaviors without labeling them. About 120 men self-reported behaviors that would classify as rape. Of these, nearly 2/3rds were serial rapists (76/120), and accounted for an average of 14 victims apiece. So Starling, your guess was right in the damn ball-park.
feminism  creeps  advice  rapeculture  forthecomments 
september 2016 by kme
Web Photo Geotags Can Reveal More Than You Wish - The New York Times []
Protecting your privacy is not just a matter of being aware and personally responsible, said Mr. Sommer, the researcher. A friend may take a geotagged photo at your house and post it.

“You need to educate yourself and your friends but in the end, you really have no control,” he said, adding that he was considering writing a program to troll the Internet for photos with geotags corresponding to users’ home addresses.

“I’m beginning to think there may be a market for it.”
twitterstalking  privacy  security  metadata  socialmedia  advice 
august 2016 by kme
[UPDATE]My [26 F] with my husband [29 M] 1 year, he has been diagnosed with terminal cancer, how to make it count? : relationships
He wrote a letter addressed to my "next spouse" with all the not so easy to discover things about me that were wonderful and necessary, in his words.

In the comments of my original post, a lot of you wrote that you cried and told your SO you loved them or gave them a random hug much to their surprise. I'll admit that those comments made me happier than anything else. That our story could inspire some bond somewhere to get stronger was the greatest compliment.
life  dying  relationships  advice 
august 2016 by kme
Why You Will Marry the Wrong Person - The New York Times
Perhaps we have a latent tendency to get furious when someone disagrees with us or can relax only when we are working; perhaps we’re tricky about intimacy after sex or clam up in response to humiliation. Nobody’s perfect. The problem is that before marriage, we rarely delve into our complexities. Whenever casual relationships threaten to reveal our flaws, we blame our partners and call it a day. As for our friends, they don’t care enough to do the hard work of enlightening us. One of the privileges of being on our own is therefore the sincere impression that we are really quite easy to live with.
We make mistakes, too, because we are so lonely. No one can be in an optimal frame of mind to choose a partner when remaining single feels unbearable. We have to be wholly at peace with the prospect of many years of solitude in order to be appropriately picky; otherwise, we risk loving no longer being single rather more than we love the partner who spared us that fate.
The person who is best suited to us is not the person who shares our every taste (he or she doesn’t exist), but the person who can negotiate differences in taste intelligently — the person who is good at disagreement. Rather than some notional idea of perfect complementarity, it is the capacity to tolerate differences with generosity that is the true marker of the “not overly wrong” person. Compatibility is an achievement of love; it must not be its precondition.

See also:
society  marriage  relationships  connection  advice 
july 2016 by kme
« earlier      
per page:    204080120160

Copy this bookmark:

to read