virtual

How to push key value into UITextView from custom keyboard in iOS

北慕城南 提交于 2019-12-08 08:42:58
问题 I am building a virtual keyboard for a UITextView. All works well, I can display the keyboard and remove the keyboard as well as display the keystrokes. I am using the "stringByReplacingCharactersInRange: withString" method to place the new keystroke into the text view. This works but since it is replacing the string each time, the entry point goes to the end of the string. This all makes sense, but is not very usable. I can fix this by doing checks in my code but there might be something

Could not reserve enough space for object heap liferay tomcat

喜夏-厌秋 提交于 2019-12-08 07:24:25
问题 When I am running i am getting following exception repeatedly each time i try to run the program. Several ports (8005, 8080, 8009) required by Liferay v6.1 CE Server (Tomcat 7) at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s). I tired to increase my virtual memory(page size) and ram size. But it not workinge Currently, I

Passing pointer to derived class, to function that expects pointer to base class?

 ̄綄美尐妖づ 提交于 2019-12-08 03:12:13
问题 OK. I'm not very good at polymorphism in C++, but I've a problem now. Imagine these classes: class Parent { public: Parent(); virtual ~Parent(); }; class Child : public Parent { public: Child(); }; class Director public: Director(); void doStuff(Parent* p); }; // Assume we have a instance of Director, and call the doStuff function here: doStuff(new Child()); // Gives error I get the error cannot convert parameter 1 from 'Child *' to 'Parent *' And my simple question is, WHY this doesn't work?

“virtual” method's return type in objective-c

我们两清 提交于 2019-12-08 01:16:05
问题 I have a class which is supposed to be abstract. In one of it's abstract methods the return type may be an instance of class1,class2 or class3, depending on the class that's implementing the method. I'm wondering how should I declare the method in the abstract class. I thought about using dynamic typing, but I want the return type to be restricted to one of the 3 classes, not every type, and in addition I'm not sure I can override it so that in the inheriting class the return type will not

Virtual function calling a non-virtual function

和自甴很熟 提交于 2019-12-07 17:40:41
问题 I wrote the following piece of code to test my understanding of virtual inheritance. Apparently, I still don't get it fully. Here is my code (followed by my question): #include <iostream> #include <vector> using namespace std; class Foo { public: virtual void foo(); void foo2(); }; void Foo::foo() { cout << "In FOO - foo 1" << endl; foo2(); } void Foo::foo2() { cout << "In FOO - foo 2" << endl; } class Bar : public Foo { public: void foo(); void foo2(); }; void Bar::foo() { cout << "In BAR -

使用 Docker/LXC 迅速启动一个桌面系统

允我心安 提交于 2019-12-07 16:45:22
Docker是 dotCloud 最近几个月刚宣布的开源引擎,旨在提供一种应用程序的自动化部署解决方案,简单的说就是,在 Linux 系统上迅速创建一个容器(类似虚拟机)并在容器上部署和运行应用程序,并通过配置文件可以轻松实现应用程序的自动化安装、部署和升级,非常方便。因为使用了容器,所以可以很方便的把生产环境和开发环境分开,互不影响,这是 docker 最普遍的一个玩法。更多的玩法还有大规模 web 应用、数据库部署、持续部署、集群、测试环境、面向服务的云计算、虚拟桌面 VDI 等等。 Docker 使用 Go 语言编写,用 cgroup 实现资源隔离,容器技术采用 LXC. LXC 已经足够成熟,被多个主流 PaaS 服务商采用(比如 dotCloud),国内的一些互联网公司也在用(比如腾讯)。虽然都是企图解决自动化部署方面的问题,Docker 的解决方式有别于我们 常提到的 Puppet/Chef ,他们虽然走的是不同的路,但也可以拿来一起用。 上面说了 Docker 有很多玩法,下面介绍的玩法是:在服务器上用 docker 创建桌面系统,然后在客户端上通过 ssh 远程连接桌面,可以看作是平民化的 VDI 解决方案。 安装 Docker/LXC 如果 Linux kernel 是 3.8 以前的内核,或者内核缺少 aufs 模块需要安装额外的扩展模块: $ sudo apt

How to push key value into UITextView from custom keyboard in iOS

血红的双手。 提交于 2019-12-07 13:30:28
I am building a virtual keyboard for a UITextView. All works well, I can display the keyboard and remove the keyboard as well as display the keystrokes. I am using the "stringByReplacingCharactersInRange: withString" method to place the new keystroke into the text view. This works but since it is replacing the string each time, the entry point goes to the end of the string. This all makes sense, but is not very usable. I can fix this by doing checks in my code but there might be something better... So my question is this; Is there a way to push the new key to the UITextView directly without

Android Studio: “Ok” button disabled in “Create new AVD” window

旧时模样 提交于 2019-12-07 12:10:53
问题 I downloaded and installed the latest Android Studio version which is 0.8.6 (beta) and I was stuck while trying to create a new Android Virtual Device. I tried to follow these steps: https://developer.android.com/training/wearables/apps/creating.html but looks like the CPU/ABI is unavailable when I pick one of the types mentioned in that document (Android Wear Square/Round) and the skins named AndroidWearRound or AndroidWearSquare are also unavailble. Here's a screenshot: 回答1: It's pretty

Virtual functions table offset

允我心安 提交于 2019-12-07 12:03:58
问题 I would like to ask you on what does the offset of the table of virtual functions for a class depend? I mean, from what I've read it at least depends on compiler, but does it varies from class to class? Edit: by offset I mean the position of the table relative to the address of the owner object. Edit: example code: void **vtable = *((void***)(((char*)object)+offset)); int **ivtable=(int **)vtable; void* firstFunction = (void*) ivtable[0]; 回答1: There is certainly a dependency on the exact

How to SelectAll in a WinForms virtual ListView?

亡梦爱人 提交于 2019-12-07 11:03:11
问题 What is the correct/managed way to SelectAll in a .NET listview that is in virtual mode ? When a ListView's VirtualMode is enabled, the notion of selecting a ListViewItem goes away. The only thing you select are indexes . These are accessible through the SelectedIndices property. Workaround #1 The first hack is to add iteratively add every index to the SelectedIncides collection: this.BeginUpdate(); try { for (int i = 0; i < this.VirtualListSize; i++) this.SelectedIndices.Add(i); } finally {