为什么C#将整数类型实现为结构而不是基本类型?(Why C# implements integer type as a struct and not as a primitive type?)
看一下如何将
int
类型实现为C#中的System.Int32 struct
,我想知道为什么这样实现(通过将其包装成结构类型),而不选择像Java那样的原始类型实现?结构中的额外包装不会产生额外的性能命中吗?
Looking on how the
int
type is implemented as theSystem.Int32 struct
in C#, I wonder why was implemented like this (by wrapping this into a struct type), and not opted for a primitive type implementation like in Java?Doesn't the additional wrapping in a struct produces additional performance hits?
原文:https://stackoverflow.com/questions/40844976
最满意答案
好的 - 我修好了。 app.yaml需要修改。
我认为指南上的说明有点误导 - 也许某些事情已经过时了?
这是我固定的app.yaml:
application: pooper-scooper-117 version: wp runtime: php api_version: 1 handlers: - url: /(.*\.(htm$|html$|css$|js$)) static_files: wordpress/\1 upload: wordpress/.*\.(htm$|html$|css$|js$) application_readable: true - url: /wp-content/(.*\.(ico$|jpg$|png$|gif$)) static_files: wordpress/wp-content/\1 upload: wordpress/wp-content/.*\.(ico$|jpg$|png$|gif$) application_readable: true - url: /(.*\.(ico$|jpg$|png$|gif$)) static_files: wordpress/\1 upload: wordpress/.*\.(ico$|jpg$|png$|gif$) - url: /wp-admin/(.+) script: wordpress/wp-admin/\1 secure: always - url: /wp-admin/ script: wordpress/wp-admin/index.php secure: always - url: /wp-login.php script: wordpress/wp-login.php secure: always - url: /wp-cron.php script: wordpress/wp-cron.php login: admin - url: /xmlrpc.php script: wordpress/xmlrpc.php - url: /wp-(.+).php script: wordpress/wp-\1.php - url: /(.+)?/? script: wordpress/index.php
Ok - I fixed it. The app.yaml needed modifying.
I think the instructions on the guide are a bit misleading - maybe something is out of date?
Here is my fixed app.yaml:
application: pooper-scooper-117 version: wp runtime: php api_version: 1 handlers: - url: /(.*\.(htm$|html$|css$|js$)) static_files: wordpress/\1 upload: wordpress/.*\.(htm$|html$|css$|js$) application_readable: true - url: /wp-content/(.*\.(ico$|jpg$|png$|gif$)) static_files: wordpress/wp-content/\1 upload: wordpress/wp-content/.*\.(ico$|jpg$|png$|gif$) application_readable: true - url: /(.*\.(ico$|jpg$|png$|gif$)) static_files: wordpress/\1 upload: wordpress/.*\.(ico$|jpg$|png$|gif$) - url: /wp-admin/(.+) script: wordpress/wp-admin/\1 secure: always - url: /wp-admin/ script: wordpress/wp-admin/index.php secure: always - url: /wp-login.php script: wordpress/wp-login.php secure: always - url: /wp-cron.php script: wordpress/wp-cron.php login: admin - url: /xmlrpc.php script: wordpress/xmlrpc.php - url: /wp-(.+).php script: wordpress/wp-\1.php - url: /(.+)?/? script: wordpress/index.php
相关问答
更多-
为了节省您的时间,请查看其他解决方案。 我现在正在完成这个确切的任务,但由于Cloud SQL的性能很差,我即将放弃。 它可能适用于像Orane这样的网站,但对于更大更复杂的网站来说,云端SQL的高延迟和慢响应时间意味着我们3秒的加载时间而不是我们的VPS上的0.7秒。 我已经通过连接到IP和Socket,SSL而没有进行测试,并且它不能按原样使用。 如果您使用Amazon RDS进行测试,速度的差异是令人震惊的。 我们能够提出的唯一其他解决方案是设置一个API服务器,该服务器不断地将数据缓存到内存缓存,并 ...
-
正如你所提到的,你正在关注谷歌自己的指示 ...... 然后在标题为...的部分中。 步骤4.创建您的wp-config.php配置文件 其中说明指出您应该使用以下内容替换现有行: /** The name of the database for WordPress */ define('DB_NAME', '**wordpress_db**'); /** MySQL database username */ define('DB_USER', '**wp_user**'); /** MySQL dat ...
-
更新应用引擎实体(Update app engine entity)[2024-01-17]
如果您有权访问数据存储,请使用 gql 。 你必须定义方法来根据你的db类进行更新。 更新只能通过类发生,并且需要通过请求调用。 Use gql if you have access to the datastore. You have to define methods to do the update according your db class. The updates can happen only via the class and it needs to be called upon by r ... -
近几个月谷歌应用程序引擎IP映射中有什么变化? 他们实际上将整个SSL内容从Google Apps中移出,并允许您直接从GAE处理自定义域。 这应该是在六月份完成,但它们有点落后。 有没有一种方法可以强制我的自定义域在Google应用引擎场中达到“稳定”的IP地址? 您可以使用托管虚拟机设置应用程序,这样您仍将使用应用程序引擎,但是来自具有固定IP的云计算实例。 Has anything changed within google app engine IP mapping in the recent mo ...
-
你可能会碰到Python自己的commands模块(它没有类似你的子模块)的冲突 - 以隐藏标准库中的模块和包的方式命名你自己的模块和包(就像命名变量的方式一样意在隐藏内建名称,如list或file )始终是一项危险的工作,尽管它“应该”起作用,但始终存在混淆的可能性。 你能否尝试将commands包及其用途重命名为明确且没有危险的内容,例如mycommands ,并查看是否会使问题消失? 如果是这种情况,你可以在GAE的跟踪器上打开一张票(因为它会在GAE的运行时显示一个小的但不可否认的错误),但同时你的 ...
-
在Google App Engine上本地运行Wordpress时出错(Error running Wordpress locally on the Google App Engine)[2022-11-19]
在屏幕截图中,您访问了端口8000. 8000是管理端口。 您想要8080作为默认模块。 所以: http://localhost:8080/wp-admin/install.php 。 In your screenshot, you visited port 8000. 8000 is the admin port. You want 8080 for the default module. So: http://localhost:8080/wp-admin/install.php. -
好的 - 我修好了。 app.yaml需要修改。 我认为指南上的说明有点误导 - 也许某些事情已经过时了? 这是我固定的app.yaml: application: pooper-scooper-117 version: wp runtime: php api_version: 1 handlers: - url: /(.*\.(htm$|html$|css$|js$)) static_files: wordpress/\1 upload: wordpress/.*\.(htm$|html$|c ...
-
这是因为您不能在Google App Engine标准环境中写入本地文件系统。 也许您应该选择App Engine灵活的环境,因为App Engine灵活的环境允许您写入本地文件系统。 也就是说,默认情况下出于安全原因强制执行严格的权限。 您可以选择1)使用您自己的Dockerfile并更改wordpress/wp-content/uploads目录的权限。 或者2)以某种方式使用/upload uploads文件夹。 此外,App Engine是多服务器架构。 默认情况下,当您的博客获得大量流量时,App ...
-
无法在Google App Engine中运行本地WordPress(Trouble running local WordPress in Google App Engine)[2023-11-20]
如果您收到空白页面,则需要检查错误 在/wordpress/wp_config.php文件集中 define('WP_DEBUG',false); @ini_set( '的display_errors',0); 至 define('WP_DEBUG',true); @ini_set( '的display_errors',1); 当你去的时候看看输出是什么 http://localhost:8080 Looks like Google App Engine doesn't support WordPress ... -
如何在Google Container Engine上安装Wordpress更新?(How to install Wordpress updates on Google Container Engine?)[2022-02-02]
我不确定权限问题,但您可以使用kubectl exec进行调试。 如果你有一个名为wordpress-abcde的pod,你应该能够运行kubectl exec wordpress-abcde -i -t sh来打开该pod中(唯一)容器中的shell。 这是kubectl exec的文档。 I'm not sure about the permissions issues, but you can debug using kubectl exec. If you have a pod named word ...