default

How to set a color by default in R for all plot.default, plot or lines calls

折月煮酒 提交于 2019-12-04 06:52:48
to simplify my daily R interactions, I'd like to set up default colors for all my plots. For example, let's say I want to have all plots made with red lines (like in gnuplot...:-) ) So far, here is a snippet of my .Rprofile setHook(packageEvent("grDevices", "onLoad"), function(...) grDevices::X11.options(width = 14, height = 8, type = "Xlib", xpos = 600, ypos = 30, canvas = "grey87")) suppressPackageStartupMessages( require(Defaults) ) suppressPackageStartupMessages( require(utils) ) suppressPackageStartupMessages( require(graphics) ) setDefaults("plot.default",frame.plot=FALSE, type='l', col

C11 _Generic usage

半城伤御伤魂 提交于 2019-12-04 06:11:29
I was trying to learn how to use the "new" C11 Generic expressions but I ran into a wall. Consider the following code: #include <stdlib.h> #include <stdio.h> #define test(X, Y, c) \ _Generic((X), \ double: _Generic((Y), \ double * : test_double, \ default: test_double \ ), \ int: _Generic((Y), \ int * : test_int, \ default: test_int \ ) \ ) (X, Y, c) int test_double(double a, double *b, int c); int test_int(int a, int *b, int c); int test_double(double a, double *b, int c) { return 1; } int test_int(int a, int *b, int c) { return 2; } int main() { double *t = malloc(sizeof(double)); int *s =

VIM: set filetype=txt for every new file [No Name]

為{幸葍}努か 提交于 2019-12-04 05:10:26
I tried all possible things to let vim set filetype to 'txt' to all new files I create (in a new tab) but it doesn't work. This is p.e. what I've read on the web a few times: au BufRead,BufNewFile *.txt setlocal ft=txt (to put in _vimrc) However it doesn't work. Can anyone help me? Curt Nelson The following line, added to your .vimrc , will set the filetype to text if it is not already set. autocmd BufEnter * if &filetype == "" | setlocal ft=text | endif All files are considered plain text unless you have file-type detection turned on or explicitly set the file-type. However, Vim lets you set

MySQL: UNIQUE, but DEFAULT NULL - allowed by creating of table. More than 1 NULL is allowed to insert. Why?

与世无争的帅哥 提交于 2019-12-04 04:37:29
I've just checked and it's allowed to create a table with a column that is NULL by default, although it's a UNIQUE KEY at the same time: CREATE TABLE IF NOT EXISTS `u789` ( `column1` varchar(10) DEFAULT NULL, UNIQUE KEY (column1) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; As I understand, it looks odd and has not much sense. I expected the second insert of INSERT INTO u789 VALUE (NULL); will fail. But, it inserts first, second, third NULL value without any problems. Who can explain me why it iserts second and third columns if NULL is already in the table? This is a theoretical question (as I

Default values for varchar and int mysql data types

白昼怎懂夜的黑 提交于 2019-12-04 04:31:06
The screenshot show 3 typical definitions of data type: id (autoincrement), a title and a number. 1.- Which are differences between: none and NULL ? 2.- Do I must choose as defined: '' for varchar types when I want an empty string? 3.- Do I must put an as defined: 0 default value for autoincrement int types? Default none means there is no default value. If a value is not provided on an insert, the query will fail with a "no default value error". NULL is the actual NULL value meaning if no value is provided on an insert the column will default to NULL (empty). For varchar you can set default to

How to customise the tag format of the Maven release plugin?

南楼画角 提交于 2019-12-04 00:44:47
In our SVN repo, we store tags like this: trunk project_a project_b branches project_a branch_x branch_y project_b tags project_a 1.0 1.1 project_b 1.0 When I run the Maven release plugin's " prepare " goal on project A, by default it creates the tag as "tags/project_a-x.x", which does not match my tag naming scheme above. I am thus depending upon whoever does the release (i.e. a fallible human) to spot this and change the tag to "tags/project_a/x.x". How can I tell the release plugin to use the correct format by default? The "prepare" goal has a " tag " configuration option that claims to do

Change nltk.download() path directory from default ~/ntlk_data

拈花ヽ惹草 提交于 2019-12-03 23:38:48
I was trying to download/update python nltk packages on a computing server and it returned this [Errno 122] Disk quota exceeded: error. Specifically: [nltk_data] Downloading package stop words to /home/sh2264/nltk_data... [nltk_data] Error downloading u'stopwords' from [nltk_data] <https://raw.githubusercontent.com/nltk/nltk_data/gh- [nltk_data] pages/packages/corpora/stopwords.zip>: [Errno 122] [nltk_data] Disk quota exceeded: [nltk_data] u'/home/sh2264/nltk_data/corpora/stopwords.zip False How could I change the entire path for nltk packages, and what other changes should I make to ensure

Default value at design time XAML

心已入冬 提交于 2019-12-03 22:18:59
I have a binded TextBlock , XAML: <TextBlock Text="{Binding MyText}"/> I know the FallbackValue can be used if the Binding isn't available, but this happens at run time ? Is there any way to show a default value at design time ? It would make things easier if I could see a value when designing my windows instead of an empty TextBlock . Thanks Scroog1 If you would prefer a less verbose version of Ian Bamforth's answer , you can just do <TextBlock Text="{Binding MyText, FallbackValue=None}"/> IBam Adapting an example from this question. This works for me - the text "None" is shown in the

Change SMS App Default on Android 4.4.2

流过昼夜 提交于 2019-12-03 20:28:23
I would change default sms app on Android 4.4.2 I use this code: Intent sendIntent = new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT); sendIntent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME, context.getPackageName()); startActivity(sendIntent); How can i solve this? And how can i ask to change default sms app with my app? My Receiver: <receiver android:name="receiver.SMSHandlerReceiver" android:permission="android.permission.BROADCAST_SMS" > <intent-filter> <action android:name="android.provider.Telephony.SMS_DELIVER" /> </intent-filter> </receiver> Thank you. It seems that if you

Change the default location of Pycharm Project

 ̄綄美尐妖づ 提交于 2019-12-03 19:09:29
问题 I am using PyCharm 3.4.1 on Ubuntu 14.04. For new project it suggests ~/PyCharmProjects for storing project folders. Is it possible to change the location and name of this proposed folder? (I couldn't find any reference to changing it in the interface, on the JetBrains site, or in the settings files. Either it isn't possible or (I hope) I missed something.) Note, it is not a duplicate of Can I change the location/name of PyCharmProjects? - I am aware that it is possible to change proposed