- Android MVVM 架构应用实现(2)
渊Y
程序员android架构
Repository类:实现BmobRepository类,作为HomeViewModel的数据提供方。BmobRepository类中有一个挂起函数getAllRecommendLibrary(libraryRecommendData:MutableLiveData)用来获取云数据库中的数据,函数的参数是LiveData,在获取数据后,利用setValue通知View展示数据。classBmob
- C++学习笔记----7、使用类与对象获得高性能(一)---- 书写类(2)
王俊山IT
c++学习笔记开发语言
2.2、定义成员函数前面对SpreadsheetCell类的定义足以让你生成类的对象。然而,如果想调用setValue()或者getValue()成员函数,连接器就会抱怨这些函数没有定义。这是因为到目前为止,这些成员函数只有原型,而还没有实现。通常,类的定义会在模块接口文件。对于成员函数的定义,你有一个选择:可以在模块定义文件或者在模块实现文件。下面是SpreadsheetCell类,在类内对成员
- Ext选中一条下拉数据实现联动
weixin_54572614
Ext前端
前言前段时间因业务需要,需要加一项功能,就是选中一条数据,带动别的字段自动赋值,然后就去网上查资料,忘了从哪儿看的了,核心是这一段。原本是文本框赋值,被我改成下拉框赋值。Ext.getcmp("txtAdd”+actionID+"stationName").setValue(Ext.getcmp("cboAddactionID+"stationorder").getSelection().data
- Java:封装树结构
Monly21
Java基础java开发语言
实体类publicclassDictTreeselectVO{privateStringvalue;privateStringlabel;/***节点*/privateStringparentId;privateListchildren=newArrayList();publicStringgetValue(){returnvalue;}publicvoidsetValue(Stringvalue
- Interface Builder
Super宗Sir
view与xib连线的输出口报:'[setValue:forUndefinedKey:]:thisclassisnotkeyvaluecoding-compliantforthekeytapBtn.1、定位位置:tapBtn2、可能原因:1>存在多余的输出口,检查后删除即可2>连线的输出口关联到了Filesowner,切换到View关联即可
- LiveData异常后不走回调
竖起大拇指
1.问题起因:测试突然发现页面上有一块UI在某些情况下无内容展示,但是接口有下发对应字段。这种偶现的bug就很奇怪了,排查一波也没发现啥异常,就是个简单的接口请求,然后在LiveData回调中更新UI,突然在logcat中发现LiveDataObserver中有异常打印,这样看来问题出在LiveData了?赶紧debug一下,发现LiveData.setValue()此时卡在了dispatchin
- 【iOS 1 行代码系列】之 一行代码解耦控制器UIViewController
豪冷
实现原理:NSClassFromString()KVC新建分类,重写方法:-(void)setValue:(id)valueforUndefinedKey:(NSString*)key防止崩溃地址:JHUIViewControllerDecoupler:https://github.com/xjh093/JHUIViewControllerDecoupler///string->controlle
- iOS 使用Runtime机制将模型(对象)和字典相互转换
前行的骆驼
在我们常见开发中往往需要将模型(对象)和字典相互转换,字典转模型(对象)相对简单,可以用系统方法快速实现,而模型(对象)转字典往往需要我们进行反向对应拼接,如果模型(对象)的属性键值太多,就会加大我们的工作量,这是我们就可以用使用Runtime机制快速获取(下面的model指我们需要互相转化的模型(对象)):字典转模型(对象):[modelsetValuesForKeysWithDictionar
- RedisTemplate-opsForSet集合操作api
小哇666
#springboot#redis
1、add(Kkey,V...values)向变量中批量添加值。redisTemplate.opsForSet().add("setValue","A","B","C","B","D","E","F");2、members(Kkey)获取变量中的值。Setset=redisTemplate.opsForSet().members("setValue");System.out.println("通过
- 年假作业5
mmj12
算法
1、102、403、二、编程题1、都是静态成员2、(1)未声明友元报错,,应在friendvoidSetValue(Animal&,int);后加一句friendvoidSetValue(Animal&,int,int);(2)不会3、不知道为什么错了,想不通
- 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKe...
叶舞清风
无语了屏幕快照2018-12-21下午3.59.59.png屏幕快照2018-12-21下午4.02.34.png[图片上传失败...(image-ff7e18-1545379428606)]
- iOS KVC & KVO
SnoopPanda
KVCKVC全称Key-ValueCoding,俗称“键值编码”,可以通过Key来访问某个属性,写在NSObject的NSKeyValueCoding分类下面。常用方法-(void)setValue:(nullableid)valueforKey:(NSString*)key;-(void)setValue:(nullableid)valueforKeyPath:(NSString*)keyPat
- 如何统计网站在线人数?
slim_czf_5545
利用redis中的位图:Redis字符串中的setbitkeyoffsetvalue(0,1)命令可以对字符串对象对应的位进行二进制赋值。用户的登陆状态可以用一个bit来表示,这样1亿个用户所需的内存空间仅为10M左右。具体实现:首先在redis中初始化字符串:setbitloginstatus100000。在中间件上,当用户登陆认证完成时,获取用户uid并在redis上设置登陆状态setbitl
- react 自动更新状态
肥肥呀呀呀
react.jsjavascript前端
import{useMemo,useState}from"react"//eslint-disable-next-line@typescript-eslint/no-explicit-anyexportconstuseProxy=>(state:T):T=>{const[value,setValue]=useState()constcreateProxy=(target:T):T=>{return
- 今天我遇到了一个幽灵方法
临岁之寒
今天我遇到了一个幽灵方法,诡异至极,虽然我确信这个方法没有被调用过,无论是通过打断点,还是添加输出代码,我都在运行时验证了这一点,但诡异的是,那些只受该方法影响的变量,就是发生了改变。所以这是一个没有被调用,却又明显调用过的方法,一个幽灵方法。这个方法大概是这样的:publicclassWeight{......publicvirtualWeightsetValue(doubleweight){i
- 金蝶云星空-表单插件,赋值SetValue(三)
骑着牛的奇兵
金蝶云星空二开java前端javascript
给单据头,备注赋值,你好this.View.Model.SetValue("FNote", "你好");1、最终效果,打开销售订单,点按钮“获取值”,备注变成“你好”;using System;using System.Collections.Generic;using System.Linq;using System.Text;//引用using Kingdee.BOS.Core.Bill.Pl
- iOS:data,dic之间的转化
money_ac9e
dic->dataNSMutableDictionary*muDic=[NSMutableDictionarydictionary];[muDicsetValue:@(89.6)forKey:@"number"];NSData*jsonData=[NSJSONSerializationdataWithJSONObject:muDicoptions:kNilOptionserror:nil];NSS
- LiveData异常后不走回调
折剑游侠
前言:测试大佬突然发现页面上有一块UI在某些情况下无内容展示,但是接口有下发对应字段。这种偶现的bug就很头秃了,排查一波也没发现啥异常,就是个简单的接口请求,然后在LiveData回调中更新UI。这样看来问题出在LiveData了?正好本地也复现了这个问题,疯狂刷新调用接口,UI也没发生变化。赶紧debug一下,发现LiveData.setValue()此时卡在了dispatchingValue
- Postgresql数据库死锁
信息化战略
数据库postgresql
死锁报错1UPDATEdeadlock_exampleSETvalue=value+1WHEREid=1ERROR:deadlockdetectedDETAIL:Process95waitsforShareLockontransaction3553457;blockedbyprocess187.Process187waitsforShareLockontransaction3553458;bloc
- (IOS)修改UISearchBar的占位文字颜色
rightmost
//方法一(推荐使用)UITextField*searchField=[searchBarvalueForKey:@"_searchField"];[searchFieldsetValue:[UIColorblueColor]forKeyPath:@"_placeholderLabel.textColor"];//方法二(已过期)[[UILabelappearanceWhenContainedIn
- C++学习笔记(四十九):c++ 左值右值
pcop
c++学习笔记学习笔记
本节介绍c++左值和右值的相关知识。网上有很多种关于左值右值的定义,例如左值是有内存地址的,右值没有等等。我们可以不去坚持找到明确的定义,我们仅需要知道左值和右值是什么即可。#include#include//右值也可以是函数的返回值,例如intGetValue(){return10;//返回的是右值,返回的是一个临时值}voidSetValue(int&value){}//voidPrintNa
- KVC(Key-value coding)
bugLife丶
-(id)valueForKey:(NSString*)key;-(void)setValue:(id)valueforKey:(NSString*)key;KVC就是指iOS的开发中,可以允许开发者通过Key名直接访问对象的属性,或者给对象的属性赋值。而不需要调用明确的存取方法。这样就可以在运行时动态地访问和修改对象的属性。而不是在编译时确定,这也是iOS开发中的黑魔法之一。很多高级的iOS开发
- 【线程间通讯之wait和notify】 1.notify后wait的线程无法立刻唤醒 2.要等到notify的线程退出synchronized后才能去真正抢锁 3.N个线程交替打印数字(理解内部类)
zfoo-framework
#java多线程java
Data.javapackageorg.example.testwaitnotify;publicclassData{privateintvalue;publicintgetValue(){returnvalue;}publicvoidsetValue(intvalue){this.value=value;}}ThreadA.javapackageorg.example.testwaitnotif
- tui-editor编辑器自定义按钮
米芝芝
vue编辑器javascript前端
tui-editor编辑器自定义按钮上传图片按钮及事件initEditor(){this.editor=newEditor({el:document.getElementById(this.id),...this.editorOptions})if(this.value){this.editor.setValue(this.value)}this.editor.on('change',()=>{t
- LiveData 多次postValue 丢失
RookieJay
Android框架androidjetpack
直接上源码:意思很明显:如果在主线程执行已发布任务之前多次调用此方法,则只调度最后一个值。所以如果需要接口每次liveData发送的值,请在主线程使用setValue方法。
- IOS-数据持久化UserDefaults简单使用-Swift
饼子会飞
IOS-Swift学习iosswift开发语言持久化UserDefaults
UserDefaults通过key-value的一种持久化方案,以键值对的形式存储基本类型数据,类似与安卓的SharePreferences。使用方式,首先就是要获取standerdletuserDefault=UserDefaults.standard存取字符串//存取字符串vargreeting="Hello,playground"userDefault.setValue(greeting,f
- 【第十九节】变量与运算符-赋值运算符的使用
弓弧名家_玄真君
java专栏笔记java
当"="两侧数据类型不一致时,可以使用自动类型转换或使用强制类型转换原则进行处理支持连续赋值+=、-=、*=、/=、%=操作,不会改变变量本身的类型publicclassSetValueTest{publicstaticvoidmain(String[]args){inti=5;longl=10;byteb=(byte)i;//操作方式1inta1=10;intb1=5;//操作方式2:连续赋值i
- QSettings使用
white_loong
QTQtiniQSettings配置信息
头文件#include一、最简单操作QSettings*minifile;//声明minifile=newQSettings("./config1.ini",QSettings::IniFormat);//实例化//QSettings构造函数的第一个参数是ini文件的路径,第二个参数表示针对ini文件,第三个参数可以缺省minifile->setValue("/para1/first","1111
- QSettings功能介绍及应用
AI+程序员在路上
QT系列qt开发语言
一.QSetting介绍QSettings类提供了一种持久的、与平台无关的应用程序设置存储功能。QSettings能读写配置文件,当配置文件不存在时,可生成配置文件。二.基本用法QSettings提供了简单易用的API,下面介绍一些常用的操作:1.写入配置信息使用setValue()函数可以将键值对存储到配置文件中:settings.setValue("key","value");2.读取配置信息
- wxWidgets实战:wxRadioButton切换不同查找面板
haimianjie2012
wxWidgetskicadwxWidgetsGUIc++
先看看功能效果:wxRadioButton头文件:#include函数:m_rbtnMode1->GetValue()SetValue(true);创建radiobuttonm_rbtnMode1=newwxRadioButton(m_PanelAnalyse,wxID_ANY,_("BasedonLookupKeyword,ModelNameorManufacturerPartNo."),wxD
- java数字签名三种方式
知了ing
javajdk
以下3钟数字签名都是基于jdk7的
1,RSA
String password="test";
// 1.初始化密钥
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(51
- Hibernate学习笔记
caoyong
Hibernate
1>、Hibernate是数据访问层框架,是一个ORM(Object Relation Mapping)框架,作者为:Gavin King
2>、搭建Hibernate的开发环境
a>、添加jar包:
aa>、hibernatte开发包中/lib/required/所
- 设计模式之装饰器模式Decorator(结构型)
漂泊一剑客
Decorator
1. 概述
若你从事过面向对象开发,实现给一个类或对象增加行为,使用继承机制,这是所有面向对象语言的一个基本特性。如果已经存在的一个类缺少某些方法,或者须要给方法添加更多的功能(魅力),你也许会仅仅继承这个类来产生一个新类—这建立在额外的代码上。
- 读取磁盘文件txt,并输入String
一炮送你回车库
String
public static void main(String[] args) throws IOException {
String fileContent = readFileContent("d:/aaa.txt");
System.out.println(fileContent);
- js三级联动下拉框
3213213333332132
三级联动
//三级联动
省/直辖市<select id="province"></select>
市/省直辖<select id="city"></select>
县/区 <select id="area"></select>
- erlang之parse_transform编译选项的应用
616050468
parse_transform游戏服务器属性同步abstract_code
最近使用erlang重构了游戏服务器的所有代码,之前看过C++/lua写的服务器引擎代码,引擎实现了玩家属性自动同步给前端和增量更新玩家数据到数据库的功能,这也是现在很多游戏服务器的优化方向,在引擎层面去解决数据同步和数据持久化,数据发生变化了业务层不需要关心怎么去同步给前端。由于游戏过程中玩家每个业务中玩家数据更改的量其实是很少
- JAVA JSON的解析
darkranger
java
// {
// “Total”:“条数”,
// Code: 1,
//
// “PaymentItems”:[
// {
// “PaymentItemID”:”支款单ID”,
// “PaymentCode”:”支款单编号”,
// “PaymentTime”:”支款日期”,
// ”ContractNo”:”合同号”,
//
- POJ-1273-Drainage Ditches
aijuans
ACM_POJ
POJ-1273-Drainage Ditches
http://poj.org/problem?id=1273
基本的最大流,按LRJ的白书写的
#include<iostream>
#include<cstring>
#include<queue>
using namespace std;
#define INF 0x7fffffff
int ma
- 工作流Activiti5表的命名及含义
atongyeye
工作流Activiti
activiti5 - http://activiti.org/designer/update在线插件安装
activiti5一共23张表
Activiti的表都以ACT_开头。 第二部分是表示表的用途的两个字母标识。 用途也和服务的API对应。
ACT_RE_*: 'RE'表示repository。 这个前缀的表包含了流程定义和流程静态资源 (图片,规则,等等)。
A
- android的广播机制和广播的简单使用
百合不是茶
android广播机制广播的注册
Android广播机制简介 在Android中,有一些操作完成以后,会发送广播,比如说发出一条短信,或打出一个电话,如果某个程序接收了这个广播,就会做相应的处理。这个广播跟我们传统意义中的电台广播有些相似之处。之所以叫做广播,就是因为它只负责“说”而不管你“听不听”,也就是不管你接收方如何处理。另外,广播可以被不只一个应用程序所接收,当然也可能不被任何应
- Spring事务传播行为详解
bijian1013
javaspring事务传播行为
在service类前加上@Transactional,声明这个service所有方法需要事务管理。每一个业务方法开始时都会打开一个事务。
Spring默认情况下会对运行期例外(RunTimeException)进行事务回滚。这
- eidtplus operate
征客丶
eidtplus
开启列模式: Alt+C 鼠标选择 OR Alt+鼠标左键拖动
列模式替换或复制内容(多行):
右键-->格式-->填充所选内容-->选择相应操作
OR
Ctrl+Shift+V(复制多行数据,必须行数一致)
-------------------------------------------------------
- 【Kafka一】Kafka入门
bit1129
kafka
这篇文章来自Spark集成Kafka(http://bit1129.iteye.com/blog/2174765),这里把它单独取出来,作为Kafka的入门吧
下载Kafka
http://mirror.bit.edu.cn/apache/kafka/0.8.1.1/kafka_2.10-0.8.1.1.tgz
2.10表示Scala的版本,而0.8.1.1表示Kafka
- Spring 事务实现机制
BlueSkator
spring代理事务
Spring是以代理的方式实现对事务的管理。我们在Action中所使用的Service对象,其实是代理对象的实例,并不是我们所写的Service对象实例。既然是两个不同的对象,那为什么我们在Action中可以象使用Service对象一样的使用代理对象呢?为了说明问题,假设有个Service类叫AService,它的Spring事务代理类为AProxyService,AService实现了一个接口
- bootstrap源码学习与示例:bootstrap-dropdown(转帖)
BreakingBad
bootstrapdropdown
bootstrap-dropdown组件是个烂东西,我读后的整体感觉。
一个下拉开菜单的设计:
<ul class="nav pull-right">
<li id="fat-menu" class="dropdown">
- 读《研磨设计模式》-代码笔记-中介者模式-Mediator
bylijinnan
java设计模式
声明: 本文只为方便我个人查阅和理解,详细的分析以及源代码请移步 原作者的博客http://chjavach.iteye.com/
/*
* 中介者模式(Mediator):用一个中介对象来封装一系列的对象交互。
* 中介者使各对象不需要显式地相互引用,从而使其耦合松散,而且可以独立地改变它们之间的交互。
*
* 在我看来,Mediator模式是把多个对象(
- 常用代码记录
chenjunt3
UIExcelJ#
1、单据设置某行或某字段不能修改
//i是行号,"cash"是字段名称
getBillCardPanelWrapper().getBillCardPanel().getBillModel().setCellEditable(i, "cash", false);
//取得单据表体所有项用以上语句做循环就能设置整行了
getBillC
- 搜索引擎与工作流引擎
comsci
算法工作搜索引擎网络应用
最近在公司做和搜索有关的工作,(只是简单的应用开源工具集成到自己的产品中)工作流系统的进一步设计暂时放在一边了,偶然看到谷歌的研究员吴军写的数学之美系列中的搜索引擎与图论这篇文章中的介绍,我发现这样一个关系(仅仅是猜想)
-----搜索引擎和流程引擎的基础--都是图论,至少像在我在JWFD中引擎算法中用到的是自定义的广度优先
- oracle Health Monitor
daizj
oracleHealth Monitor
About Health Monitor
Beginning with Release 11g, Oracle Database includes a framework called Health Monitor for running diagnostic checks on the database.
About Health Monitor Checks
Health M
- JSON字符串转换为对象
dieslrae
javajson
作为前言,首先是要吐槽一下公司的脑残编译部署方式,web和core分开部署本来没什么问题,但是这丫居然不把json的包作为基础包而作为web的包,导致了core端不能使用,而且我们的core是可以当web来用的(不要在意这些细节),所以在core中处理json串就是个问题.没办法,跟编译那帮人也扯不清楚,只有自己写json的解析了.
- C语言学习八结构体,综合应用,学生管理系统
dcj3sjt126com
C语言
实现功能的代码:
# include <stdio.h>
# include <malloc.h>
struct Student
{
int age;
float score;
char name[100];
};
int main(void)
{
int len;
struct Student * pArr;
int i,
- vagrant学习笔记
dcj3sjt126com
vagrant
想了解多主机是如何定义和使用的, 所以又学习了一遍vagrant
1. vagrant virtualbox 下载安装
https://www.vagrantup.com/downloads.html
https://www.virtualbox.org/wiki/Downloads
查看安装在命令行输入vagrant
2.
- 14.性能优化-优化-软件配置优化
frank1234
软件配置性能优化
1.Tomcat线程池
修改tomcat的server.xml文件:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" maxThreads="1200" m
- 一个不错的shell 脚本教程 入门级
HarborChung
linuxshell
一个不错的shell 脚本教程 入门级
建立一个脚本 Linux中有好多中不同的shell,但是通常我们使用bash (bourne again shell) 进行shell编程,因为bash是免费的并且很容易使用。所以在本文中笔者所提供的脚本都是使用bash(但是在大多数情况下,这些脚本同样可以在 bash的大姐,bourne shell中运行)。 如同其他语言一样
- Spring4新特性——核心容器的其他改进
jinnianshilongnian
spring动态代理spring4依赖注入
Spring4新特性——泛型限定式依赖注入
Spring4新特性——核心容器的其他改进
Spring4新特性——Web开发的增强
Spring4新特性——集成Bean Validation 1.1(JSR-349)到SpringMVC
Spring4新特性——Groovy Bean定义DSL
Spring4新特性——更好的Java泛型操作API
Spring4新
- Linux设置tomcat开机启动
liuxingguome
tomcatlinux开机自启动
执行命令sudo gedit /etc/init.d/tomcat6
然后把以下英文部分复制过去。(注意第一句#!/bin/sh如果不写,就不是一个shell文件。然后将对应的jdk和tomcat换成你自己的目录就行了。
#!/bin/bash
#
# /etc/rc.d/init.d/tomcat
# init script for tomcat precesses
- 第13章 Ajax进阶(下)
onestopweb
Ajax
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/
- Troubleshooting Crystal Reports off BW
blueoxygen
BO
http://wiki.sdn.sap.com/wiki/display/BOBJ/Troubleshooting+Crystal+Reports+off+BW#TroubleshootingCrystalReportsoffBW-TracingBOE
Quite useful, especially this part:
SAP BW connectivity
For t
- Java开发熟手该当心的11个错误
tomcat_oracle
javajvm多线程单元测试
#1、不在属性文件或XML文件中外化配置属性。比如,没有把批处理使用的线程数设置成可在属性文件中配置。你的批处理程序无论在DEV环境中,还是UAT(用户验收
测试)环境中,都可以顺畅无阻地运行,但是一旦部署在PROD 上,把它作为多线程程序处理更大的数据集时,就会抛出IOException,原因可能是JDBC驱动版本不同,也可能是#2中讨论的问题。如果线程数目 可以在属性文件中配置,那么使它成为
- 正则表达式大全
yang852220741
html编程正则表达式
今天向大家分享正则表达式大全,它可以大提高你的工作效率
正则表达式也可以被当作是一门语言,当你学习一门新的编程语言的时候,他们是一个小的子语言。初看时觉得它没有任何的意义,但是很多时候,你不得不阅读一些教程,或文章来理解这些简单的描述模式。
一、校验数字的表达式
数字:^[0-9]*$
n位的数字:^\d{n}$
至少n位的数字:^\d{n,}$
m-n位的数字:^\d{m,n}$