Skip to content

Instantly share code, notes, and snippets.

@suryapandian
suryapandian / software-engineer.md
Last active June 10, 2023 10:15
Becoming a software engineer GoLang
@suryapandian
suryapandian / SE at Qube.md
Last active August 15, 2022 02:00
Software Engineer at Qube

Amara Chitha Kadha

  1. propitiate: win or regain the favour of (a god, spirit, or person) by doing something that pleases them.

  2. concocted: Make a dish by combining various ingredients

  3. predilection: a preference or special liking for something; a bias in favour of something: my predilection for Asian food.

  4. heifers: a cow that has not borne a calf, or has borne only one calf

  5. certitude: absolute certainty or conviction that something is the case

  6. desecrate: treat (a sacred place or thing) with violent disrespect: more than 300 graves were desecrated.

  7. dower: give a dowry to: he was so short of money that he could not even dower his sister.

  8. sedge: a grasslike plant with triangular stems and inconspicuous flowers, growing typically in wet ground. Sedges are widely distributed throughout temperate and cold regions.

Two for:

Well done! We can avoid code repetition by assigning the value "you" to name in the if block and then returning after the if block. Short and simple code is more readable. Find the minimal condition to make the code DRY (Don't Repeat Yourself).

Difference:

The solution looks clean. However, instead of looping through the numbers, we could use existing mathematical formulas to compute square of sum and sum of squares for a given number n. Please try implementing this using the formulas.

Keybase proof

I hereby claim:

  • I am suryapandian on github.
  • I am suryapandian (https://keybase.io/suryapandian) on keybase.
  • I have a public key ASBZR1zhsSl2dNitTX6lhX8y6pYdfqIPyknFITOMCNrOuAo

To claim this, I am signing this object:

-- get list queries and their running time
SELECT pid,query, age(clock_timestamp(), query_start), usename
FROM pg_stat_activity
WHERE datname = 'database_name'
ORDER BY query_start desc;
-- get rough count of records in table without actually running the count(*) query
-- thanks to: https://www.cybertec-postgresql.com/en/postgresql-count-made-fast/
SELECT reltuples::bigint
@suryapandian
suryapandian / rust.md
Created March 18, 2021 05:22 — forked from Brunya/rust.md
Rust coding test

Rust coding test

The motivation behind the coding test is the measurement of the qualification and testing the learning attitude of the candidate.

Task

Create a pseudorandom number generator based on Linear Congruential Generator algorithm. Pick one and use any of the following languages, and please do NOT use any library you can find on the internet.

  • C
  • C++
@suryapandian
suryapandian / riscv.md
Created October 18, 2020 15:52 — forked from cb372/riscv.md
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@suryapandian
suryapandian / how-to-copy-aws-rds-to-local.md
Created November 29, 2019 11:24 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored