程序设计

专业和发烧友程序员的问答

15
无法在Android Studio中加载未知错误的AppCompat ActionBar
以下是我的xml文件。在预览中,有两个错误“无法加载具有未知错误的AppCompat ActionBar”和“无法实例化多个类”。如何运行该应用程序。但是该应用程序崩溃了,并且在Logcat中未显示任何错误。 这是我的预览屏幕截图 <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:openDrawer="start"> <include layout="@layout/app_bar_main" android:layout_width="match_parent" android:layout_height="506dp" /> <LinearLayout android:id="@+id/layout_main" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:weightSum="1" tools:context=".Activity.MainActivity"> <LinearLayout android:id="@+id/main_layout" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="0.7" tools:context=".Activity.MainActivity"> <!-- our tablayout to display tabs --> <android.support.design.widget.TabLayout android:id="@+id/tabLayout" android:layout_width="match_parent" …

7
在Android Studio中更改作者模板
我想更改在AndroidStudio中创建文件时出现的自动作者。 /** * Created by a556520 on 16/01/14. */ public class POI { 作者的名字是“ a556520”,但我希望显示我的名字,而不是雇员人数。那可能吗?我在设置中找不到。

13
如何关闭mysql密码验证?
看来我可能无意中在MySQL 5.7中加载了密码验证插件。这个插件似乎强制所有密码遵守某些规则。 我想关闭此功能。 我尝试按照这里的建议将validate_password_length变量更改为无效。 mysql> SET GLOBAL validate_password_length=4; Query OK, 0 rows affected (0.00 sec) mysql> SET PASSWORD FOR 'app' = PASSWORD('abcd'); ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 我想卸载插件或以某种方式中和它。
153 mysql 

6
我们可以设置一个Git默认值以在远程请求期间获取所有标签吗?
我目前有一个git远程设置,如下所示: [remote "upstream"] url = <redacted> fetch = +refs/heads/*:refs/remotes/upstream/* 当我git pull在分支主服务器上发布时,所有远程头都被提取到远程服务器/上游服务器中,然后将远程服务器/上游/主机合并到主服务器中。可以同时获取所有可以到达的标签,这非常方便。 我还想从遥控器上git pull获取所有标签,而不仅仅是从头部直接访问的标签。我最初尝试设置tagopt == --tags,但是发现这只会导致标签被获取,从而破坏了一切。(Junio甚至说这是一个可怕的错误配置)。 git pull除了远程头以外,是否有办法默认获取所有远程标签?
153 git 


27
Git:权限被拒绝(公钥)是致命的-无法从远程存储库读取。在克隆Git存储库时
我无法克隆Git存储库,并出现以下错误: krishna.soni@KRISHNACHANDRAS /c/Projects $ git clone http://stage.abc.com:10088/pqr http://<url>/<repository> Cloning into '<repository>'... fatal: could not read Username for 'http://<url>': No such file or directory 我已经阅读了Bitbucket,Windows和“致命的:无法读取密码”,但是仍然有问题。 我继续进行,但现在收到此错误 sh.exe": chown: command not found krishna.soni@KRISHNACHANDRAS /c $ git clone ssh://krishna.sonipayu.in@stage.payupaisa. /projects Cloning into 'C:/projects'... Permission denied (publickey). fatal: Could not read from remote repository. …
153 git  git-clone 

10
如何从Mvc中的控制器调用另一个控制器操作
我需要从控制器A调用控制器B动作FileUploadMsgView,并需要为其传递参数。 Code---its not going to the controller B's FileUploadMsgView(). In ControllerA private void Test() { try {//some codes here ViewBag.FileUploadMsg = "File uploaded successfully."; ViewBag.FileUploadFlag = "2"; RedirectToAction("B", "FileUploadMsgView", new { FileUploadMsg = "File uploaded successfully" }); } In ControllerB receiving part public ActionResult FileUploadMsgView(string FileUploadMsg) { return View(); }

10
中心HTML输入文本字段占位符
如何以html形式居中输入字段的占位符对齐方式? 我正在使用以下代码,但是它不起作用: CSS-> input.placeholder { text-align: center; } .emailField { top:413px; right:290px; width: 355px; height: 30px; position: absolute; border: none; font-size: 17; text-align: center; } HTML-> <form action="" method="POST"> <input type="text" class="emailField" placeholder="support@socialpic.org" style="text-align: center" name="email" /> <!<input type="submit" value="submit" /> </form>
153 html  css 

13
如何从Java Servlet返回JSON对象
如何从Java servlet返回JSON对象。 以前,当使用servlet执行AJAX时,我返回了一个字符串。是否有需要使用的JSON对象类型,或者您只是返回了一个看起来像JSON对象的String,例如 String objectToReturn = "{ key1: 'value1', key2: 'value2' }";
153 java  json  servlets 

4
Java当前的计算机名和登录用户?
是否可以获取当前登录用户的名称(Windows / Unix)和计算机的主机名? 我认为这只是某些静态环境类的属性。 我已经找到该用户名了 com.sun.security.auth.module.NTSystem NTSystem = new com.sun.security.auth.module.NTSystem(); System.out.println(NTSystem.getName()); 这是机器名称: import java.net.InetAddress; ... String computerName; ... try { computerName = InetAddress.getLocalHost().getHostName(); } catch(Exception ex) { ... } 第一个仅用于Windows吗? 如果您没有设置主机名,第二个将做什么?
153 java  environment 

4
单击选项卡时出现shell初始化问题,getcwd怎么了?
单击bash上的Tab后,将出现错误消息,这是怎么回事? symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: Success symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: Success symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: Success symlink-hook: …
153 linux  bash  shell  pwd  getcwd 

6
为什么不能用LR(1)解析器解析C ++?
我正在阅读有关解析器和解析器生成器的信息,并在Wikipedia的LR解析页面中找到以下语句: 可以使用LR解析器的某些变体来解析许多编程语言。C ++是一个值得注意的例外。 为什么会这样呢?C ++的哪些特殊属性导致无法使用LR解析器进行解析? 使用谷歌,我只发现C可以用LR(1)完美解析,但是C ++需要LR(∞)。


4
用远程分支覆盖我的本地分支
我已经完全取消了我的本地分支机构,并希望重新开始。服务器上的版本正确。 我不想从头开始,我想利用自己的本地历史来修复我的庞大问题。(如果需要,我可以。) git fetch branchname,并且git pull branchname不起作用。我收到的消息是“ 最新的 ”,但是,我的本地版本与服务器的版本不匹配。 git pull origin/branchname给我一个“ 找不到 ”错误。
153 git 

22
在Visual Studio 2010中“无法评估表达式,因为当前方法的代码已优化”
我在调试模式下使用Visual Studio 2010,并且未选中“优化代码”。我无法快速查看(或将鼠标悬停在调试器中)任何变量。我收到此错误“由于当前方法的代码已优化,无法评估表达式”。 即使是这样的行:int i = -3,对i进行快速监视,我也会得到“无法获取本地或参数'i'的值,因为该指令指针处不存在它,可能是因为它已经被优化了。” 在类似问题中引用的此链接似乎不适用。 有我缺少的设置吗?

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.