Skip to content

Instantly share code, notes, and snippets.

@Mahesha999
Mahesha999 / requirements.txt
Created July 14, 2023 15:56
Freezed requirements file for fastai.
aiohttp==3.8.4
aiosignal==1.3.1
anyio==3.7.1
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asttokens==2.2.1
astunparse==1.6.3
async-lru==2.0.3
async-timeout==4.0.2
@Mahesha999
Mahesha999 / React_D3.md
Created September 13, 2022 12:22 — forked from alexcjohnson/LICENSE
Working with React and D3 together

React + D3

The key challenge in integrating D3 code into a React app is how to break up responsibility for DOM manipulation, so the two frameworks don’t step on each others’ toes yet updates are efficient and reliable. There are a lot of ways to go about this and which is best may depend on the specifics of your application. The key is to draw a very clear line between the responsibilities of React and D3 and never let either one cross into the other’s territory. React will always provide the overarching structure, D3 the details of the chart, but the exact boundary can be drawn in several places.

One other note - most of the discussion below (except for example react-faux-dom which is tailored to D3) applies just as well to integrating other packages or JS components inside a React app.

Approaches

Lifecycle methods wrapping regular D3 code:

[{"student_name": "student 0", "e": "100.15", "d": "127.81"}, {"student_name": "student 1", "e": "100.30", "d": "189.94"}, {"student_name": "student 2", "e": "100.15", "d": "105.33"}, {"student_name": "student 3", "e": "99.41", "d": "85.36"}, {"student_name": "student 4", "e": "100.00", "d": "203.70"}, {"student_name": "student 5", "e": "100.15", "d": "139.05"}, {"student_name": "student 19", "e": "100.15", "d": "102.66"}, {"student_name": "student 20", "e": "95.71", "d": "52.96"}, {"student_name": "student 21", "e": "99.85", "d": "99.41"}, {"student_name": "student 22", "e": "98.96", "d": "100.44"}, {"student_name": "student 23", "e": "100.15", "d": "131.07"}, {"student_name": "student 24", "e": "99.56", "d": "76.92"}, {"student_name": "student 25", "e": "100.15", "d": "213.46"}, {"student_name": "student 26", "e": "100.15", "d": "311.24"}, {"student_name": "student 27", "e": "100.15", "d": "21.89"}, {"student_name": "student 28", "e": "96.60", "d": "6.36"}, {"student_name": "student 29", "e": "53.70", "d":
@Mahesha999
Mahesha999 / movies_data_with_no_imdb_rating_equals3,json
Created June 11, 2022 16:11
Contains vega movies json with all 3.x IMDB ratings (i.e. >= 3 and < 4) set to 0
This file has been truncated, but you can view the full file.
[
{
"Title": "The Land Girls",
"US_Gross": 146083,
"Worldwide_Gross": 146083,
"US_DVD_Sales": null,
"Production_Budget": 8000000,
"Release_Date": "Jun 12 1998",
"MPAA_Rating": "R",
"Running_Time_min": null,
@Mahesha999
Mahesha999 / fm_data.csv
Last active February 7, 2022 21:07
fm_data
student_name video_duraiton total_watched watched_till d e
student1 100 10 70 0.1 0.7
student2 100 20 30 0.2 0.3
student3 100 30 40 0.3 0.4
student4 100 25 20 0.25 0.2
student5 100 40 15 0.4 0.15
student6 100 60 20 0.6 0.2
student7 100 15 50 0.15 0.5
student8 100 70 13 0.7 0.13
student9 100 56 22 0.56 0.22
@Mahesha999
Mahesha999 / pipenv_cheat_sheet.md
Last active March 1, 2021 14:19 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands
$ pip3 install jep
Collecting jep
Using cached https://files.pythonhosted.org/packages/3e/0c/d78776bc56fcef175470c3a7081361cffedd10ca3e8fff9ebdb2c51f9e7e/jep-3.8.2.tar.gz
Building wheels for collected packages: jep
Running setup.py bdist_wheel for jep ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2lilr_ba/jep/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpimho8uljpip-wheel
- --python-tag cp36:
numpy include found at /usr/lib/python3.6/site-packages/numpy/core/include
running bdist_wheel
running build
18/06/04 17:47:48 ERROR Executor: Exception in task 0.0 in stage 4.0 (TID 4)
java.lang.RuntimeException: Error while encoding: java.lang.RuntimeException: java.lang.Long is not a valid external type for schema of string
if (assertnotnull(input[0, org.apache.spark.sql.Row, true], top level row object).isNullAt) null else validateexternaltype(getexternalrowfield(assertnotnull(input[0, org.apache.spark.sql.Row, true], top level row object), 0, m.attr1), NullType) AS m.attr1#0
+- if (assertnotnull(input[0, org.apache.spark.sql.Row, true], top level row object).isNullAt) null else validateexternaltype(getexternalrowfield(assertnotnull(input[0, org.apache.spark.sql.Row, true], top level row object), 0, m.attr1), NullType)
:- assertnotnull(input[0, org.apache.spark.sql.Row, true], top level row object).isNullAt
: :- assertnotnull(input[0, org.apache.spark.sql.Row, true], top level row object)
: : +- input[0, org.apache.spark.sql.Row, true]
: +- 0
:- null
+- validateexternaltype(getexternalrowfi
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jcraft.jsch.Channel;