首页 \ 问答 \ 将数据加载到没有关联密钥对的ec2实例上(由NotebookCloud生成)(Load data onto an ec2 instance with no associated key-pair (generated by NotebookCloud))

将数据加载到没有关联密钥对的ec2实例上(由NotebookCloud生成)(Load data onto an ec2 instance with no associated key-pair (generated by NotebookCloud))

我正在尝试在亚马逊ec2实例中运行iPython笔记本(我使用免费套餐,如果这有任何区别),使用NotebookCloud( https://notebookcloud.appspot.com/ )来处理iPython笔记本界面。 但是,我想在笔记本中运行的代码需要访问各种数据文件和补充python文件。 当NotebookCloud生成一个新的ec2实例时,它没有为它分配一个密钥对,我找不到让它这样做的方法。 据我所知,如果没有关联的密钥对,就无法通过SSH进入实例。 是否仍然有一些偷偷摸摸的方式来获取数据到实例?


I'm trying to run iPython notebook in an Amazon ec2 instance (I'm using the free tier, if that makes any difference), using NotebookCloud (https://notebookcloud.appspot.com/) to handle the iPython notebook interface. However, the code I want to run in the notebook needs access to a variety of datafiles and supplemental python files. When NotebookCloud generates a new ec2 instance, it doesn't assign a key-pair to it, and I can't find a way to make it do so. As far as I can tell from other questions, there's no way to SSH into an instance if it doesn't have an associated key-pair. Is there still some sneaky way to get data onto the instance though?


原文:https://stackoverflow.com/questions/17067054
更新时间:2022-05-28 07:05

最满意答案

使用静态bool并将其设置在cpp文件中。

private:
    static bool preload;

在.cpp文件中

//file declarations
bool Sprite::preload = false;

//class functions below...

static关键字将使所有对象共享同一个变量,允许您在程序的整个生命周期中只调用一次函数。


use a static bool and set it in the cpp file.

private:
    static bool preload;

in .cpp file

//file declarations
bool Sprite::preload = false;

//class functions below...

the static keyword will make all object share this same variable, allowing you to call a function just once for the entire life of a program.

相关问答

更多
  • 使用静态bool并将其设置在cpp文件中。 private: static bool preload; 在.cpp文件中 //file declarations bool Sprite::preload = false; //class functions below... static关键字将使所有对象共享同一个变量,允许您在程序的整个生命周期中只调用一次函数。 use a static bool and set it in the cpp file. private: static ...
  • 在按钮的事件侦听器中,禁用该按钮并显示另一个活动。 Button b = (Button) view; b.setEnabled(false); Intent i = new Intent(this, AnotherActitivty.class); startActivity(i); 覆盖onResume()以重新启用该按钮。 @Override protected void onResume() { super.onResume(); ...
  • 如果需要使用Interlocked.CompareExchange原子操作,则可能需要使用int而不是bool 。 PS:我知道Interlocked.CompareExchange ,但它是在.NET 3.5中引入的,仅支持引用类型。 You might want to use int instead of bool if you need to use atomic operations such as Interlocked.CompareExchange. PS: I know about I ...
  • 实体框架中的延迟加载默认情况下处于打开状态。 你不能强迫某些东西“懒惰地加载”。 你所能做的就是关闭延迟加载(顺便说一下,实际上并不是急切加载,而是“无加载”)。 所以答案是你不能。 然而,事实上,正如评论指出的那样,如果Owners类具有导航属性,例如, public class Owners{ public string UNQ4 {get;set;} public virtual OtherClass NavigationProperty {get;set;} } 然后,当您执行诸如 ...
  • 你的意思是 bool b; ... BOOL apiboolean = b ? TRUE : FALSE; 如果是这样,那么是的,这将起作用。 Do you mean bool b; ... BOOL apiboolean = b ? TRUE : FALSE; If so, then yes, this will work.
  • 是的,那会起作用。 BOOL只是一个整数。 YES是1 , NO是0 。 !1 == 0和!0 == 1 。 Yes, that will work. BOOL is just an integer. YES is 1 and NO is 0. !1 == 0 and !0 == 1.
  • 我也看到了这个qt 4.7.4(与phantomjs)。 我使用框架的loadFinished而不是页面,它不会发送两次。 im seeing this too with qt 4.7.4 (with phantomjs). i used the frame's loadFinished instead of the page's and it isn't sent twice.
  • 由于BOOL被定义为int ,所以你不知道没有检查你移植的代码是否依赖于它是一个int 。 因此,我会去做类似的事情: #if NOT_MICROSOFT typedef int BOOL; #define TRUE 1 #define FALSE 0 #endif 如果你有机会检查你正在移植的代码是否能够正常工作,无论BOOL类型是int还是bool ,那么很可能你有机会改变它来使用bool (或者使用int8_t ,你比较喜欢)。 Since BOOL is defined a ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)