我有一个包含函数funcB()的父类,我想通过在这个函数中进行一些更改来覆盖更好的函数.父类中的此函数调用同一类中的另一个私有函数.
示例代码:
class classA {
private function funcA() {
return "funcA called";
}
public function funcB() {
$result = $this->funcA();
return $result;
}
}
class ClassB extends ClassA {
public function funcB($a) {
//do some more stuff
$result = $this->funcA();
return $result;
}
}
Run Code Online (Sandbox Code Playgroud)
我得到致命错误,因为我不允许从ClassB内调用私有父:: funcA()函数.但必须要求召集.这怎么可能呢?
我们使用@Configuration
类来进行基于Java的Spring配置.我正在尝试设置AnnotationConfigApplicationContext
(s)的层次结构.
它似乎工作.因为我可以从父上下文中自动将bean作为从其中一个子上下文创建的bean的成员.
但是我没有管理从父上下文到@Configuration
类文件的自动装配bean ,这非常方便.它们都是空的.
// parent context config
@Configuration
public class ParentContextConfig{
@Bean parentBeanOne...
@Bean parentBeanTwo...
}
Run Code Online (Sandbox Code Playgroud)
// child context config
@Configuration
public class ChildContextConfig{
@Autowired parentBeanOne
@Bean childBeanOne...
}
Run Code Online (Sandbox Code Playgroud)
// a sample bean
@Component
public class ChildBeanOne{
@Autowired parentBeanTwo
}
Run Code Online (Sandbox Code Playgroud)
在这个示例中,我得到的是parentBeanTwo
正确创建的,而parentBeanOne
不是autowired(null
)到配置文件.
我错过了什么?
我有工作的Mac,笔记本上的Ubuntu,服务器上的CentOS,女朋友的Windows和我的VM.我曾经gMate
(Ubuntu)工作非常好,离TextMate
我(在我的Mac上),e.texteditor
(Windows)和nano
CentOs都不远.现在我想为我的所有环境安装一个编辑器.我可以选择vim或emacs.我认为vim更易于管理:).
我知道有一堆铁轨石头(插件):来自秋田,scrooloose,教皇等我前段时间尝过所有这些.所有这些都是马车(我认为问题在我手中).
所以我现在真正需要的是选择一个易于安装的插件.
第二大特色是你最喜欢的vim命令,如:
来自*Mates的其他有用的东西.
我想设置vim face:左边的文件管理器,底部的控制台等等.我该怎么做呢.
赏金之后:感谢大家!要赢得vim!
我过去一直在使用不同的装载机,这里最受欢迎:
bulkloader亚瑟debert:https://github.com/arthur-debert/BulkLoader
loaders by greensock:http://www.greensock.com/loadermax/
由hydrotic 建立的queueloader:https://github.com/hydrotik/QueueLoader/wiki/
哪一个是最好的,哪个是挑战?
我尝试了test-libstdc ++演示,并且喜欢我可以从控制台启动它,并且无需运行完整的Android应用程序.
我想创建一个opengl上下文,这样我就可以在控制台内执行我的opengl es 2.0应用程序,而不会有太多麻烦.
任何想法如何从不使用本机活动或任何东西的NDK应用程序中初始化EGL,即它甚至不打包在.APKK文件中,只是将main方法打包为可执行的linux文件.
非常感谢!
ANativeWindow_acquire
在*android/native_window.h`中有任何机会吗?
谢谢!
我需要创建一个应该有csv文件作为附件的邮件.如何将csv文件附加到django中的邮件?
我有一个功能,在对话框而不是主窗口中打开一个页面.有点清理的代码如下:
var baseurl = window.location.origin + '/static/docs/'
function onClickLink(event) {
event.preventDefault();
if ($("#dialog").length == 0) {
setUpDialog()
}
var href = event.target.href;
href = baseurl + href.substring(1 + href.lastIndexOf('/'));
$("#dialog").load(href + ' .body', function(response, status, xhr) {
if (status == "error") {
window.location = event.target.href;
} else {
changeImageSrc();
reStructure();
}
});
$("#dialog").dialog({
modal: true,
title: event.target.text,
width: 960,
position: ['center', 100]
});
}
Run Code Online (Sandbox Code Playgroud)
此代码在Chrome中运行良好,但(状态=="错误")在Firefox下执行.看起来Firefox有404错误,可能是加载页面的图像,或者类似的东西.
那么,这有什么区别:
<body dir="rtl">
Run Code Online (Sandbox Code Playgroud)
还有这个?:
<body style="direction:rtl">
Run Code Online (Sandbox Code Playgroud) 是的,通过使用异常获取类名是一个合理的解决方案,但我正在寻找更优雅的东西.
String className = new Exception().getStackTrace()[1].getClassName();
Run Code Online (Sandbox Code Playgroud)
这将主要用于日志记录目的,并确保我的缓存关键字是特定于组件/调用者类的.
android ×2
java ×2
adobe ×1
air ×1
ajax ×1
android-ndk ×1
apache-flex ×1
css ×1
django ×1
firefox ×1
flash ×1
html ×1
image-zoom ×1
javascript ×1
jquery ×1
nativewindow ×1
opengl-es ×1
overriding ×1
php ×1
pinchzoom ×1
private ×1
python ×1
ruby ×1
spring ×1
text-editor ×1
vim ×1