Skip to content

Instantly share code, notes, and snippets.

View TimothyW553's full-sized avatar
:shipit:
Working from home

Timothy Wang TimothyW553

:shipit:
Working from home
View GitHub Profile
Height Weight Male
73.84701702 241.8935632 1
68.78190405 162.3104725 1
74.11010539 212.7408556 1
71.7309784 220.0424703 1
69.88179586 206.3498006 1
67.25301569 152.2121558 1
68.78508125 183.9278886 1
68.34851551 167.9711105 1
67.01894966 175.9294404 1
import numpy as np
from sklearn import linear_model
# Load data
data = np.loadtxt('./heights_weights_genders.csv', delimiter=',', skiprows=1)
# Load data
X = data[:,0:2]
y = data[:,2]
# Fit (train) the Logistic Regression classifier
import java.util.*;
public class ICS4U1 {
public static int[] unsorted_arr = {6, 8, 32, 6, 21, 7, 9, 12};
public static int linearSearch(int arr[], int target) {
for(int i = 0; i < arr.length; i++) {
if(arr[i] == target) {
return i;
@TimothyW553
TimothyW553 / LeetCode_.idea_misc.xml
Created June 24, 2019 21:57
As a Summer challenge, this is a repo for solutions done for problems on Leetcode using Java.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="true" project-jdk-name="10" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

Keybase proof

I hereby claim:

  • I am timothyw553 on github.
  • I am timothyw553 (https://keybase.io/timothyw553) on keybase.
  • I have a public key ASBIhLzwjjeTSIst-2fCnO7kbjC-p30FzzId-HiKAjlBFgo

To claim this, I am signing this object:

@TimothyW553
TimothyW553 / horizontal-scrolling-table-with-fixed-first-column.markdown
Created March 2, 2019 14:54
Horizontal scrolling table with Fixed first column

Horizontal scrolling table with Fixed first column

Answer to question on Sitepoint forums: https://www.sitepoint.com/community/t/table-scrolling-horizontally-and-vertically/262865/12

I've only just knocked this up a few minutes ago so needs testing.

It also assumes that you won't be having form fields or the like in the cells because the way this works is that the table is cloned and then positioned on top of the original table with absolute positioning. The original table is in a div that allows the table to scroll horizontally while the cloned div is placed out of that context and does not scroll.

The cells in the cloned table are hidden with css except for the first column. That allows the illusion of a fixed first column.

@TimothyW553
TimothyW553 / index.haml
Created March 1, 2019 23:06
ReactJS fixed table component with perfect-scrollbar
.container