gem install mimemagic -v '0.3.10' --source 'https://rubygems.org/' Building native extensions. This could take a while... ERROR: Error installing mimemagic: ERROR: Failed to build gem native extension. Solution brew install shared-mime-info...
Snippet
Error installing mimemagic. Error: Failed to build g...
Admin
Jan 12, 2023
21 comments
745
ObjectMapper objectMapper = new ObjectMapper(); String containerMatrixJSON = "{\"container_metrics\":{\"cpuRequest\":{\"results\":{\"general_info\":{\"sum\":4.4,\"mean\":1.1,\"units\":\"cores\"}}},\"cpuLimit\":{\"results\":{\"general_info\":{\"su...
Snippet
Java - Convert a JSON or Nested JSON into a Map
Admin
May 06, 2022
23 comments
1.01K
You need to use `newline=""` when using a csv.writer() with Python 3.x, wb is used for Python 2.x versions. Using the sample JSON you've given, you would just need to iterate over the header fields and create a row from each entry in details. For...
Snippet
Convert JSON to CSV
Admin
Feb 25, 2022
21 comments
477
2.1. ClassLoader.getResourceAsStream() Use the getResourceAsStream() method to get the InputStream when reading a file from inside a jar file. Always use this method on the ClassLoader instance. private InputStream getFileAsIOStream(final St...
Snippet
Read a file from the ‘resources’ folder
Feb 16, 2022
10 comments
768
What is A/B testing? A/B testing (also known as bucket testing or split-run testing) is a user experience research methodology. A/B tests consist of a randomized experiment with two variants, A and B. It includes application of statistical hypoth...
Article
A/B testing
> User.reflect_on_all_associations.map(&:name) > [:addresses, :cookies, :posts]
Snippet
Fetch names of associated ActiveRecord models in Rub...
Admin
Sep 27, 2021
10 comments
915
Error on installing mailcatcher The command: gem install mailcatcher fails with error: - ERROR: Error installing mailcatcher: ERROR: Failed to build gem native extension make "DESTDIR=" compiling parser.c parser.rl:112:17: warnin...
Snippet
Error installing mailcatcher
Admin
Sep 27, 2021
23 comments
851
Error on installing mailcatcher The command: gem install mailcatcher fails with error: - ERROR: Error installing mailcatcher: ERROR: Failed to build gem native extension Solution gem install mailcatcher -- --with-cflags="-Wn...
Snippet
Error installing mailcatcher
Jul 04, 2021
0 comments
172
Problem Sometimes while running `bundle install` during setting up a new project, you might get the following error:   Installing pg 1.2.0 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current dir...
Snippet
Error installing `pg` gem
Apr 04, 2021
23 comments
879
Reverse interview This is a list of questions which may be interesting to a tech job applicant. The points are not ordered and many may not apply to a given position, or work type. It was started as my personal list of questions, which grew over ...
Tutorial
Reverse interview
Admin
Feb 09, 2021
14 comments
150
String jsonData = "[\r\n" + " {\r\n" + " \"CompType\": \"Substrate\",\r\n" + " \"CompName\": \"80101-106DSA\",\r\n" + " \"CompRev\": \"BA\",\r\n" + " },\r\n" + " {\r\n" + " \"CompType\": \"Substrate\",\r\n" + " \"CompName\": \...
Snippet
Read JSON data into a list
Admin
Jul 11, 2020
18 comments
698
Suppose you want to remove a 'comments' table from a blog application. You can do so by performing the following tasks from the command line (e.g., Terminal). Step one: $ rails console Step two: $ ActiveRecord::Migration.drop_table(:c...
Snippet
Delete table