小编Mav*_*ven的帖子

如何使用jQuery检测页面的滚动位置

我在我的网站上遇到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)

javascript jquery scroll

162
推荐指数
4
解决办法
56万
查看次数

流行的应用程序如何验证从移动应用程序到其服务器的用户请求?

假设我有一个连接到.Net API的Android应用程序,用于接收/设置数据.我所遇到的困惑是关于如何在每次向API发出请求时第一次注册/登录用户并对其进行身份验证.

  • 如果我只使用基于用户名/密码的身份验证,他们将不够安全?
  • 当然,出于安全原因,我无法在设备中保存该用户名/密码?
  • 我是否应该在注册时为每个用户发出GUID,将其保存在他们的设备中并在API请求期间每次检索?

还有哪些其他模式可用,哪些模式最有效和最安全,我只需要一个流程.有人能告诉我Facebook,FourSquare或Twitter等着名的Android应用程序使用什么方法来验证从他们的移动应用程序到他们的服务器的每个请求?

如果这不是一些公开信息,请提前抱歉.

authentication android facebook foursquare

109
推荐指数
4
解决办法
7万
查看次数

服务器主体无法在SQL Server MS 2012中的当前安全上下文下访问数据库

我试图通过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中告诉我它的替代方案吗?

sql-server sql-server-2012

91
推荐指数
7
解决办法
22万
查看次数

无法加载文件或程序集"Antlr3.Runtime(1)"或其依赖项之一

我在尝试运行我的MVC4项目时收到此错误,它在上次在我的其他计算机上工作正常,但是当我尝试从另一台计算机运行它时它给了我这个错误:

无法加载文件或程序集"Antlr3.Runtime(1)"或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(HRESULT异常:0x80131040)

这里阅读了这篇文章后,我试图这样:

安装包Antlr3.Runtime -Pre

但它没有帮助,任何想法?

.net asp.net-mvc

80
推荐指数
8
解决办法
9万
查看次数

未能将一些参考文献推送到git@heroku.com

当我尝试将我的文件推送到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)

git git-svn heroku

39
推荐指数
9
解决办法
10万
查看次数

如果在SQL Server 2008中存在INSERT,则更新UPDATE

我想知道如何使用一个语句在SQL Server中使用UPSERT或换句话说UPDATE if records exists Else enter new record操作?

这个例子显示了在Oracle中实现这一目标的方式在这里 ,但它使用Dual表,它这不存在SQL Server.

那么,任何SQL Server替代品(没有存储过程)好吗?

sql sql-server sql-server-2008

39
推荐指数
1
解决办法
22万
查看次数

.Net 4/MVC 3应用程序的托管提供商

我已经在.Net 4/MVC 3上开发了一个应用程序.现在我想主持,这是我的第一次托管体验,所以我很困惑,认真需要帮助.

它不是那么复杂的应用程序,基本上作为社区图像共享网站.现在我正在为它寻找托管服务,我不太了解它,但我学到了什么,我认为我需要遵循它.

  • 使用IIS 7提供的主机(完全支持.NET4/MVC3,因此我可以完全使用MVC路由功能,而不必担心在路由和支持功能中添加扩展(文件MIME类型,自定义错误页面等)
  • 由于它是一个社区网站,所以它应该保持全天候可用,如良好的服务器性能和可用性,因此用户不会被服务器不可用和类似的错误窃听.
  • 域名注册/托管功能,安全性
  • SQL Server支持,一个简单的控制面板(我想Cpanel?)
  • 我网站的专用IP地址(用于SSL和更好的SEO)
  • 理想情况下无限制的带宽/空间包(因为它可以在两个参数中增加图像共享)
  • 因为它实际上不是商业产品,所以价格紧凑.

我知道我已经提出了很多要点,但我也搜索了其他主题和其他论坛,并发现这些是推荐的选项,任何关于他们的表现和支持的话:

Arvixe | Seekdotnet

hosting iis-7 .net-4.0 asp.net-mvc-3

34
推荐指数
2
解决办法
3万
查看次数

BadImageFormatException.在安装了32位Oracle客户端组件的64位模式下运行时会发生这种情况

当我的.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)

.net oracle oracle11g

34
推荐指数
4
解决办法
18万
查看次数

性能明智的是Bitwise算子与法向模量有多快

if(i++ & 1) {

}
Run Code Online (Sandbox Code Playgroud)

for

if(i % 2) {

}
Run Code Online (Sandbox Code Playgroud)

可以使用if在正常流量或条件语句类似操作for,if等提高性能,这将是for在可能的地方总是使用它们?

c++ bit-manipulation bitwise-operators

31
推荐指数
4
解决办法
2万
查看次数

无法找到类型[System.IO.Compression.CompressionLevel],请确保已加载包含此类型的程序集

我编写了这个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

31
推荐指数
2
解决办法
5万
查看次数