“Schools are places where you send your children to be brought up by other children.”
Random rows in MySQL with Reasonable Performance
Almost every answer on Stack Overflow for this is terrible on moderately complex or large real data – https://stackoverflow.com/questions/4329396/mysql-select-10-random-rows-from-600k-rows-fast.
Bad: ORDER BY RAND() LIMIT N
This means executing your query for the entire resultset and then ordering it and then chopping off the number you need. This can have truly dire performance.
Bad: SELECT MAX(id) FROM table
Don’t pick random numbers from 1 to MAX(id) – deleted rows will be null or result in you getting less rows than you want. Who says your id is even sequential/numeric?
OK: SELECT id FROM table
Then pick N at random (removing those already chosen if you don’t want duplicates) from the resultset in your chosen programming language.
If you just want one row from the db you can do this in SQL only as shown here: https://stackoverflow.com/a/31066058/375262. Doing N unique rows this way is left as an exercise for the reader.
If you have a gargantuan resultset even SELECT COUNT(*) might be slow. What would you do then?
How to call a method on an object originating in Java called “in”, which is a kotlin reserved word
Backticks around the reserved word.
I found this working with JOOQ’s implementation of the SQL IN predicate. You can’t write myJavaLibObject.in(…) in Kotlin. You’ll get “Element expected” because in is a reserved word in Kotlin. Instead you need backticks: myJavaLibObject.`in`(…) will do the trick.
Convert java.sql.Timestamp to java.time.OffsetDateTime
Hard to believe but I think this is the simplest you can manage:
long millisSinceEpoch = timestamp.getTime();
Instant instant = Instant.ofEpochMilli(millisSinceEpoch)
OffsetDateTime dt = OffsetDateTime.ofInstant(instant, ZoneId.of("UTC"))
Yikes.
Top 50 Rising Programming Technologies
(Based on Stack Overflow tag count and upward trend as proportion of Stack Overflow questions. So it might just be the 50 most difficult-to-learn rising programming technologies!)
The List
- Python
Interpreted high-level programming language for general-purpose programming
- React
JavaScript library for building user interfaces
- Laravel
PHP web framework (“for web artisans”)
- Pandas
Data structures and data analysis tools for Python
- TypeScript
Superset of JavaScript that adds static typing (“JavaScript that scales”)
- Amazon Web Services
On-demand cloud computing platform
- API
The interface between two programs.
- Azure
Cloud computing service
- Powershell
Commandline shell and associated scripting language
- Firebase
Mobile and web application development platform
- Selenium
- Spring Boot
- Docker
- React Native
- DataFrame
- Unity 3D
- Elasticsearch
- Matplotlib
- Go
- Jenkins
- Selenium Web Driver
- Gradle
- Machine Learning
- Amazon S3
- vue.js
- ggplot2
- Flask
- ASP.NET Core
- npm
- Webpack
- Mongoose
- tkinter
- Google Apps Script
- Web Scraping
- Spring Security
- filter
- https
- Woo Commerce
- Xamarin Forms
- Web Socket
- Android Recycler View
- Kotlin
- Redux
- Google Sheets
- Excel Formula
- SASS
- Hive
- Java 8
- Redis
- CMake
The Top Ten
Chart of the top 10:
The Top Ten Without Python
Python dwarfs everything else so here’s a look without Python:
The Nearly Men
These tags were eliminated from the list solely on the basis of a 2018-only downward trend: R (would have been 2nd), Node.js (2nd), PostgreSQL (4th), numpy (12th), Express (14th), Apache Spark (14th), Tensorflow (18th), nginx (20th), Github (21st), Amazon EC2 (31st), ECMAScript 6 (39th), ffmpeg (46th)
Programming Languages That Make the List
- Python
- TypeScript
- Go
- Kotlin
A Rising Python Lifts All Python Libraries
python-3.x actually makes second place on the list but I rolled it into Python rather than make a redundant entry.
Django and Django Models were eliminated from the list despite being on an upward trend because they have not yet exceeded their previous peak in 2010. This resurgence, Pandas in fourth place and the presence of tkinter on the list speaks to the general rising of Python.
Methodology
Load all tags on StackOverflow by count descending.
Put each of them into StackOverflow Trends and judge by eye if they are currently trending up.
Where Do These Technologies Sit in the Overall List?
In the whole list of tags by count Python is sixth overall, Firebase (10th place in this list) is 90th, and CMake (50th) is 442nd.


