default

Force telnet client into character mode

允我心安 提交于 2019-11-26 09:53:42
问题 I have an application where I accept a socket connection from a telnet client and put up a simple, keyboard driven character GUI. The telnet client, at least on Linux, defaults into line-at-a-time mode, so I always have to do ^]mode char manually. A skim of the relevant RFCs suggests that if my application simply sent the characters IAC DONT LINEMODE (\\377\\376\\042) as soon as the client connects, the client should be forced into character mode. However, it doesn\'t make any difference.

How to change MySQL data directory?

[亡魂溺海] 提交于 2019-11-26 09:29:32
Is it possible to change my default MySQL data directory to another path? Will I be able to access the databases from the old location? user1341296 Stop MySQL using the following command: sudo /etc/init.d/mysql stop Copy the existing data directory (default located in /var/lib/mysql ) using the following command: sudo cp -R -p /var/lib/mysql /newpath edit the MySQL configuration file with the following command: sudo gedit /etc/mysql/my.cnf # or perhaps /etc/mysql/mysql.conf.d/mysqld.cnf Look for the entry for datadir , and change the path (which should be /var/lib/mysql ) to the new data

Android: change default Home Application

我是研究僧i 提交于 2019-11-26 09:27:26
问题 for some specific requirement I am required to change Android Default Home application with my customized Home application ( a setting inside my app that will toggle default home = my application or previous home) I don\'t want the user to travel android settings that are very complicated. Can any one help me out like where it registers launcher.apk for default home application or how to change that The only thing I could find was that old question: How to change default Android's Desktop

Android Preferences: How to load the default values when the user hasn't used the preferences-screen?

◇◆丶佛笑我妖孽 提交于 2019-11-26 08:58:13
问题 I am using a PreferenceActivity to let the user set some values. I am feeding it the xml file with the defined preferences. I have set all the android:defaultValue=\"\" for them. When I start my application, I need the preferences, or if they are not set yet manually, I want the default values: SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); boolean value = prefs.getBoolean(\"key\"), false); However, when android:defaultValue=\"true\" I still get false . So, it

How do I set default values for functions parameters in Matlab?

北城以北 提交于 2019-11-26 08:55:13
问题 Is it possible to have default arguments in Matlab? For instance, here: function wave(a, b, n, k, T, f, flag, fTrue=inline(\'0\')) I would like to have the true solution be an optional argument to the wave function. If it is possible, can anyone demonstrate the proper way to do this? Currently, I am trying what I posted above and I get: ??? Error: File: wave.m Line: 1 Column: 37 The expression to the left of the equals sign is not a valid target for an assignment. 回答1: There isn't a direct

Is there a reasonable approach to “default” type parameters in C# Generics?

强颜欢笑 提交于 2019-11-26 08:23:46
问题 In C++ templates, one can specify that a certain type parameter is a default. I.e. unless explicitly specified, it will use type T. Can this be done or approximated in C#? I\'m looking for something like: public class MyTemplate<T1, T2=string> {} So that an instance of the type that doesn\'t explicitly specify T2 : MyTemplate<int> t = new MyTemplate<int>(); Would be essentially: MyTemplate<int, string> t = new MyTemplate<int, string>(); Ultimately I am looking at a case wherein there is a

How to insert default values in SQL table?

余生颓废 提交于 2019-11-26 08:15:18
问题 I have a table like this: create table1 (field1 int, field2 int default 5557, field3 int default 1337, field4 int default 1337) I want to insert a row which has the default values for field2 and field4. I\'ve tried insert into table1 values (5,null,10,null) but it doesn\'t work and ISNULL(field2,default) doesn\'t work either. How can I tell the database to use the default value for the column when I insert a row? 回答1: Just don't include the columns that you want to use the default value for

How do I change the default index page in Apache?

会有一股神秘感。 提交于 2019-11-26 08:07:53
问题 I would like to change the default web page that shows up when I browse my site. I currently have a reporting program running, and it outputs a file called index.html. I cannot change what it calls the file. Therefore, my landing page must be called something else. Right now, when I browse my site it takes me to the reporting page. From what I see, whatever you call index.html it will pull that up as your default. I want to change that to landing.html. How do I do this? I am a folder (Folding

Pros and cons of package private classes in Java?

北战南征 提交于 2019-11-26 06:36:54
问题 I am learning Java recently, and I came across the notion of package-private classes, which is the default if we don\'t specify anything. But then I realized: I seldom see the use of package-private class. Is there a reason for this, e.g., it has serious drawbacks, it is redundant, or simply I am not reading enough? Are there strong arguments for/against its usage? If it is really not useful in most cases, why would it be the default? In what situation should we use package-private in the

How do you use the non-default constructor for a member?

纵然是瞬间 提交于 2019-11-26 05:38:40
问题 I have two classes class a { public: a(int i); }; class b { public: b(); //Gives me an error here, because it tries to find constructor a::a() a aInstance; } How can I get it so that aInstance is instantiated with a(int i) instead of trying to search for a default constructor? Basically, I want to control the calling of a\'s constructor from within b\'s constructor. 回答1: You need to call a(int) explicitly in the constructor initializer list: b() : aInstance(3) {} Where 3 is the initial value