code Data Ingestion: Pandas/Vaex Presentation There is a lot of Data * 2.5 quintillion bytes of data are created every day (2020 [https://www.forbes.com/sites/bernardmarr/2018/05/21/how-much-data-do-we-create-every-day-the-mind-blowing-stats-everyone-should-read/?sh=3130407d60ba] ) * 90% of all the data ever created has happened in the last 2 years * Volume of data is doubling every 2
code Windows Subsystem of Linux 2: DNS lost Windows Subsystem for Linux 2 (WSL2 [https://docs.microsoft.com/en-us/windows/wsl/]) keeps losing domain name resolution [https://en.wikipedia.org/wiki/Domain_Name_System] for me. Why is this? Two reasons I think, first reason is as it doesn't have a init setup that works with cronjobs [https:
code Local DynamoDB in WSL2 * Install latest AWS Command Line Interface [https://aws.amazon.com/cli/] * Install Ubuntu * Download the local DynamoDB jar [https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html] * Unzip the file to a folder like C:\dynamodb or if you are already in Ubuntu WSL2 /mnt/c/dynamodb * Check your
code Node Update: Ubuntu Wanted to update to latest stable node version for my ubuntu server 20.04 [https://releases.ubuntu.com/20.04/] * Command: lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.4 LTS Release: 20.04 Codename: focal * Clear the npm [https://www.npmjs.com/
code JavaScript object deep cloning: 3 ways Deep cloning in JavaScript Spread operator ... [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax] Use the JavaScript spread operator like so const source = { b: 4, c: 5 }; const target = { ...source }; console.log(target); Results: > Object { b: 4, c: 5 } Object.assign [https://developer.mozilla.org/en-US/
code C# Unicode Count Frequency no dependencies To do the lookup initialization correctly [https://siliconheaven.info/language-phenotypes-c-python-5] to match on int codes only add the function public static IEnumerable> ExpectedLookupCodes(string element, int total) { return element.ToCharArray().Select(componentChar => new KeyValuePair((int)componentChar, total)) .ToList(); } What happens is the looping element of Select pulls down 2
code Language Phenotypes: C#, SQL, Python - Part 5 Doing a count uniques function and the choice of language really shows some deep decisions on the part of the designers of said language. In this case I will show the answers in C# [https://docs.microsoft.com/en-us/dotnet/csharp/] and Python [https://www.python.org/] Given the problem
code Language phenotypes: SQL - Part 4 Doing a second part on this now where I do the same as Part 3 SQL with python and sql, again the core of the solving of the problem is using set functionality in SQL. Again this will beCoderPad [https://coderpad.io/] compatible Problem 1: Contains All [https://siliconheaven.info/
code HTML5 Notifications Call requestNotifyPermission at the DOM load of your particular page and then because you have to ask the users permission to send them notifications. It will looks something similar to this (this is from Google Calendar) stick notify('Message') wherever you want to display a HTML5 notification function requestNotifyPermission() { if
code Find commits Need to find commits from numerous git repositories I have on a windows machine. cd "best_code_ever" echo "best_code_ever" >> ..\commits.txt git checkout master git pull git log --pretty=format:"%ad - %an: %s" --after="2020-12-31" --author="Siliconrob@siliconheaven.net" >> ..\commits.txt cd .. cd "not_best_code"
code Language phenotypes: SQL - Part 3 Thinking about the coding questions I have been given to solve using limited tools and well I think I can bypass the tooling issue by being creative.CoderPad [https://coderpad.io/] will allow you to use databases (it's kind of a feature most people wouldn't use to solve iterative problems,
code Language phenotypes: Python, C# - Part 2 Doing a input/supply check function on coderpad.io [https://coderpad.io/] which supports 30+ languages, but in actuality a language is only as good as its tools and libraries and in that respect coderpad.io is sorely lacking on many of the languages it supports. In truth coderpad.io
code Distributed Work – Next levels Do Software as a Service developers and companies go into the physical data centers to work together? No, they work remotely from the datacenter and securely connect in and create wonders. Now is the time where we could stretch the collaborative nature of our work into higher levels i.e.
code Polyglot Language Use Why? It is not a wow this is nice feature, but the ability to use new popular languages expands knowledge and helps define services clearer. The languages themselves are built of common constructs, but each has its own strengths and weaknesses Point 1 - JavaScript is used everywhere and in
code Software Rot Mindset of software as limits to end users and management. Use software expiration dates (use feature flags to force it if you want). I have asked for this many times before in other places and in summary the idea is the same as any physical product. Wood rots, iron rusts,
code Powershell UUID Want to generate UUID on Windows and it is painful compared to Linux where if you use Debian it's uuidgen [https://man7.org/linux/man-pages/man1/uuidgen.1.html] on mac OS you probably have it under dbus-uuidgen | pbcopy i.e. cat uuidgen or echo uuidgen | setclip if you have
code Language phenotypes: Python, C# Doing a bucketing exercise on coderpad.io [https://coderpad.io/] which supports 30+ languages, but in actuality a language is only as good as its tools and libraries and in that respect coderpad.io is sorely lacking on many of the languages it supports. In truth coderpad.io is built
code Advent of Code Currently expanding my python [https://www.python.org/] knowledge by doing Advent of Code [https://adventofcode.com/] 2021 [https://adventofcode.com/2021]. This forces me to look up a lot of python libraries and syntax, but I feel like I am really getting a pythonic mindset now. Learning a lot
code Run As User In Linux/macOS you use the su [https://linuxize.com/post/su-command-in-linux/] command Windows does not have this and the closest thing it has is runas [https://ss64.com/nt/runas.html] with /user option. It will then prompt you for the password of this particular user. Key point here
code AWS Textract PDF to CSV PDFs are great for presenting information, but due to their structure and formatting getting structured data out of them is difficult and tedious and they could be considered unstructured data in my opinion. Say you have a PDF document like this, which is really a long table with a lot
code Code difference Code review doesn't do what I hear people tell me it does in every organization I have worked for For example * Makes code readable * Shares knowledge * Standardizes approach What it does do in my opinion (read earlier thoughts I had on this here code review [https://siliconheaven.info/treatise-code-reviews]) * Encourages
code Jinja2 Templating Experimenting with python templating of jinja2 [https://jinja.palletsprojects.com/en/3.0.x/] and finding it quite a bit nicer than the razor [https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-5.0] syntax in ASP.NET for one big reason to me that extracting the
code Octopus Deploy and Powershell Needed to deploy a pretty cool dynamic proxy called traefik [https://github.com/traefik/traefik], which is built on golang [https://golang.org/] and can be deployed as a single binary and along with some simply configs can take a lot of difficulties of say an nginx reverse proxy [https:
code Capture URL Screenshot Chrome+Windows Capturing a screenshot in Linux/macOS is documented and can be done in a single command as detailed here [https://siliconheaven.info/capture-url-screenshot-chrome-ubuntu] Doing this in Windows is a lot less clear and more painful, but you can do it like so I am not running with administrator rights so
code Capture URL Screenshot Chrome+Ubuntu Capturing a screenshot documentation Setup 1. Add google chrome package location: wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 2. Install: sudo apt install ./google-chrome-stable_current_amd64.deb Capture 1. Capture the url contents of siliconheaven.info [https://siliconheaven.info/] google-chrome --headless --hide-scrollbars --window-size=1920,2000 --screenshot=