我有两个型号
1) Server Model : conneted to remote database which is stored on server
2) Local Host : connected to my pc database is stored in on pc.
Run Code Online (Sandbox Code Playgroud)
我想同时查询两个数据库表.每次我都要在数据库模型之间切换.
怎么做?
我们的添加迁移通常会失败但不一致.迁移总是进入脚手架步骤,然后大约5次中有4次我们会收到如下内容:
System.Runtime.Remoting.RemotingException: Object '/2355037d_df43_460b_8737_725c0c1c80be/hvdculybngjc_rcnskixmk7+_2.rem' has been disconnected or does not exist at the server.at EnvDTE.Project.get_Properties()
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue[T] (Project project, String propertyName)
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.AddFile(Project project, String path, String contents)
at System.Data.Entity.Migrations.Utilities.MigrationWriter.Write(ScaffoldedMigration scaffoldedMigration, Boolean rescaffolding, Boolean force, String name)
at System.Data.Entity.Migrations.AddMigrationCommand.<>c__DisplayClass3.<.ctor>b__1()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Object '/2355037d_df43_460b_8737_725c0c1c80be/hvdculybngjc_rcnskixmk7+_2.rem' has been disconnected or does not exist at the server.
Run Code Online (Sandbox Code Playgroud)
有时迁移类无论如何都会生成,但更常见的情况是它不会生成.对这个错误的搜索已经表明某些东西正在被垃圾收集,这不应该是,但这并没有真正帮助我们解决这个问题.
我们的数据迁移项目在.NET 4.5中,EF 5在Windows 8,Visual Studio 2012和SQL Server 2012中运行.
我想使与图像布局肖像图像内的div
与固定纵横比3:2
.图像的大小是327x491px
.
主要问题是图像之间不需要的空间.如何仅使用HTML/CSS 将图像对齐为马赛克?
HTML:
<div id="pictures1" class="_pictures1 grid">
<div class="_pictures1-01"><div style="width:125px;height: 188px; background: red;"><img src="" width="125" height="188" alt="" /></div></div>
<div class="_pictures1-02"><div style="width:192px;height: 288px;background: green;"><img src="" width="192" height="288" alt="" /></div></div>
... SO ON ...
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
._pictures1 {
width: 935px; height: 490px;
margin: -26px 0 0 59px;
float: left;
top: 20%; left: 20%;
position: absolute;
border: 1px gray solid;
}
._pictures1 div {position: absolute;}
._pictures1-01 {top: 0px; left: 35px;}
._pictures1-02 {top: …
Run Code Online (Sandbox Code Playgroud) 是否有可能抑制R中gc()的所有消息?
通常喜欢suppressWarnings(gc( ))
或suppressMessages(gc( ))
不工作.gc( )
本身有一个verbose
选项,但这不是我喜欢它的工作方式:
> gc(verbose=TRUE)
Garbage collection 375 = 234+40+101 (level 2) ...
17.9 Mbytes of cons cells used (41%)
171.2 Mbytes of vectors used (43%)
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 334493 17.9 818163 43.7 818163 43.7
Vcells 22431904 171.2 52178020 398.1 50193465 383.0
> gc(verbose=FALSE)
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 334496 17.9 818163 43.7 818163 43.7
Vcells 22431916 171.2 52178020 398.1 …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用webworker api加载图像.我的html页面中有大图像,需要5分钟来加载所有图像,因此我使用webworker来加载图像.
这是技术..
我在html页面中保持所有img标签的src属性为空.
所有图片必须为每个IMG比如:id =唯一的ID events_all_1_01意味着图像src是"图片/关键字/ 事件/全部/ 1/01.JPG ".即最后一部分事件/全部/ 1/01.jpg是id.
Main.html文件
<body>
<script src="js/modernizr.custom.js"></script>
<script language="javascript">
window.onload = function(){
if (Modernizr.webworkers) {
var worker = new Worker('js/webworker/test_ww_23_04.js');
worker.onmessage = function(event) {
var url = event.data.replace(/_/g, "/");
var image_src = "pictures/keywords/"+url+".jpg";
var img = new Image();
img.src = image_src;
img.onload = function(){
// do stuff when your image is loaded
document.getElementById(event.data).src = image_src;
}
};
worker.onerror = function(e) {
alert('Error: Line ' + e.lineno + ' in ' + …
Run Code Online (Sandbox Code Playgroud) 我是 apache shiro 的新手。我在执行此语句时遇到异常。
currentUser.login(token);
Run Code Online (Sandbox Code Playgroud)
例外是
errororg.apache.shiro.authc.AuthenticationException: Authentication failed for token submission [org.apache.shiro.authc.UsernamePasswordToken - abc@gmail.com, rememberMe=true]. Possible unexpected error? (Typical or expected login exceptions should extend from AuthenticationException).
Run Code Online (Sandbox Code Playgroud)
我正在调用此方法进行登录。代码是。
public boolean authorize(String username,String password)
{
Boolean status=false;
log.debug("the user id "+username+"passwrodD::"+password);
Realm realm = new JdbcRealm();
DefaultSecurityManager securityManager = new DefaultSecurityManager(realm);
UsernamePasswordToken token = new UsernamePasswordToken(username, password);
token.setRememberMe(true);
SecurityUtils.setSecurityManager(securityManager);
Subject currentUser = SecurityUtils.getSubject();
Response r = null;
log.debug("before process for login");
try
{
currentUser.login(token); //This throws an error upon form …
Run Code Online (Sandbox Code Playgroud) 我想检查裁剪div是否覆盖了图像.当图像没有旋转但是旋转图像裁剪后没有显示错误信息时,一切正常.
这是小提琴:小提琴
function isCropValid(){
var $selector = $("#resizeDiv"); // cropping Div
var $img = $("#rotateDiv"); // image div
var $selectorW = $selector.width();
var $selectorH = $selector.height();
var $selectorX = $selector.offset().left ;
var $selectorY = $selector.offset().top ;
var $imgW = $img.width();
var $imgH = $img.height();
var $imgX = $img.offset().left;
var $imgY = $img.offset().top;
var diff_X = $selectorX - $imgX;
var diff_Y = $selectorY - $imgY;
if(diff_X+$selectorW > $imgW){
return false;
} else if(diff_Y+$selectorH > $imgH){
return false;
} else if($selectorX<$imgX){ …
Run Code Online (Sandbox Code Playgroud) 我是React JS的新手。我正在尝试从React App构建war文件,但是卡在下面的某个地方。它给了我下面的错误。
Creating an optimized production build...
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.
./src/Home.js
Line 2: 'AppNavbar' is defined but never used no-unused-vars
Line 3: 'Link' is defined but never used no-unused-vars
Line 4: 'Button' is defined but never used no-unused-vars
Line 4: 'Container' is defined but never used no-unused-vars
./src/App.js
Line 5: 'MenuBar' is defined but never used no-unused-vars
Line 6: 'PrivilegeList' is defined but never used …
Run Code Online (Sandbox Code Playgroud) 我有一个页面list.jsp
列出了表格中的所有记录,一个按钮位于顶部以添加新记录.
我想打开add.jsp
一个弹出窗口.这有效但当我关闭弹出窗口时如何更新, list.jsp
以便它显示新添加的记录
这是我的代码,我试过...
的List.jsp
<html>
<head>
<script>
function popupwindow(url, title, w, h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
popupWindow = window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
return popupWindow
}
</script>
</head>
<body>
<input type="button" value="Add new" id="add-btn" onclick="popupwindow('Addnew.jsp','Add new',600,400)"/>
<table>
// Here i am showing all records from database...
</table>
</body>
Run Code Online (Sandbox Code Playgroud)add.jsp
<html>
<head>
<script type="text/javascript">
$(document).ready(function(){
$("#savebtn").click(function(e) {
$.ajax({
type: "POST",
url: …
Run Code Online (Sandbox Code Playgroud)我有以下代码我想删除tbl-content
类如果recordList
数组为空
<table id="gradient-style">
<tbody class="tbl-content">
<tr>
<%
for (RecordBean record : recordList) {
// some code here to get result
}
%>
<%
if (recordList.isEmpty())
{
%>
<tr>
<td colspan="12" align="center" style="color: red;font-family: verdana">
<h3>No Search records </h3>
</td>
</tr>
<%
}
%>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
这是css
.tbl-content{
height: 650px;;
overflow: auto;
position: absolute;
border: 1px solid gray;
border-top: none;
}
Run Code Online (Sandbox Code Playgroud) javascript ×5
html ×3
jquery ×3
image ×2
jsp ×2
aspect-ratio ×1
css ×1
grid-layout ×1
java ×1
maven ×1
mysql ×1
node.js ×1
popupwindow ×1
r ×1
reactjs ×1
shiro ×1
web-worker ×1