我正在使用arrayCollection字符串填充dropDownList.我希望下拉列表控件的宽度与数组集合中最长字符串的大小(以像素为单位)匹配.我面临的问题是:集合中字符串的字体宽度不同,例如'W'看起来比'l'宽.所以我估计一个字符的宽度为8像素,但这不是很整洁.如果遇到具有许多"W"和"M"的字符串,则估计是错误的.所以我想要精确的字符串像素宽度.如何获得字符串的确切长度(以像素为单位)?
我的解决方案是将所有字符估计为8像素宽,如下所示:
public function populateDropDownList():void{
var array:Array = new Array("o","two","three four five six seven eight wwww");
var sampleArrayCollection:ArrayCollection = new ArrayCollection(array);
var customDropDownList:DropDownList = new DropDownList();
customDropDownList.dataProvider=sampleArrayCollection;
customDropDownList.prompt="Select ...";
customDropDownList.labelField="Answer Options:";
//calculating the max width
var componentWidth=10; //default
for each(var answerText in array){
Alert.show("Txt size: "+ answerText.length + " pixels: " + answerText.length*9);
if(answerText.length * 8 > componentWidth){
componentWidth=answerText.length * 8;
}
}
customDropDownList.width=componentWidth;
answers.addChild(customDropDownList);
}
Run Code Online (Sandbox Code Playgroud)
任何想法或解决方案都很受重视.
谢谢
我们有一个叫做分支upgrade这是分出master5个月前.在upgrade分支中,我们将所有项目重组为maven(master是蚂蚁项目),因此两个分支中项目x的结构完全不同.
为了将项目重组为我们使用的专家git mv,我们保留了历史.接下来,我们对文件进行了一些代码更改,upgrade因为升级过程需要这些更改.
现在我想合并master到upgrade同时保留所有结构upgrade.我该怎么做呢?
我git merge master在upgrade分支上尝试使用.
但这并没有让我对我们所做的代码更改产生任何冲突upgrade; 相反,它给了我属性文件中的冲突.(我肯定肯定代码更改与upgrade此冲突master) - 可能是什么错误?
案例: 我有一个组织对象.它有一个Department Objects列表,每个Department都有一个Employee Objects列表.
在JSP中,我有一个复选框列表,它将一个复选框绑定到一个雇员对象(深层次的2个层次结构.即Organization-> Department-> Employee).
<input type="checkbox" name="adminDepartmentList[${status.index}].employeeList" value="${employee.firstName}"> <c:out value="${employee.firstName}" /><br>
Run Code Online (Sandbox Code Playgroud)
如你看到的:
adminDepartmentList[0].employeeList --> John
adminDepartmentList[2].employeeList --> Rose
Run Code Online (Sandbox Code Playgroud)
绑定很好.提交表单后,在控制器中,我可以遍历admin departmentList并查找创建的所有部门,并查找由于复选框选择而创建的员工.
问题:(部门是使用空名称和非null employeeList创建的.我找不到employeeList所属部门的名称:(那么如何传递一些部门名称,以便将名称注入部门(如正在创建)就像".employeeList"被注入部门一样.
细节: 为您提供我的工作细节:
Organization类有两个Departments列表.Department类有一个Employees列表.员工有姓名和小时工作.
public class Organization{
private long id;
private String name;
private List<Department> adminDepartmentList; //n admin departments
private List<Department> employeeDepartmentList //m employee departments
// default constructor and all getters and setters
}
public class Department{
private long id;
private String name;
private List<Employee> employeeList; //k employees
//default constructor and all getters and setters …Run Code Online (Sandbox Code Playgroud) 我正在尝试将类似层次结构的树(数据来自json)保存到我的数据库中.我正在尝试决定使用哪种数据库技术和技术来提高数据的读取效率.
我想在一些数据库中表示这些数据.我会写一次,但多次阅读.
阅读查询将是这样的 - 给我B3的孩子; 或者给我一个根节点的盛大孩子(D型)......等等.什么/如何以最有效的方式存储这些数据?
我正在研究收集农场航拍图像(从直升机上以垂直方式收集的图像)的方法,我想将它们拼接在一起以构建被覆盖区域的整张照片,然后我想运行分析。我假设图像将带有 [纬度,经度] 坐标,以帮助我确定放置图像的位置。
为了了解这项技术的问题,我尝试手动拼接从我的手机拍摄的后院一些样本区域的照片。我经历过边缘通常看起来不一样,因为它们是从不同的侧面或角度被相机看到的。我猜这是图像失真,可能通过正射校正(不完全确定)来修复。我快速创建了以下图片来帮助解释我的问题。

我对你的问题:
用于进行正射校正的算法/技术是什么?
什么工具最适合我的需求:opencv、处理或 matlab 或任何其他可以轻松帮助校正图像和创建马赛克照片的工具?
在进行航空影像拼接和分析时还应考虑哪些其他问题?
谢谢!
我有2个遥控器-原产地指向我的叉子和上游到公司回购该点。
$git remote -v
origin https://github.com/me/app.git (fetch)
origin https://github.com/me/app.git (push)
upstream https://github.com/company/app.git (fetch)
upstream https://github.com/company/app.git (push)
Run Code Online (Sandbox Code Playgroud)
我分叉前一个月。我一直在推动原点,然后向上游提出拉取请求。这很好。
现在有人在上游创建了一个名为“3D_Theory”的分支,我想首先将该新分支反映到我的原点,然后从该分支开始工作。但出于某种原因,该分支并没有反映在我的起源中。
我尝试了以下方法:
git remote show origin
>> does not list 3D_Theory
git remote show upstream
>> lists 3D_Theory
Run Code Online (Sandbox Code Playgroud)
我试过:
git fetch upstream
git checkout master
git merge upstream/3D_Theory
Run Code Online (Sandbox Code Playgroud)
但是我仍然没有在我的叉子上创建那个分支。如何在上游获得一个新分支以反映我的分叉?
谢谢
以下类似问题都没有帮助我:
我知道Restful Get操作用于检索信息.Restful Post用于创建/插入我们没有唯一标识符的资源.
但有人刚问我"Restful GET优于Restful POST有什么优势?服务器端功能方面的优势是什么?"
git ×2
github ×2
java ×2
controller ×1
database ×1
flex4 ×1
fonts ×1
get ×1
git-fork ×1
git-merge ×1
git-svn ×1
jsp ×1
matlab ×1
opencv ×1
orthographic ×1
post ×1
repository ×1
rest ×1
spring ×1
spring-mvc ×1
string ×1
tree ×1
web-services ×1