我在我的网站上遇到jQuery功能问题.它的作用是,它使用该window.scroll()
功能来识别窗口何时改变其滚动位置,并且在更改时调用一些函数来从服务器加载数据.
问题是,.scroll()
只要滚动位置发生一点变化并在底部加载数据,就会调用该函数; 但是,我希望实现的是当滚动/页面位置到达底部时加载新数据,就像Facebook Feed一样.
但我不知道如何使用jQuery检测滚动位置?
function getData() {
$.getJSON('Get/GetData?no=1', function (responseText) {
//Load some data from the server
})
};
$(window).scroll(function () {
getData();
});
Run Code Online (Sandbox Code Playgroud) 假设我有一个连接到.Net API的Android应用程序,用于接收/设置数据.我所遇到的困惑是关于如何在每次向API发出请求时第一次注册/登录用户并对其进行身份验证.
还有哪些其他模式可用,哪些模式最有效和最安全,我只需要一个流程.有人能告诉我Facebook,FourSquare或Twitter等着名的Android应用程序使用什么方法来验证从他们的移动应用程序到他们的服务器的每个请求?
如果这不是一些公开信息,请提前抱歉.
我试图通过SQL Server Management Studio访问我的托管服务器的数据库,所有东西,直到登录是好的,但当我使用命令use myDatabase
它给我这个错误:
The server principal "****" is not able to access the database "****" under the current security context.
Run Code Online (Sandbox Code Playgroud)
我搜索了一下,托管服务提供商列出了这个问题的修复程序.
但这对我不起作用可能是因为它适用于SQL Server Management Studio 2008但是我使用的是SQL Server Management Studio 2012.
这可能是个问题吗?如果是,那么任何人都可以在SSMS 2012中告诉我它的替代方案吗?
我在尝试运行我的MVC4
项目时收到此错误,它在上次在我的其他计算机上工作正常,但是当我尝试从另一台计算机运行它时它给了我这个错误:
无法加载文件或程序集"Antlr3.Runtime(1)"或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(HRESULT异常:0x80131040)
安装包Antlr3.Runtime -Pre
但它没有帮助,任何想法?
当我尝试将我的文件推送到heroku rep时,我收到此错误.
我已经在gitconfig中设置了autocrlf = false但是这个问题仍然存在.我也试过这个解决方案, 但没有收获.
任何建议都可能是git仍然使用旧配置设置,如果是,那么我该如何刷新它.
谢谢
C:\myapp>git push heroku
To git@heroku.com:myapp.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:myapp.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)
在尝试时 git pull heroku master
warning: no common commits
remote: Counting objects: 215, done.
remote: Compressing objects: 100% (147/147), done. …
Run Code Online (Sandbox Code Playgroud) 我想知道如何使用一个语句在SQL Server中使用UPSERT
或换句话说UPDATE if records exists Else enter new record
操作?
这个例子显示了在Oracle中实现这一目标的方式在这里
,但它使用Dual
表,它这不存在SQL Server
.
那么,任何SQL Server替代品(没有存储过程)好吗?
我已经在.Net 4/MVC 3上开发了一个应用程序.现在我想主持,这是我的第一次托管体验,所以我很困惑,认真需要帮助.
它不是那么复杂的应用程序,基本上作为社区图像共享网站.现在我正在为它寻找托管服务,我不太了解它,但我学到了什么,我认为我需要遵循它.
我知道我已经提出了很多要点,但我也搜索了其他主题和其他论坛,并发现这些是推荐的选项,任何关于他们的表现和支持的话:
当我的.Net
应用程序尝试连接到oracle数据库时,我收到此错误.
错误说明了This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
.但我已经多次确定客户端安装x64
不了32
.
Date Time: 6/8/2014 10:57:55 AM: System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at …
Run Code Online (Sandbox Code Playgroud) if(i++ & 1) {
}
Run Code Online (Sandbox Code Playgroud)
for
if(i % 2) {
}
Run Code Online (Sandbox Code Playgroud)
可以使用if
在正常流量或条件语句类似操作for
,if
等提高性能,这将是for
在可能的地方总是使用它们?
我编写了这个PowerShell脚本,该脚本应该在特定日期范围内存档所有日志文件.
$currentDate = Get-Date;
$currentDate | Get-Member -Membertype Method Add;
$daysBefore = -1;
$archiveTillDate = $currentDate.AddDays($daysBefore);
$sourcePath = 'C:\LOGS';
$destPath='C:\LogArchieve\_'+$archiveTillDate.Day+$archiveTillDate.Month+$archiveTillDate.Year+'.zip';
foreach( $item in (Get-ChildItem $sourcePath | Where-Object { $_.CreationTime -le $archiveTillDate }) )
{
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem");
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal;
[System.IO.Compression.ZipFile]::CreateFromDirectory($sourcePath,$destPath, $compressionLevel, $false);
}
Run Code Online (Sandbox Code Playgroud)
它一直工作到foreach
循环之前,但是在循环中它会产生以下错误:
Unable to find type [System.IO.Compression.CompressionLevel]: make sure that the assembly containing this type is loaded.
At line:4 char:65
+ $compressionLevel = [System.IO.Compression.CompressionLevel] <<<< ::Optimal;
+ CategoryInfo : InvalidOperation: (System.IO.Compression.CompressionLevel:String) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound …
Run Code Online (Sandbox Code Playgroud) compression powershell runtime-error powershell-2.0 .net-assembly
.net ×2
sql-server ×2
.net-4.0 ×1
android ×1
asp.net-mvc ×1
c++ ×1
compression ×1
facebook ×1
foursquare ×1
git ×1
git-svn ×1
heroku ×1
hosting ×1
iis-7 ×1
javascript ×1
jquery ×1
oracle ×1
oracle11g ×1
powershell ×1
scroll ×1
sql ×1