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
| """ | |
| Script for comparing Logistic Regression and associated evaluation metrics on the imbalanced Media 6 Degrees dataset from the Doing Data Science book. You'll need to download a copy of the dataset from the GitHub repo: https://github.com/oreillymedia/doing_data_science . | |
| Copyright 2016 Ronald J. Nowling | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
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
| export $DISPLAY=:0.0 | |
| ssh -Y pi@raspberrypi.local | |
| /etc/X11/Xsession |
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
| #! /bin/bash | |
| # streaming on Ubuntu via ffmpeg. | |
| # see http://ubuntuguide.org/wiki/Screencasts for full documentation | |
| # see http://www.thegameengine.org/miscellaneous/streaming-twitch-tv-ubuntu/ | |
| # for instructions on how to use this gist | |
| if [ ! -f ~/.twitch_key ]; then | |
| echo "Error: Could not find file: ~/.twitch_key" | |
| echo "Please create this file and copy past your stream key into it. Open this script for more details." |
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 four part files to construct "minitweet" | |
| cat rawtweets/part-0000[1-3] > minitweets | |
| # change log4j properties to WARN to reduce noise during demo | |
| mv conf/log4j.properties.template conf/log4j.properties | |
| vim conf/log4j.properties # Change to WARN | |
| # launch Spark shell REPL | |
| ./bin/spark-shell |
Bootstrap 3.0 gives you access to the awesome icon set icon set by these dudes but it's not obvious for a Rails newbie like myself to get it all working together nicely
- Download the bootstrap-glyphicons.css from here. Save that file to
RAILS_ROOT/vendor/assets/stylesheet/bootstrap-glyphicons.css - Save all the font files in
/dist/fontsfrom the Bootstrap 3.0 download to a new folder in your Rails appRAILS_ROOT/vendor/assets/fonts - Add this folder to the asset pipeline by appending
config.assets.paths << Rails.root.join("vendor","assets", "fonts")toapplication.rbafter the line that hasclass Application < Rails::Application. - In
bootstrap-glyphicons.cssmodify the the `url
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
| =begin | |
| #in main | |
| # call: | |
| firstObstacle = get_firs_obstacle(start_position, start_direction) | |
| solve (firstObstacle, 0) | |
| =end | |
| # returns -1 if unsolvable (loop) | |
| # otherwise distance traveled | |
| mirrorHits = [] | |
| mirrorPositions = [] |
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
| So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message: | |
| "app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)" | |
| After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this: | |
| # Do not keep production secrets in the repository, | |
| # instead read values from the environment. | |
| production: | |
| secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> |
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
| Difficulty level: 1(easy) - 3(hard) | |
| ----Arrays------- | |
| 1. http://www.careercup.com/question?id=5133958972964864 3 | |
| 2. http://www.careercup.com/question?id=5630275595796480 3 | |
| 2. http://www.geeksforgeeks.org/kth-smallestlargest-element-unsorted-array/ 1 | |
| know how to find it when k is small (2,3). Write. Know that for larger k's, use a heap. Explain heap sort. | |
| 3. http://www.geeksforgeeks.org/find-the-largest-subarray-with-0-sum/ 2 | |
| 4. http://www.geeksforgeeks.org/find-maximum-average-subarray-of-k-length/ 3 | |
| 5. http://www.geeksforgeeks.org/find-the-element-that-appears-once-in-a-sorted-array/ 2 | |
| 6. http://www.careercup.com/question?id=5926214520799232 2 |
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
| 1. Return all words in the list with the prefix that user searched for. And without traverse the list every time | |
| 2. You have an array with words. Print them by anagrams groups | |
| 3. Given an array of strings with commit ids, and a predicate | |
| isBuggy that returns if a single commit is buggy, write a program that finds the first buggy commit. | |
| - When a commit is buggy, we assume that all its children are buggy. | |
| - When a commit is not buggy, we assume that all its ancestors are not buggy. | |
| 4. Print all the possible words combination from a long string with no space. |
NewerOlder