This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def quicksort(x): | |
| if len(x) == 1 or len(x) == 0: | |
| return x | |
| else: | |
| pivot = x[0] | |
| i = 0 | |
| for j in range(len(x)-1): | |
| if x[j+1] < pivot: | |
| x[j+1],x[i+1] = x[i+1], x[j+1] | |
| i += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function recurringTask(firstDate, k, daysOfTheWeek, n) { | |
| const weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', | |
| 'Thursday', 'Friday', 'Saturday']; | |
| const splits = firstDate.split('/').map(x => parseInt(x)); | |
| const fday = new Date(splits[2], splits[1] - 1, splits[0]); | |
| const days = daysOfTheWeek.map( str => weekdays.indexOf(str)); | |
| console.log('fday', fday) | |
| console.log('days', days); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function asyncFunc(e) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => resolve(e), e * 1000); | |
| }); | |
| } | |
| const arr = [1, 2, 3]; | |
| let final = []; | |
| function workMyCollection(arr) { |
So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode!
Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.
But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.
- In machine learning, accuracy tends to increase with an increase in the number of training examples and number of model parameters.
- For large data, training becomes slow on even GPU (due to increase CPU-GPU data transfer).
- Solution: Distributed training and inference - DistBelief
- Link to paper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| /* aaron 12/22/2014 backup script | |
| I put this in my ~/bin directory named "bk" | |
| chmod 700 ~/bin/bk | |
| Then, whenever I am going to edit an important file, | |
| I first back it up by running | |
| bk fileName */ | |
| //Change this to match your directory | |
| var target_dir = '/home/aaron/backups/files/'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.IO; | |
| class Solution | |
| { | |
| static byte alphabet_count = 26; | |
| static byte a = (byte)'a'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace SherlockAndAnagrams | |
| { | |
| class CharCount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import pymysql | |
| from sqlalchemy import create_engine | |
| engine = create_engine("mysql+pymysql://USER:PASSWORD@HOST:PORT/DBNAME") | |
| df = pd.read_sql_query("SELECT * FROM table", engine) | |
| df.head() |