开发遇到的一些问题

1.在设置listView的item的时候,根布局设置

android:layout_height="match_parent" 
android:minHeight=""

参数。解决计算高度不正确的错误。

2.去掉滑块:

android:scrollbars="none" 

去除分割线

android:divider="@null" 

去掉滑动阴影

android:overScrollMode="never" 

设置分割线宽度

android:dividerHeight="2dp"

3.mac安装homebrew

在MAC上安装homebrew事先博客进行安装,根据步骤进行下去,同样在brew update的时候出现报错:

Error: /usr/local must be writable! 

错误,在该文章中也给出解决办法

(sudo chown -R $(whoami) /usr/local)

,但是这种方法对于高版本的OS来说,是解决不了的,会报

chown: /usr/local: Operation not permitted

错误。

后来在https://stackoverflow.com/questions/46459152/cant-chown-usr-local-for-homebrew-in-osx-10-13-high-sierra网页上给出了解决办法,下面简单总结一下:

先卸载已安装的homebrew,命令如下:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

然后重新安装:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

通过该方法直接获取最新的homebrew,出现预期效果。

4.jenkins

命令行启动tomcat,cd进入bin目录下 :

开启 tomcat

sudo sh startup.sh

关闭 tomcat

 sudo sh shutdown.sh

修改jenkins的端口

sudo defaults write /Library/Preferences/org.jenkins-ci httpPort 7070

jenkins关闭

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

jenkins开启

sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist 

打开Mac全局配置文件

5.mac连接夜神模拟器的时候连接不上

adb connect 127.0.0.1:62001

open -e .bash_profile

 The capture session could not be initiated on interface 'en0' (You don't have ...)  

一般都是需要开启网卡 命令如下

 sudo chmod 777 /dev/bpf* 

打开Terminal 执行完毕之后,就可以抓包了

mysql for mac   无法启动 sudo chown -R mysql /usr/local/mysql/data

  启动MySQL服务

sudo /usr/local/mysql/support-files/mysql.server start

停止MySQL服务

sudo /usr/local/mysql/support-files/mysql.server stop

重启MySQL服务

sudo /usr/local/mysql/support-files/mysql.server restart

android制作JitPack依赖的时候一定不少少上传【例如:gradlew.bat】

 

    在一次项目的Github提交中不小心把一个不需要的文件夹提交了上去,而此时在写.gitignored已经为时已晚,为了解决这一问题,经查阅多方资料后得出以下解决办法:

        Github在提交了之后无法在线删除文件夹,但是在本地Git库中却可以,只要在Git库中删除了仓库对应缓存,再push到Github服务器,文件夹的删除目的就达成了,

        以下是具体操作:

$ git rm -r --cached 目录名
$ git commit -m '描述'
$ git push -u origin master

查询使用某端口的进程

执行下述终端命令

// 将PortNum替换为要查询的端口号(注意端口号前面不要空格)
sudo lsof -i :PortNum

// 举个例子
sudo lsof -i :8100

// 当然也可以不用管理员权限
lsof -i :8100

查询结果如图,各项参数的含义:
command 使用改端口的进程名称
PID 进程号
(LISTEN) 代表该进程在监听中,即活跃状态

终端显示结果

 

根据端口号关闭进程

执行下述命令:

// 将PID替换为相应的进程号
sudo kill -9 PID

// 举个例子
sudo kill -9 8100

// 当然也可以不用管理员权限
kill -9 PID

https://jingyan.baidu.com/article/adc815137a9cfff723bf73f9.html

 

问题描述:win10安装Git x64,出现unable to set system config "http.sslBackend":="openssl":exit code 128的错误。在启动 Git Bash here时出现闪现。



进入高级启动模式(非常规电脑重启)按“7”强制性关闭数字签证即可解决。

Win10怎么禁用驱动程序强制签名:

win->设置->更新和安全->恢复->立即重新启动->疑难问题->高级选项->重启设置->启动->键盘键入7,选择“禁止驱动程序强制签名”。

操作过程中出现过一次蓝屏,手动重启,并选择以安全模式打开。
首先要明确一点,对git的操作是围绕3个大的步骤来展开的(其实几乎所有的SCM都是这样)

1.     从git取数据(git clone)

2.     改动代码

3.     将改动传回git(git push)

这3个步骤又涉及到两个repository,一个是remote repository,再远程服务器上,一个是local repository,再自己工作区上。其中

1, 3两个步骤涉及到remote server/remote repository/remote branch,

2涉及到local repository/local branch。git clone 会根据你指定的remote server/repository/branch,拷贝一个副本到你本地,再git push之前,你对所有文件的改动都是在你自己本地的local repository来做的,你的改动(local branch)和remote branch是独立(并行)的。Gitk显示的就是local repository。

在clone完成之后,Git 会自动为你将此远程仓库命名为origin(origin只相当于一个别名,运行git remote –v或者查看.git/config可以看到origin的含义),并下载其中所有的数据,建立一个指向它的master 分支的指针,我们用(远程仓库名)/(分支名) 这样的形式表示远程分支,所以origin/master指向的是一个remote branch(从那个branch我们clone数据到本地),但你无法在本地更改其数据。

同时,Git 会建立一个属于你自己的本地master 分支,它指向的是你刚刚从remote server传到你本地的副本。随着你不断的改动文件,git add, git commit,master的指向会自动移动,你也可以通过merge(fast forward)来移动master的指向。

$git branch -a (to show all the branches git knows about)

* master

remotes/origin/HEAD -> origin/master

remotes/origin/master

$git branch -r (to show remote branches git knows about)

origin/HEAD -> origin/master

origin/master

可以发现,master就是local branch,origin/master是remote branch(master is a branch in the local repository. remotes/origin/master is a branch named master on the remote named origin)

$git diff origin/master master (show me the changes between the remote master branch and my master branch).

需要注意的是,remotes/origin/master和origin/master的指向是相同的

$git diff origin/master remotes/origin/master

git push origin master

origin指定了你要push到哪个remote

master其实是一个“refspec”,正常的“refspec”的形式为”+<src>:<dst>”,冒号前表示local branch的名字,冒号后表示remote repository下 branch的名字。注意,如果你省略了<dst>,git就认为你想push到remote repository下和local branch相同名字的branch。听起来有点拗口,再解释下,push是怎么个push法,就是把本地branch指向的commit push到remote repository下的branch,比如

$git push origin master:master (在local repository中找到名字为master的branch,使用它去更新remote repository下名字为master的branch,如果remote repository下不存在名字是master的branch,那么新建一个)

$git push origin master (省略了<dst>,等价于“git push origin master:master”)

$git push origin master:refs/for/mybranch (在local repository中找到名字为master的branch,用他去更新remote repository下面名字为mybranch的branch)

$git push origin HEAD:refs/for/mybranch (HEAD指向当前工作的branch,master不一定指向当前工作的branch,所以我觉得用HEAD还比master好些)

$git push origin :mybranch (再origin repository里面查找mybranch,删除它。用一个空的去更新它,就相当于删除了)

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值