This file contains 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
[ | |
{ | |
"questionId": "C614B380-8DF9-11EA-AB12-0800200C9A66", | |
"question": "You want to be able to store application logs from your Kubernetes Cluster for more than a year to be able to analyze them and monitor frequency errors. What is your best option to stream and store logs?", | |
"subQuestion": "", | |
"domain": "cdmp-gcp-simulated-exam", | |
"difficulty": "medium", | |
"answers": { | |
"a": "Configure Cloud Logging for your cluster and do nothing because logs are stored forever.", | |
"b": "Use pubsub to send the logs to a subscriber and process them using DataProc", |
This file contains 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
torch::jit::script::Module forwardModel = torch::jit::load(forwardFilePath.UTF8String); | |
torch::jit::script::Module backwardModel = torch::jit::load(backwardFilePath.UTF8String); | |
auto w = torch::IValue(torch::full({10}, 1.0f)); | |
torch::IValue loss; | |
//Create train x | |
std::vector<torch::jit::IValue> train_x; | |
for (int i = 0; i < 500; i++) { | |
train_x.push_back(torch::rand({10})); |
This file contains 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 'Manuel Amunategui' https://www.youtube.com/watch?v=VncfC5GeqGs | |
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh | |
bash ~/miniconda.sh -b -p $HOME/miniconda | |
export PATH="$HOME/miniconda/bin:$PATH" | |
pip install --upgrade pip | |
pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose | |
sudo yum groupinstall -y 'Development Tools' |
This file contains 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
[UIView beginAnimations:nil context:NULL]; | |
[UIView setAnimationDuration:[info[UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; | |
[UIView setAnimationCurve:[info[UIKeyboardAnimationCurveUserInfoKey] integerValue]]; | |
[UIView setAnimationBeginsFromCurrentState:YES]; | |
self.textViewKeyboardConstraint.constant = height; | |
UIEdgeInsets insets = UIEdgeInsetsMake( | |
scrollView.contentInset.top, 0, textView.bounds.size.height + height, 0); | |
scrollView.contentInset = insets; | |
scrollView.scrollIndicatorInsets = insets; |
This file contains 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
// Call this method somewhere in your view controller setup code. | |
- (void)registerForKeyboardNotifications | |
{ | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWasShown:) | |
name:UIKeyboardDidShowNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillBeHidden:) | |
name:UIKeyboardWillHideNotification object:nil]; |
This file contains 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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) | |
name:UIKeyboardWillShowNotification | |
object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillHide:) |
This file contains 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 <UIKit/UIKit.h> | |
@interface UIView (StringTagAdditions) | |
@property (nonatomic, copy) NSString *stringTag; | |
@end |
This file contains 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
view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5f]; |
This file contains 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 <UIKit/UIKit.h> | |
@interface UIImage (Transform) | |
- (UIImage *)imageAtRect:(CGRect)rect; | |
- (UIImage *)imageByScalingProportionallyToMinimumSize:(CGSize)targetSize; | |
- (UIImage *)imageByScalingProportionallyToSize:(CGSize)targetSize; | |
- (UIImage *)imageByScalingToSize:(CGSize)targetSize; | |
- (UIImage *)imageRotatedByRadians:(CGFloat)radians; |
This file contains 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
__weak typeof(self) weakSelf = self; |
NewerOlder