我正在使用Jekyll构建我的个人网站并在github-pages上托管它.我想有一个密码保护区(只是密码保护目录,而不是整个网站).我尝试了一些选项和技巧来开始htaccess工作但失败了.
我想知道是否有人设法使用htaccess或任何其他方法来保护github页面上的目录.
列出对我不起作用的解决方案(或者我没有让它们工作):
*Flohei.
*Jeremy Ricketts.
我有一个简单的应用程序,我使用几个属性文件来获取其他用户编辑的内容(链接到网站等).
我加载属性的类看起来像这样:
@Configuration
@PropertySource("classpath:salestipsWhitelist.properties")
public class SalestipsWhitelist {
@Autowired
Environment env;
public Environment getEnv() {
return env;
}
public void setEnv(Environment env) {
this.env = env;
}
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}
}
Run Code Online (Sandbox Code Playgroud)
一些属性文件:
UPS_MPP_M_L=True
UPS_MPP_M_M=True
UPS_MPP_M_MP=True
UPS_MPP_M_S=True
Run Code Online (Sandbox Code Playgroud)
这工作正常,但如果我对属性文件进行更改,我必须重新加载应用程序以可视化所做的任何更改.
如果我将位置移动到磁盘而不是类路径,是否有可能定期或手动重新加载?我不希望在更改时自动完成此操作,因为我想控制何时完成/更新.
我不喜欢自动格式弄乱空循环体,如:
for (int i = 0; isTest(i); i++);
Run Code Online (Sandbox Code Playgroud)
for (int i = 0; isTest(i); i++)
;
Run Code Online (Sandbox Code Playgroud)
如何配置eclipse不要这样做?
我正在尝试将以下项目从IBM developerWorks部署到Bluemix:
使用Watson和Cloudant在IBM Bluemix上构建Java EE应用程序
通过Eclipse中的Bluemix插件(称为:IBM Eclipse Tools for Bluemix).但是我一直收到以下错误
项目方面不支持Cloud Foundry Standalone Application 1.0版
使用版本:
通过Cloud Foundry CLI执行此操作时没有问题 cf push
我打算将GCM纳入我的应用程序,现在我不知道它是否需要在隐私政策中.我在哪里可以为游戏商店的应用程序获得良好的隐私政策?是否有任何隐私政策创作者或类似的东西?
我正在寻找一种方法来解压缩.rar使用Java的文件,我在哪里搜索我最终使用相同的工具 - JavaUnRar.我一直在寻找解压缩.rar文件,但我似乎发现这样做的所有方式都很长很尴尬,就像在这个例子中
我目前能够提取.tar,.tar.gz,.zip和.jar文件在20行代码或更少所以要有提取一个简单的方法.rar的文件,没有任何人知道?
如果它帮助任何人这是我用来提取.zip和.jar文件的代码,它适用于两者
public void getZipFiles(String zipFile, String destFolder) throws IOException {
BufferedOutputStream dest = null;
ZipInputStream zis = new ZipInputStream(
new BufferedInputStream(
new FileInputStream(zipFile)));
ZipEntry entry;
while (( entry = zis.getNextEntry() ) != null) {
System.out.println( "Extracting: " + entry.getName() );
int count;
byte data[] = new byte[BUFFER];
if (entry.isDirectory()) {
new File( destFolder + "/" + …Run Code Online (Sandbox Code Playgroud) 我有一个HTML列表.浏览器应该看到列表的存在并相应地排列元素,但是我不希望它在每个元素旁边显示一个子弹.也就是说,正常列表如下所示:
- 文字A.
- 文字B.
- 文字C.
我希望我的列表看起来像这样:
文本
文本乙
文C
我正在尝试读取每行包含英文和阿拉伯字符的文件以及每行包含英文和中文字符的另一个文件.然而,阿拉伯文和中文的字符无法正确显示 - 它们只是作为问号出现.知道如何解决这个问题吗?
这是我用于阅读的代码:
try {
String sCurrentLine;
BufferedReader br = new BufferedReader(new FileReader(directionOfTargetFile));
int counter = 0;
while ((sCurrentLine = br.readLine()) != null) {
String lineFixedHolder = converter.fixParsedParagraph(sCurrentLine);
System.out.println("The line number "+ counter
+ " contain : " + sCurrentLine);
counter++;
}
}
Run Code Online (Sandbox Code Playgroud)
第01版
在读完该行并获得阿拉伯语和中文单词后,我使用一个函数来翻译它们,只需在ArrayList中搜索给定的阿拉伯语文本(包含所有预期的单词)(使用indexOf();方法).然后当找到单词的索引时,它用于调用在另一个Arraylist中具有相同索引的英语单词.但是,此搜索始终返回false,因为它在搜索问号而不是阿拉伯语和中文字符时失败.所以我的System.out.println打印显示空值,每个转换失败一个.
*我使用的是Netbeans 6.8 Mac版IDE
第02版
这是搜索翻译的代码:
int testColor = dbColorArb.indexOf(wordToTranslate);
int testBrand = -1;
if ( testColor != -1 ) {
String result = (String)dbColorEng.get(testColor);
return result;
} else {
testBrand = dbBrandArb.indexOf(wordToTranslate); …Run Code Online (Sandbox Code Playgroud) 异步JMS(Java消息服务)使用者与实际MDB(消息驱动Bean)之间是否存在任何差异.我看到的唯一区别是MDB类具有@MessageDriven异步JMS使用者没有的注释.
还有我遗失的其他东西?
我的代码出现以下Findbugs错误,
Invocation of toString on <<Package Path>>
The code invokes toString on an array, which will generate a fairly useless
result such as [C@16f0472. Consider using Arrays.toString to convert the
array into a readable String that gives the contents of the array.
See Programming Puzzlers, chapter 3, puzzle 12.
Run Code Online (Sandbox Code Playgroud)
码:
logger.info("Adding information"+ Employee.getName()+ " "+
employeeForm.getQuestionAndAnswers());
Run Code Online (Sandbox Code Playgroud)
请让我知道错误是什么.
java ×5
eclipse ×2
android ×1
annotations ×1
arabic ×1
arrays ×1
css ×1
ejb ×1
encoding ×1
extract ×1
findbugs ×1
github-pages ×1
google-play ×1
html ×1
html-lists ×1
ibm-cloud ×1
java-ee ×1
java-ee-5 ×1
jekyll ×1
jms ×1
properties ×1
rar ×1
spring ×1
tostring ×1
utf-8 ×1