null

开源项目: FlycoTabLayout SlidingTabLayout不显示字体的问题

£可爱£侵袭症+ 提交于 2020-03-06 10:25:30
异常: 导入优秀开源项目 FlycoTabLayout 使用后,Tab莫名其妙的不显示文字,头疼。 解决办法: 项目中存在两个layout_tab.xml文件 ,将其中一个布局文件重命名,只能这么办了。 下面是解决过程,如节省时间,可跳过。 经过一番断点调试发现: tv_tab_title 为null ,这就很蛋疼了 private void addTab(final int position, String title, View tabView) { TextView tv_tab_title = tabView.findViewById(R.id.tv_tab_title); if (tv_tab_title != null && title != null) { tv_tab_title.setText(title); } tabView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { int position = mTabsContainer.indexOfChild(v); if (position != -1) { setCurrentTab(position); } } }); 再看引用代码: public void

openssl RSA 内存读取密钥

大城市里の小女人 提交于 2020-03-06 06:07:40
主要注意一下密钥的格式 #include <openssl/pem.h> #include <openssl/err.h> bool CEncipher::CreatePubKey() { BIO* bp = NULL; string strPublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmm9GRVbi5+myHYztzOyWvMdo1\ 4b0fwRF3va9A8bd19oW9ZUCpALVIC4d4I1Zvkfcgnpvswf/DOHD9umT+pevmwICF\ /mU8LNe/MT8kGh0IAIHdJVrXw/2TEWCVEgFlFfloWzCNmzOcx4BH8yIw50RjG1ED\ 5Fl5QKFrirgcU11IhQIDAQAB"; int nPublicKeyLen = strPublicKey.size(); for(int i = 64; i < nPublicKeyLen; i+=64) { if(strPublicKey[i] != '\n') { strPublicKey.insert(i, "\n"); } i++; } strPublicKey.insert(0, "-----BEGIN PUBLIC KEY-----\n"); strPublicKey.append("\n-----END

将两个有序链表合并为一个新的有序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的

橙三吉。 提交于 2020-03-06 04:44:08
public ListNode mergeTwoLists(ListNode l1,ListNode l2){ if(l1 null){ return l2; } if(l2 null){ return l1; } ListNode newhead=null; ListNode newTail=null; ListNode cur1=l1; ListNode cur2=l2; while(cur1!=null&&cur2!=null){ if(cur1.val<cur2.val){ if(newTail null){ newhead=cur1; newTail=cur1; }else{ newTail.next=cur1; newTail=newTail.next; } cur1=cur1.next; }else{ if(newTail null){ newhead=cur2; newTail=cur2; }else{ newTail.next=cur2; newTail=newTail.next; } cur2=cur2.next; } } if(cur1==null){ newTail.next=cur2; }else{ newTail.next=cur1; } return newhead; } 来源: CSDN 作者: keithendnasjkf 链接: https:/

Undesirable Zero on the Output of Single Linked-list

泪湿孤枕 提交于 2020-03-04 23:06:21
问题 I am trying to do a simple linked-list in order to print the numbers inserted as arguments on the call of the program. However, it prints an undesirable zero on the final of the output. I guess it is a NULL that is printed, but I don't know how to get rid of it. I am still understanding the basics of linked-lists. Thank you. /* */ #include <stdio.h> #include <stdlib.h> /* */ #define NUMERO_DE_ARGUMENTOS_MINIMO 3 #define EOS '\0' /* */ #define OK 0 #define ARGUMENTO_NULO 1 #define ARGUMENTO

Undesirable Zero on the Output of Single Linked-list

萝らか妹 提交于 2020-03-04 23:04:51
问题 I am trying to do a simple linked-list in order to print the numbers inserted as arguments on the call of the program. However, it prints an undesirable zero on the final of the output. I guess it is a NULL that is printed, but I don't know how to get rid of it. I am still understanding the basics of linked-lists. Thank you. /* */ #include <stdio.h> #include <stdlib.h> /* */ #define NUMERO_DE_ARGUMENTOS_MINIMO 3 #define EOS '\0' /* */ #define OK 0 #define ARGUMENTO_NULO 1 #define ARGUMENTO

SpringBoot参数校验:@NotBlank、@NotNull、@NotEmpty三者之间的区别

允我心安 提交于 2020-03-04 14:01:46
@NotNull 验证对象是否不为null, 无法查检长度为0的字符串: 不能为null,但可以为空字符串 @NotBlank 检查约束 (字符串) 是不是Null还有被Trim的长度是否大于0,只对字符串,且会去掉前后空格.: 只能作用在String上,不能为null,而且调用trim()后,长度必须大于0 @NotEmpty 检查(集合)约束元素是否为NULL或者是EMPTY. : 不能为null,并且长度必须大于0 @NotEmpty修饰的String类、Collection、Map、数组,是不能为null或者长度为0的(String Collection Map的isEmpty()方法) 来源: oschina 链接: https://my.oschina.net/u/4066655/blog/3187806

Generate a type where each nullable value becomes optional

我们两清 提交于 2020-03-03 09:06:41
问题 I have a type like this one: interface A { a: string b: string | null } I would like to generate the same type but each nullable value becomes optional: interface A { a: string b?: string | null } Something like that but only for nullable values (this one makes all values optional): export type NullValuesToOptional<T> = { [P in keyof T]?: T[P] } 回答1: Extracting the nullable field keys and then generating a new type based on that information would work. This answer on removing never types

Generate a type where each nullable value becomes optional

你说的曾经没有我的故事 提交于 2020-03-03 09:05:28
问题 I have a type like this one: interface A { a: string b: string | null } I would like to generate the same type but each nullable value becomes optional: interface A { a: string b?: string | null } Something like that but only for nullable values (this one makes all values optional): export type NullValuesToOptional<T> = { [P in keyof T]?: T[P] } 回答1: Extracting the nullable field keys and then generating a new type based on that information would work. This answer on removing never types

Generate a type where each nullable value becomes optional

拜拜、爱过 提交于 2020-03-03 09:05:12
问题 I have a type like this one: interface A { a: string b: string | null } I would like to generate the same type but each nullable value becomes optional: interface A { a: string b?: string | null } Something like that but only for nullable values (this one makes all values optional): export type NullValuesToOptional<T> = { [P in keyof T]?: T[P] } 回答1: Extracting the nullable field keys and then generating a new type based on that information would work. This answer on removing never types