-
Kafka Binary files : http://kafka.apache.org/downloads.html
-
Atleast 2 AWS machines : AWS EMR or EC2 will be preferable
-
A Kafka Manager Utility to watch up the Cluster : https://cwiki.apache.org/confluence/display/KAFKA/Ecosystem
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
| // Base64 encoded string used for "Application Default Credentials". | |
| // Alternative to GOOGLE_APPLICATION_CREDENTIALS env which accepts JSON file path. | |
| // | |
| // Use following command to generate base64 encoded string for given json file. | |
| // $ openssl base64 < ~/Downloads/gcloud-service-key.json | tr -d '\n' | |
| // | |
| GOOGLE_SERVICE_KEY="<base64_encoded_json_file>" |
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
| const SECRET_KEY = ENTER YOUR SECRET KEY HERE; | |
| const MAX_TOKENS = 200; | |
| // For more cool AI snippets and demos, follow me on Twitter: https://twitter.com/_abi_ | |
| /** | |
| * Completes your prompt with GPT-3 | |
| * | |
| * @param {string} prompt Prompt | |
| * @param {number} temperature (Optional) Temperature. 1 is super creative while 0 is very exact and precise. Defaults to 0.4. |
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 bash | |
| # How to start: | |
| # 1. Sign up for DigitalOcean with this link https://www.digitalocean.com/ | |
| # 2. Go to https://cloud.digitalocean.com/settings/applications and find you API key | |
| # 3. In your shell, run 'export DIGITALOCEAN_TOKEN="INSERT TOKEN HERE"', without the outer quotes. | |
| # 4. `brew install jq` | |
| # 5. `./digitalocean-proxy` | |
| # 6. When you are done, press CTRL+C ONCE, and everything will be cleaned up. |
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
| # from https://cloud.google.com/solutions/machine-learning-with-financial-time-series-data | |
| def tf_confusion_metrics(model, actual_classes, session, feed_dict): | |
| predictions = tf.argmax(model, 1) | |
| actuals = tf.argmax(actual_classes, 1) | |
| ones_like_actuals = tf.ones_like(actuals) | |
| zeros_like_actuals = tf.zeros_like(actuals) | |
| ones_like_predictions = tf.ones_like(predictions) | |
| zeros_like_predictions = tf.zeros_like(predictions) |
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 splitDataFrameList(df,target_column,separator): | |
| ''' df = dataframe to split, | |
| target_column = the column containing the values to split | |
| separator = the symbol used to perform the split | |
| returns: a dataframe with each entry for the target column separated, with each element moved into a new row. | |
| The values in the other columns are duplicated across the newly divided rows. | |
| ''' | |
| def splitListToRows(row,row_accumulator,target_column,separator): | |
| split_row = row[target_column].split(separator) |
Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.
Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.
As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.
Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.
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
| /* This is a POST request example | |
| * use it for sending request with parameters and getting response frome server | |
| */ | |
| // Sending POST request to server and getting response as a String | |
| String responseFromServer = startUrlConnection("http://www.some_website.domain", | |
| "parameter1="+parameter_variable1+"¶meter2="+parameter_variable2); | |
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
| <form action="." method="post"> | |
| <noscript>You must <a href="http://www.enable-javascript.com" target="_blank">enable JavaScript</a> in your web browser in order to pay via Stripe.</noscript> | |
| <input | |
| type="submit" | |
| value="Pay with Card" | |
| data-key="PUBLISHABLE STRIPE KEY" | |
| data-amount="500" | |
| data-currency="cad" | |
| data-name="Example Company Inc" |