如果我有这样的代码 -
long x;
x = 0xFFFFFFFFL;
Run Code Online (Sandbox Code Playgroud)
如果我在32位机器上运行此代码,它是否保证是原子的,或者读取x的不同线程是否可能获得不完整/垃圾值?
我试图获得一个图像(动态放置,对尺寸没有限制)与其父div一样宽,但只要该宽度不宽于100%的宽度.我试过这个,但无济于事:
img {
width: 100%;
height: auto;
max-width: 100%;
}
Run Code Online (Sandbox Code Playgroud)
这些图像中的许多图像比它们的父图像宽,这就是为什么我希望它们相应地调整大小,但是当一个小图像在那里弹出并且缩小到超出其正常尺寸时,它看起来真的很糟糕.有没有办法做到这一点?
我现在有一个与Akamai的ftp目录,我需要尽快上传图像(可能每天超过100万)
将本地文件同步到ftp站点的最快方法是什么?
谢谢
我正在使用Swing GUI在Java中构建一个Tic Tac Toe游戏,它在Ubuntu 10.4和Windows XP中正确呈现.这就是它在Ubuntu中的样子:
当我使用所有类文件复制bin文件夹并尝试在Windows 7中运行该程序时,它看起来像这样:
img413.imageshack.us/img413/6144/tictactoe1.gif http://img413.imageshack.us/img413/6144/tictactoe1.gif
img708.imageshack.us/img708/4387/tictactoe2.gif http://img708.imageshack页面没有自动跳转/ img708/4387/tictactoe2.gif
我只是无法理解什么是错的.正如我所说,它在Ubuntu 10.4和Windows XP中运行良好.
如果有人可以帮助我,我会很高兴的!我将发布与GUI相关的代码,以防万一需要解决问题.
这是我用来初始化GUI的代码:
//Initializing GUI.
frame = new JFrame(); //Creating the window.
frame.setTitle("Tic Tac Toe"); //Setting the title of the window.
frame.addMouseListener(this);
frame.getContentPane().add(BorderLayout.CENTER, grid.getPanel()); //Adding the grid panel.
info = new JLabel(" Initializing game..."); //Creating info text.
frame.getContentPane().add(BorderLayout.SOUTH, info); //Adding info text.
//Setting GUI properties.
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 300);
frame.setVisible(true);
Run Code Online (Sandbox Code Playgroud)
具有网格本身的面板在我的GameGrid类中创建,其具有方法"JPanel getPanel()".这是该面板的初始化(代码属于GameGrid的构造函数):
GridBox temp;
layout = new GridLayout(getHeight(), getWidth());
panel = new JPanel(layout);
panel.setBorder( …Run Code Online (Sandbox Code Playgroud) @protocol Runnable
- (id<Runnable>) works; //this compiles fine
- (Runnable *) broke; // get a compile error saying Expected ')' before 'Runnable'
@end
Run Code Online (Sandbox Code Playgroud)
我不确定我理解为什么xCode抱怨这- (Runnable *) broke;条线
我正在创建一个具有文件名字段,上传文件字段和选择的应用程序.让我说我有这样的选择
<select name="menu">
<option value="0" selected> select imp </option>
<option value="1"> imp 1 </option>
<option value="2"> imp 2 </option>
<option value="3"> imp 3 </option>
<option value="4"> imp 4 </option>
</select>
<input type="submit" value="Upload" />
Run Code Online (Sandbox Code Playgroud)
我有文件上传与这个类一起工作
class UploadFileForm(forms.Form):
title = forms.CharField(max_length=50)
file = forms.FileField(widget=forms.FileInput())
Run Code Online (Sandbox Code Playgroud)
该类应该如何添加选择?或者我如何使用文件上传表单并从select中获取值,并根据该值执行操作?
我希望将我的网页标题设置为Ultan.me - 无论帖子标题是什么.我希望它显示帖子标题.帖子被提交到MySQL数据库,标题行被称为"标题".这个小问题对任何帮助表示赞赏.
更新:
这是页面本身,但它不显示标题.我应该打开php文档并连接到我的数据库与其当前位置不同的地方吗?
守则(唯一必要的部分是开头):
<html>
<head>
<meta name="keywords" content="Mac user Ultan Casey TheCompuGeeks UltanKC">
<title>Ultan.me - <?echo $title;?></title>
<link rel="stylesheet" href="css/styles.css" type="text/css" />
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript"
src="js/jquery.labelify.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(":text").labelify();
});
</script>
<style>
a {text-decoration:none}
</style>
</head>
<body>
<div id="main">
<!-- Menu Start -->
<div id="menu">
<ul>
<li><a href="index.php">home</a></li>
<li><a href="index.php">about me</a></li>
<li><a href="index.php">archives</a></li>
<li><a href="index.php">contact</a></li>
<li><a href="index.php">gallery</a></li>
</ul>
</div>
<!-- Menu End -->
<img src="images/banner.png" />
<div id="content">
<div id="posts">
<?php
mysql_connect ('localhost', …Run Code Online (Sandbox Code Playgroud) 如何确定REST Web服务是使用Basic,Kerberos,NTLM还是其他许多身份验证方法之一?
至少对我来说很有趣......
说我有两张桌子:
myLookUpTable:
lookupId | Name
-------- -----
1 Red
2 Green
3 Blue
Run Code Online (Sandbox Code Playgroud)
和InfoTable:
infoId lookupId Amount ParentId
------ -------- ------ --------
1 1 2 332
2 3 14 332
Run Code Online (Sandbox Code Playgroud)
我如何编写一个返回每一行的查询,myLookUpTable并包含来自InfoTable的相关信息(如果某个ParentId存在)?
例:
查询parentId的221将返回以下的Name和Amount:
Name Amount
---- ------
Red
Green
Blue
Run Code Online (Sandbox Code Playgroud)
和查询parentId的332将返回以下的Name和Amount:
Name Amount
---- ------
Red 2
Green
Blue 14
Run Code Online (Sandbox Code Playgroud)
我尝试了左边连接的十种变化而没有运气.以下是我的最新消息:
SELECT mlut.Name, it.Amount
FROM myLookUpTable as mlut
LEFT JOIN InfoTable as it
ON mlut.lookupId = it.lookUpId OR it.ParentId …Run Code Online (Sandbox Code Playgroud) java ×2
akamai ×1
c# ×1
combobox ×1
concurrency ×1
css ×1
django ×1
forms ×1
ftp ×1
generic-list ×1
html ×1
object ×1
objective-c ×1
performance ×1
php ×1
python ×1
queue ×1
sql ×1
sql-server ×1
swing ×1
t-sql ×1
title ×1
width ×1
windows ×1
xcode ×1