我喜欢pgAdmin III GUI软件,但GUI比SSH控制台使用更多带宽.
psql不是交互式的,没有菜单,表列表等.
是否存在一些交互式文本模式工具来连接PostgreSQL?
SELECT vm.value FROM vm ORDER BY vm.value ASC;
Run Code Online (Sandbox Code Playgroud)
结果是:
.
0
0%
0.0
0.964
%.0f
%.0f mph
-1.0°
11/1
11-14-1981
112 mph
11:48:43
%1$.1f mph %2$@
1/2
12.5?
1/4
195 lb
%.1f°
2 days ago
%.2f
2º out-in
3/4
3.5
3.6
3D
3 days ago
4º closed
5'10''
5”10”
Account
Run Code Online (Sandbox Code Playgroud)
我记得ASCII/Unicode数字应该紧密相连,不要与百分数和其他字符交替.
我试图在PostgreSQL 9.1中这样做:
SELECT m.id, vm.id, vm.value
FROM m
LEFT JOIN vm ON vm.m_id = m.id and vm.variation_id = 1
ORDER BY lower(trim(vm.value)) COLLATE "C" ASC LIMIT 10 OFFSET 120
Run Code Online (Sandbox Code Playgroud)
结果是:
id | id | value
----+-----+---------------
504 | 511 | "andr-223322"
506 | 513 | "andr-322223"
824 | 831 | "angHybrid"
866 | 873 | "Another thing"
493 | 500 | "App update required!"
837 | 844 | "App update required!"
471 | 478 | "April"
905 | 912 | …Run Code Online (Sandbox Code Playgroud) 如果这个测试:
'use strict'
describe('application', function() {
it('should login', function() {
browser().navigateTo('/');
expect('111').toBe('111');
});
});
Run Code Online (Sandbox Code Playgroud)
包括该"browser"行,结果是:
Chrome 26.0 (Windows) application should login FAILED
ReferenceError: browser is not defined
at null.<anonymous> (...../test/js/e2e/tests/test.js:6:9)
Chrome 26.0 (Windows): Executed 1 of 1 (1 FAILED) (0.359 secs / 0.004 secs)
Run Code Online (Sandbox Code Playgroud)
但如果没有这条线,测试就会成功.
人们建议包括angular-scenario.js,但这打破了测试
expect('111').toBe('222');
Run Code Online (Sandbox Code Playgroud)
被评估为真.
该怎么办?
这段代码:
try
{
_wcl.DownloadFile(url, currentFileName);
}
catch (WebException ex)
{
if (ex.Status == WebExceptionStatus.ProtocolError && ex.Response != null)
if ((ex.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotFound)
Console.WriteLine("\r{0} not found. ", currentFileName);
}
Run Code Online (Sandbox Code Playgroud)
下载文件并通知是否发生404错误.
我决定异步下载文件:
try
{
_wcl.DownloadFileAsync(new Uri(url), currentFileName);
}
catch (WebException ex)
{
if (ex.Status == WebExceptionStatus.ProtocolError && ex.Response != null)
if ((ex.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotFound)
Console.WriteLine("\r{0} not found. ", currentFileName);
}
Run Code Online (Sandbox Code Playgroud)
现在,如果服务器返回404错误并且WebClient生成一个空文件,则此catch块不会触发.
在Jasmine测试中每个"it"有多个匹配器是否正确,否则它们会相互干扰?
我想将这些测试合并为一个:
var mapper = ......... ;
it('should be reviewed if not admin and language not set', inject(function() {
scope.globals.isAdmin = false;
scope.globals.language = '';
mapper.updatedOn.setYear(2013);
expect(scope.isReviewed(mapper)).toBe(true);
}));
it('should disregard mapper date if not admin and language not set', inject(function() {
scope.globals.isAdmin = false;
scope.globals.language = '';
mapper.updatedOn.setYear(2015);
expect(scope.isReviewed(mapper)).toBe(true);
}));
it('should be reviewed if admin and mapper is older', inject(function() {
scope.globals.isAdmin = true;
scope.globals.language = '';
mapper.updatedOn.setYear(2013);
expect(scope.isReviewed(mapper)).toBe(true);
}));
it('should be not reviewed if admin and mapper is newer', …Run Code Online (Sandbox Code Playgroud) 我想获得Unicode字体字形范围(Delphi 6):
var GS:PGlyphSet;
GSSize:LongWord;
rng:TWCRange;
begin
GSSize := GetFontUnicodeRanges(Canvas.Handle, nil);
GetMem(Pointer(GS), GSSize);
try
GS.cbThis:=GSSize;
GS.flAccel:=0;
GS.cGlyphsSupported:=0;
GS.cRanges:=0;
if GetFontUnicodeRanges(Canvas.Handle, GS)<>0 then begin
for i:=0 to GS.cRanges-1 do begin
rng := GS.ranges[i];
Run Code Online (Sandbox Code Playgroud)
奇怪的是它Length(GS.ranges)是1,但GS.cRanges是309,当我尝试访问第二个范围时,GS.ranges[1]我得到的当然是范围检查错误.在我开启范围检查之前,它已经以某种神奇的方式运作.
供参考的类型(来自Windows模块):
PWCRange = ^TWCRange;
{$EXTERNALSYM tagWCRANGE}
tagWCRANGE = packed record
wcLow: WCHAR;
cGlyphs: SHORT;
end;
TWCRange = tagWCRANGE;
PGlyphSet = ^TGlyphSet;
{$EXTERNALSYM tagGLYPHSET}
tagGLYPHSET = packed record
cbThis: DWORD;
flAccel: DWORD;
cGlyphsSupported: DWORD;
cRanges: DWORD;
ranges: array[0..0] of TWCRange;
end;
TGlyphSet …Run Code Online (Sandbox Code Playgroud) 从中读取4个字节TCPSocket(实际上socket返回一个字符串,然后我调用.bytes以获取一个数组).现在他们需要转换为int32 big endian.
或者可能TCPSocket有一些方法立即读取int32?
在 Delphi 中,每当我使用 TQuery 对数据库执行 SELECT 时,我都会在 Query.Open 后面加上 try..finally,并在 finally 部分中使用 Query.Close。这对我来说很有意义,因为否则查询仍然会不必要地存储数据(使用内存)。
但我的问题与当我使用查询执行 INSERT 或 DELETE 时有关,因此需要使用 Query.ExecSQL 执行 SQL 我的问题是,我必须在 Query.ExecSQL 之后使用 Query.Close 吗?
我的想法是,因为这是在数据库上执行的命令,大概不会向查询返回任何数据,所以不需要执行 Query.Close 但也许有人对什么有更深入的了解,如果有的话,可能会在调用 Query.ExecSQL 后返回并存储在查询中,对此 Query.Close 会有好处吗?
谢谢。
Rails应用程序作为一个整体存在一些Lint工具吗?
例如,ruby-lint如果通过require在application.rb文件中的子句中提及模块来引用模块,则不会在其他模块中看到声明.
RubyMine在进行代码检查时也看不到它们.
postgresql ×3
delphi ×2
jasmine ×2
sql-order-by ×2
.net ×1
arrays ×1
asynchronous ×1
c# ×1
console ×1
fonts ×1
int32 ×1
karma-runner ×1
lint ×1
matcher ×1
pgadmin ×1
range ×1
ruby ×1
slice ×1
sql ×1
sql-insert ×1
ssh ×1
tcpsocket ×1
testing ×1
tquery ×1
unicode ×1
unit-testing ×1
webclient ×1