走过海棠暮

文章 评论 浏览 25

走过海棠暮 2024-09-09 06:31:56

Uploadcare 是一种 IaaS 解决方案,用于将图像直接上传到 CDN,并使用 URL 命令裁剪、调整大小和转换上传的图像:

< a href="https://uploadcare.com" rel="nofollow noreferrer">https://uploadcare.com

例如,这是图像的完整版本(相当重,4034x2672px):

http://www.ucarecdn.com/6fdab0d5-5a07- 4b34-8a3a-f61727972745/full.jpg

完整版本的图像

这是裁剪并调整大小的一张:

http://www.ucarecdn.com/6fdab0d5-5a07-4b34-8a3a-f61727972745/-/crop/1000x1000/1300,1600/-/resize/300x/tree.jpg

树形图像

更多信息:https://uploadcare.com/upload-api-cloud-storage-and-cdn/#crop-resize-and-transform-uploaded -images

注意:我是联合创始人:)

Uploadcare is an IaaS solution for uploading images directly to the CDN, and crop, resize and transform uploaded images using URL commands:

https://uploadcare.com

For example, here is the full version of an image (which is quite heavy, 4034x2672px):

http://www.ucarecdn.com/6fdab0d5-5a07-4b34-8a3a-f61727972745/full.jpg

Full version of an image

And here is a cropped and resized one:

http://www.ucarecdn.com/6fdab0d5-5a07-4b34-8a3a-f61727972745/-/crop/1000x1000/1300,1600/-/resize/300x/tree.jpg

Tree image

More info: https://uploadcare.com/upload-api-cloud-storage-and-cdn/#crop-resize-and-transform-uploaded-images

Note: I am a co-founder :)

寻找良好的动态成像解决方案

走过海棠暮 2024-09-09 05:12:36

如果您使用的功能不向后兼容,我发现对我来说最好的方法是在预编译头中创建#define。示例:

#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_3_2
#define USING_4_X
#endif

然后在您的代码中,您可以执行以下操作:

BOOL exists = NO;
#ifdef USING_4_X        
exists = [SomeObject someMethod:[url lastPathComponent]];
#else
exists = [SomeObject someMethod:[[url path] lastPathComponent]];
#endif

If you are using features that are not backwards compatible, I found the best way for me is to create a #define in the pre-compiled header. Example:

#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_3_2
#define USING_4_X
#endif

Then in your code, you can do this:

BOOL exists = NO;
#ifdef USING_4_X        
exists = [SomeObject someMethod:[url lastPathComponent]];
#else
exists = [SomeObject someMethod:[[url path] lastPathComponent]];
#endif

以编程方式检测 iPad/iPhone 硬件的最佳方法

走过海棠暮 2024-09-09 03:40:25
 mybox.Tag := 666; 
 mybox.Checked :=true; 
 mybox.Tag := 0;

procedure myboxOnclick(Sender : TObject);
begin
if Tag = 0 then
//Do your thing
end;
 mybox.Tag := 666; 
 mybox.Checked :=true; 
 mybox.Tag := 0;

procedure myboxOnclick(Sender : TObject);
begin
if Tag = 0 then
//Do your thing
end;

将 TRadioButton 设置为选中会导致 OnClick 事件

走过海棠暮 2024-09-09 00:28:04
fscanf(in, "%[^, ]%*[, ]%lf%*[, ]%f%*[, ]%f%*[, ]%f", tag, &sec, &tgt, &s1, &s2)

应该工作吗?

fscanf(in, "%[^, ]%*[, ]%lf%*[, ]%f%*[, ]%f%*[, ]%f", tag, &sec, &tgt, &s1, &s2)

Should work?

如何创建 fscanf 格式字符串来接受空格和逗号 (,) 标记化

走过海棠暮 2024-09-08 16:45:07

将其作为答案(由用户 tuzo 建议)放入以便更容易找到。解决了这个问题。事实是测试服务器上的域名中有一个下划线。不知道为什么,现在也没有时间去 Google 搜索,但下划线(名为 some_client.ourcompany.com 之类的名称)就是问题所在。一定要喜欢 Internet Explorer...它就像一个你根本无法回避的消极好斗的同事。

摘自另一个 SO 答案...准确解释了发生了什么:
子域之一是否使用下划线? IE 在接受来自不遵循 URI RFC 的子域的 cookie 时遇到问题。 (http://www.ietf.org/rfc/rfc2396.txt)

Putting this in as an answer (suggested by user tuzo) to make it easier to find. Solved this. It was the fact that the domain name on the testing server had an underscore in it. No idea why and don't have time to Google for it right now but the underscore, named something like some_client.ourcompany.com, was the problem. Gotta love Internet Explorer... it's like a passive aggressive co-worker that you simply cannot avoid.

Taken from another SO answer... explains exactly what's going on:
Does one of the subdomains use an underscore ? IE has problems accepting cookies from subdomain's that dont follow the URI RFC. (http://www.ietf.org/rfc/rfc2396.txt)

会话变量未设置,但仅在 Internet Explorer 中设置,并非在所有计算机上设置

走过海棠暮 2024-09-08 12:58:45

其他解决方案:

  • 将 HtmlDataTable 绑定到请求范围 bean 中。
  • 将此请求范围 bean 注入视图范围 bean 中。

JBoss Seam 使用此解决方案将 JSF 组件绑定到对话范围组件。

Other solution:

  • Binding the HtmlDataTable in a request scope bean.
  • Inject this request scope bean in the view scope bean.

JBoss Seam use this solution for binding JSF componentes to a conversation scope component.

为什么即使 bean 是 @ViewScoped,@PostConstruct 回调每次都会触发?日本科学基金会

走过海棠暮 2024-09-08 03:13:39

Java 语言规范第 15.10 节规定:

数组创建表达式创建
一个新数组对象,其
元素的类型由
PrimitiveType 或
类或接口类型。它是一个
编译时错误,如果
ClassOrInterfaceType 并不表示
具体化类型(§4.7)。

上面的规则意味着该元素
输入数组创建表达式
不能是参数化类型,其他
比无限制的通配符。

您可以做的最接近的是使用未经检查的强制转换,无论是来自原始类型(如您所做的那样)还是来自无界通配符:

 HashMap<String, String>[] responseArray = (Map<String, String>[]) new HashMap<?,?>[games.size()];

您的版本显然更好:-)

The Java Language Specification, section 15.10, states:

An array creation expression creates
an object that is a new array whose
elements are of the type specified by
the PrimitiveType or
ClassOrInterfaceType. It is a
compile-time error if the
ClassOrInterfaceType does not denote a
reifiable type (§4.7).

and

The rules above imply that the element
type in an array creation expression
cannot be a parameterized type, other
than an unbounded wildcard.

The closest you can do is use an unchecked cast, either from the raw type, as you have done, or from an unbounded wildcard:

 HashMap<String, String>[] responseArray = (Map<String, String>[]) new HashMap<?,?>[games.size()];

Your version is clearly better :-)

如何制作哈希图数组?

走过海棠暮 2024-09-08 02:20:10

Left Joinj2.id IS NULL 结合仅返回 j1 的那些行,其中没有 j2 的行> 可以找到。

由于条件是j1.changedone < j2.changedone,它仅返回每个 trackid 具有最高 changedone 的行(如果有多个行具有该值 changedone< /code> 对于 trackid,它们都会被返回)。


因此,如果您有

trackid  changedone
      1           1
      1           2
      2           1

trackid  changedone
      1           2
      2           1

1 - 1 ,则 Left Join 会找到一条记录 (1 - 2),因此 j2 .idNOT NULL

The Left Join in combination with j2.id IS NULL returns only those rows of j1, where no row of j2 can be found.

Since the condition is j1.changedone < j2.changedone, it returns only the rows with the highest changedone per trackid (if there is more than one row with this value of changedone for a trackid, all of them are returned).


So if you have

trackid  changedone
      1           1
      1           2
      2           1

You will get

trackid  changedone
      1           2
      2           1

since for 1 - 1 the Left Join finds a record (1 - 2), so j2.id is NOT NULL.

基本连接查询理解

走过海棠暮 2024-09-07 16:42:15

我想我能够通过编写一个简单的python程序来打印随机数然后睡眠来重现您的错误:

import random
import time
import sys

random.seed(time.time())

print 'starting random numbers'
#sys.stdout.flush()
print 'big block of text' * 2000
#sys.stdout.flush()

count = 3

while count > 0:
    sleeper = random.randint(1, 5)
    r = random.randint(1000, 9000)
    print r, 'sleeping for', sleeper, 'seconds'
    #sys.stdout.flush()
    time.sleep(sleeper)
    count -= 1

print 'random numbers finished, closing'
#sys.stdout.flush()

这里有趣的一点是java代码将回显前几次打印,但然后会等到程序完成后再打印其余的部分。此示例代码的问题在于 Python 脚本的输出缓冲在 stdout 中,因此 Java 应用程序无法读取它。当您取消注释 sys.stdout.flush() 命令时,它可以正常工作。

我会尝试在你的Python程序中添加一个flush(),看看是否可以解决问题。

I think I was able to reproduce your error by writing a simple python program to print random numbers and then sleep:

import random
import time
import sys

random.seed(time.time())

print 'starting random numbers'
#sys.stdout.flush()
print 'big block of text' * 2000
#sys.stdout.flush()

count = 3

while count > 0:
    sleeper = random.randint(1, 5)
    r = random.randint(1000, 9000)
    print r, 'sleeping for', sleeper, 'seconds'
    #sys.stdout.flush()
    time.sleep(sleeper)
    count -= 1

print 'random numbers finished, closing'
#sys.stdout.flush()

The interesting bit here is that the java code will echo the first few prints but will then wait until the program is finished before it prints the rest. The problem with this example code is that the output from the Python script is buffered in stdout so the Java app can't read it. It works correctly when you uncomment the sys.stdout.flush() commands.

I would try adding a flush() to your python program and see if that fixes the issue.

Java/Python:集成、循环更新文本问题

走过海棠暮 2024-09-07 16:39:34

使用 load() 创建文本区域后,您必须在您创建的任何文本区域上调用 CKEDITOR.replace(),以便初始化编辑器...你在做这个吗?

如果您正在加载多个文本区域,并且希望文档中的所有文本区域都成为 CKEDITOR,那么您可以:

load();
CKEDITOR.replaceAll();

After creating the textarea with load(), you have to call CKEDITOR.replace() on any textareas which you have created, in order to initialize the editor... Are you doing this?

If you are loading multiple textareas, and you want all the textareas in the document to become CKEDITORs, then you do:

load();
CKEDITOR.replaceAll();

使用ajax的ckeditor

走过海棠暮 2024-09-07 14:54:30

我不喜欢复制不需要的东西。我会标记仅管理部分,并将该部分构建为具有内部 IP 或不同端口的单独数据库。然后与公共站点建立外键关系以进行管理员访问。将其视为索引表会比复制更容易管理,并且当您不与遗留系统交互时,API 开发是一项不必要的任务。另外,当您希望保持系统独立时,为什么还要进行复制。
这是我的两分钱。

I am not a fan of replicating what doesn't need to be. I would tag what is admin only and build that portion out as a seperate DB with an internal IP or different port. Then make foreign key relationships to the public site for admin access. Treating it like an indexed table would be far easier to administrate rather then replicating and API development is an unecessary task when you are not talking with legacy systems. Also why replicate when you want to keep the systems seperate.
Thems my two cents.

将管理功能与公共站点分开的最佳方法是什么?

走过海棠暮 2024-09-07 13:06:58

我认为你的 qmake 文件没问题。但为什么 INCLUDEPATH 是绝对的而 LIBS 是相对的。我也会尝试将 LIBS 设置为绝对。

从这里
http://doc.trolltech.com/4.6/qmake-variable- Reference.html#includepath

但主要问题是什么(我认为)你需要在 INCLUDEPATH 中添加斜杠。在文档中是这样的。

INCLUDEPATH += C:/gtest-1.5.0/gtest-1.5.0/include

I think you are ok for your qmake file. But Why is INCLUDEPATH absolute and LIBS relative. I would try setting LIBS absolute also.

From here
http://doc.trolltech.com/4.6/qmake-variable-reference.html#includepath

But what the main problem is (I think) you need to put forward slashes in INCLUDEPATH. In the docs it is like this.

INCLUDEPATH += C:/gtest-1.5.0/gtest-1.5.0/include

在 Windows 中使用 Qt 的 Google Test

走过海棠暮 2024-09-07 10:50:38

好吧,我猜,既然你使用的是 PHP,那就有某种“根据 ID 检索图像”功能。

如果您将图像存储在目录中,请尝试使用

file_exists('path/to/my/img.png') ? $image = 'path/to/my/img.png' : $image = 'path/to/my/default/img.png';

如果您将图像存储在数据库中,请遵循相同的逻辑。不使用 file_exists() 检查查询是否返回某些内容。

Well, i guess, since you're using PHP, that there's some sort of "retrieve image based on ID" function.

If you're storing your images on a directory try using

file_exists('path/to/my/img.png') ? $image = 'path/to/my/img.png' : $image = 'path/to/my/default/img.png';

If you're storing them in a DB, follow the same logic. Instead of using file_exists() check if the query returned something.

将 404 热链接图像重定向到单个图像?

走过海棠暮 2024-09-07 08:08:55

测试数据对我也有效,杀死了mysql。
可悲的是,现实世界中石器时代的应用程序“时间助手 6.2”使用了 3 个连接并崩溃了。
完全按照所描述的方式。

发现了一些提示:
http://bugs.opensolaris.org/view_bug.do?bug_id=6892501

说它是针对特定Solaris 开放的并且只花了一年时间就修复了? (它不会让我添加第二个链接!!)

在上面的底部,它指向 mysql bug 49091。

我没有看到任何解决方案-.-

The test data works for me too, killing mysql.
Sadly, a real world crapplication "time-assistant 6.2" from the stone age uses 3 joins and blows up.
in exactly the manner described.

Found some hints:
http://bugs.opensolaris.org/view_bug.do?bug_id=6892501

says its open solaris specific and only took a year to fix? (it wont let me add a second link!!)

At the bottom of the above, it points to mysql bug 49091.

No solution that I see -.-

多个内连接 3 个或更多崩溃 mysql 服务器 5.1.30 opensolaris

更多

推荐作者

lee_heart

文章 0 评论 0

huangxaiorui

文章 0 评论 0

ゞ记忆︶ㄣ

文章 0 评论 0

画离情绘悲伤

文章 0 评论 0

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文