我有这样的事情:
public class Foo {
public String id;
}
Run Code Online (Sandbox Code Playgroud)
和
Vector<Foo> foos;
Run Code Online (Sandbox Code Playgroud)
我需要通过id从集合中获取一个对象.
在C#中我会这样做: foos.Where(o => o.id = 7)
在Java中最好的方法是什么?
我注意到,当我对某些文件进行更改然后输入make时,它将运行与这些文件相关的某些命令.如果我没有改变任何东西,那么make不做任何事情,说该程序是最新的.这告诉我make有一种方法可以知道自上次运行以来哪些文件已被更改.怎么知道的?它似乎没有在运行它的目录中放置任何内容,因此它必须将此信息存储在其他位置.
从http://php.net/manual/en/function.mcrypt-encrypt.php,我看到以下代码使用AES和ECB模式下的IV,
<?php
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$key = "This is a very secret key";
$text = "Meet me at 11 o'clock behind the monument.";
echo strlen($text) . "\n";
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
echo strlen($crypttext) . "\n";
?>
Run Code Online (Sandbox Code Playgroud)
但是从维基http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation,它说欧洲央行不需要IV.是否真的可以在ECB模式下使用带有IV的AES?在这种ECB模式下,与不使用时相比,额外的IV是否会提供更多的安全性?
不确定之前是否曾经问过,做了一些挖掘.我正在尝试为几次采访做准备,我只是好奇地看看Java是如何实现其数据结构(arraylist,map)等是公开的.
是否有一个64位预览编译器,如很久以前宣布的那样?我找不到任何东西.
我真的需要一个64位编译器来定位64位版本的Microsoft Office.
下面的壳股代息将检查磁盘空间和变量更改diskfull
到1
,如果使用率超过10%,最后的回音总是显示0
我试过global diskfull=1
了,如果条款中,但没有奏效.1
如果磁盘消耗超过10%,如何将变量更改为?
#!/bin/sh
diskfull=0
ALERT=10
df -HP | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
#echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $ALERT ]; then
diskfull=1
exit
fi
done
echo $diskfull
Run Code Online (Sandbox Code Playgroud) 我需要生成这个简单的XML,寻找一种简洁的方法来生成它.
<order>
<user>2343></user>
<creditcardtype>2333></creditcarttype>
<country>USA</country>
<orderDetails>
<amount>23434</amount>
<shipping>32</shipping>
</orderDetails>
</order>
Run Code Online (Sandbox Code Playgroud) 我正在遵循将a绑定MenuItem
到数据对象的示例.
<Menu Grid.Row="0" KeyboardNavigation.TabNavigation="Cycle"
ItemsSource="{Binding Path=MenuCommands}">
<Menu.ItemContainerStyle>
<Style>
<Setter Property="MenuItem.Header" Value="{Binding Path=DisplayName}"/>
<Setter Property="MenuItem.ItemsSource" Value="{Binding Path=Commands}"/>
<Setter Property="MenuItem.Command" Value="{Binding Path=Command}"/>
<Setter Property="MenuItem.Icon" Value="{Binding Path=Icon}"/>
</Style>
</Menu.ItemContainerStyle>
</Menu>
Run Code Online (Sandbox Code Playgroud)
这一切都在游泳,除了MenuItem
图标显示为字符串System.Drawing.Bitmap
.有问题的位图由数据对象从已编译的资源返回.
internal static System.Drawing.Bitmap folder_page
{
get
{
object obj = ResourceManager.GetObject("folder_page", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
如下所示,我可以通过两种简单的方式制作流式复印机(介绍Apache Commons或类似的).我应该选择哪一个,为什么?
public class StreamCopier {
private int bufferSize;
public StreamCopier() {
this(4096);
}
public StreamCopier(int bufferSize) {
this.bufferSize = bufferSize;
}
public long copy(InputStream in , OutputStream out ) throws IOException{
byte[] buffer = new byte[bufferSize];
int bytesRead;
long totalBytes = 0;
while((bytesRead= in.read(buffer)) != -1) {
out.write(buffer,0,bytesRead);
totalBytes += bytesRead;
}
return totalBytes;
}
}
Run Code Online (Sandbox Code Playgroud)
VS
public class StreamCopier {
public static long copy(InputStream in , OutputStream out)
throws IOException {
return this.copy(in,out,4096);
}
public static long copy(InputStream …
Run Code Online (Sandbox Code Playgroud) 是否可以将函数指针作为参数传递给C中的函数?
如果是这样,我将如何声明和定义一个以函数指针作为参数的函数?
java ×3
c ×2
64-bit ×1
asp.net ×1
c# ×1
collections ×1
compilation ×1
cryptography ×1
data-binding ×1
delphi ×1
delphi-2010 ×1
encryption ×1
gcc ×1
icons ×1
makefile ×1
menuitem ×1
mvvm ×1
php ×1
pipe ×1
shell ×1
wpf ×1
xml ×1