半城柳色半声笛

文章 评论 浏览 26

半城柳色半声笛 2025-01-01 04:01:28

类有一个限定名称,您可以使用它来防止这些“多个类同名”。限定名称为“com.example.ExampleClass”,非限定名称为“ExampleClass”。
您可以使用 Class.getName() 获取限定名称;

至于方法;
您可以查找反射(http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/Method.html)。要调用该函数,请在 java.lang.reflect.Method 上使用 invoke。

Classes have a qualified name you can use to prevent these "multiple classes with the same name". A Qualified name would be "com.example.ExampleClass" - a non-qualified name would be "ExampleClass".
You can get the qualified name with Class.getName();

As for the methods;
You can look up on reflection (http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/Method.html). To call the function, use invoke on the java.lang.reflect.Method.

在运行时根据方法名称和方法调用方法

半城柳色半声笛 2025-01-01 03:33:35

WinForms 是托管代码,几乎可以在 CLR 上运行的所有语言中使用。所以标准的原生 C++ 无法构建 winforms 应用程序。但是,托管 C++ 或 C++/CLI 可以用本机代码构建 WinForm 应用程序。

总的来说,我会质疑你为什么这样做。如果您愿意使用混合模式 C++,那么

  • 使用 C# 构建 UI
  • 可能会更快。通过混合模式 C++ 层与本机后端进行通信。

WinForms is managed code and is usable from practically every language with runs on the CLR. So standard native C++ can't build a winforms app. However managed C++ or C++/CLI can build WinForm apps in native code.

In general though I would question why you were doing this. If you are willing to have mixed mode C++ it would probably be much faster to

  • Build the UI in C#
  • Communicate with your native backend through a mixed mode C++ layer.

您可以使用 C++ 构建 Winforms 应用程序吗?

半城柳色半声笛 2025-01-01 02:52:12

我最终想通了这一点。当您运行 rake asset:precompile 时,所有静态资源都会被编译并移动到 /public。例如,技巧是 .js 和 .js.gz 具有完全相同的时间戳。一旦我触摸了 *.gz,一切就正常了。希望这可以节省某人一些时间。

I figured this out eventually. When you run rake assets:precompile all the static assets are compiled and moved to /public. The trick is for example that the .js and the .js.gz have the exact same timestamp. Once I did touch *.gz everything served correctly. Hope that saves someone some time.

nginx:gizip_static:似乎不起作用

半城柳色半声笛 2024-12-31 20:25:12

如果您使用的是 HTML5,则视频的缩略图是使用视频标记中的“海报”属性定义的。下面是一个示例:

<video width="500" height="375" poster="myThumbnail.jpg" preload="none" controls="controls">
  <source src="http://hostname.com/myVideo.webm"/>
</video>

如果您想使用视频的给定帧自动创建此图像,您应该检查 F. Calderan 发布的链接

If you're using HTML5, the thumbnail of a video is defined using the 'poster' attribute in the video tag. Here's an example:

<video width="500" height="375" poster="myThumbnail.jpg" preload="none" controls="controls">
  <source src="http://hostname.com/myVideo.webm"/>
</video>

If you want to create this image automatically using a given frame of the video, you should check the link posted by F. Calderan

如何从嵌入视频中获取缩略图?

半城柳色半声笛 2024-12-31 03:37:57

您可以创建自己的:

  1. 在“设置”中,转到“实时模板”
  2. 添加带有缩写“日期”的新模板
  3. 对于“模板文本”,请指定 $date$。现在应该启用“编辑变量”按钮。
  4. 编辑变量,并将 $date$ 设置为使用表达式 date()
  5. 在模板上下文下启用“Java 注释”,然后单击“确定”。

现在,当您键入“日期”并使用默认完成手势(Tab)时,它将用当前日期替换“日期”。

您还可以使用 time() 表达式。请注意,IntelliJ 似乎不太支持指定此日期的格式

You can create your own:

  1. In Settings, go to Live Templates
  2. Add a new template with the abbreviation "date"
  3. For "template text", specify $date$. Now the "Edit Variables" button should be enabled.
  4. Edit the variables, and set $date$ to use the expression date().
  5. Enable "Java comment" under the template's context and click OK.

Now when you type "date" and use the default completion gesture (Tab), it will replace "date" with the current date.

You can also make use of the time() expression. Note that it doesn't seem like IntelliJ has great support for specifying the format of this date.

IntelliJ IDEA 中有插入日期/时间的快捷方式吗?

半城柳色半声笛 2024-12-30 22:35:48

我只编辑并发布了相关部分以找到最大值。

int i;
float largest = 0;

for (i = 0; i<numberOfPixels; i++)
{
    //NSLog(@"i is: %i", i); 
    int j;
    int numberOfSamplesPerPixel = bufferSize/numberOfPixels;
    float average = 0;

    for (j=i*numberOfSamplesPerPixel; j<(i+1)*numberOfSamplesPerPixel; j++){

        average += frame[j];
        average = average/numberOfSamplesPerPixel;
    }

    waveDisplayArray[i] = average;

    if( largest < average )
    {
        largest = average;
    }

    NSLog(@"Average %i is %f",i,average);
    NSLog(@"waveDisplay Array %i: %f",i, waveDisplayArray[i]);

}
NSLog(@"Largest  %f",largest);

I have edited and posted only relevant part to find the largest value.

int i;
float largest = 0;

for (i = 0; i<numberOfPixels; i++)
{
    //NSLog(@"i is: %i", i); 
    int j;
    int numberOfSamplesPerPixel = bufferSize/numberOfPixels;
    float average = 0;

    for (j=i*numberOfSamplesPerPixel; j<(i+1)*numberOfSamplesPerPixel; j++){

        average += frame[j];
        average = average/numberOfSamplesPerPixel;
    }

    waveDisplayArray[i] = average;

    if( largest < average )
    {
        largest = average;
    }

    NSLog(@"Average %i is %f",i,average);
    NSLog(@"waveDisplay Array %i: %f",i, waveDisplayArray[i]);

}
NSLog(@"Largest  %f",largest);

从数组中提取最大元素

半城柳色半声笛 2024-12-30 17:46:39

QUiLoader 中有一个 load(),但没有 save():

http://developer.qt.nokia.com/doc/qt-4.8/quiloader.html#load

UI 文件格式已记录,并且是 XML。因此,您可以编写自己的 .UI 文件生成器:

http://developer.qt.nokia.com/doc/qt-4.8/designer-ui-file-format.html

事实上,您可以用相反的方式解决这个问题。不是使用编程小部件 API 调用生成对话框...而是使用 XML 生成 .UI 文件。然后您可以将其加载到您的应用程序中或通过 QtDesigner。

(根据您的应用程序的用途或用途,您还可以考虑将其重新考虑为 QtDesigner 插件......在这种情况下,此功能可能是免费的。)

There is a load(), but no save() in the QUiLoader:

http://developer.qt.nokia.com/doc/qt-4.8/quiloader.html#load

The UI file format is documented, and is XML. So you could write your own .UI file generator:

http://developer.qt.nokia.com/doc/qt-4.8/designer-ui-file-format.html

In fact, you could attack this problem the other way around. Instead of generating the dialog using programmatic widget API calls...instead generate a .UI file with XML. Then you can load it in your app or through QtDesigner.

(Depending on what your app is or is intended to do, you might also look into rethinking it as a QtDesigner plug-in...in which case this functionality might come for free.)

将现有 QDialog 保存到 *.ui 文件

半城柳色半声笛 2024-12-30 16:00:29

以下是如何做到这一点(经过大量测试):

var xhr = Titanium.Network.createHTTPClient();
xhr.open("GET", "https://stream.twitter.com/1/statuses/filter.json?track=<Your-keyword-to-track>", true, '<Your-twitter-nickname>', '<Your-twitter-password>');
xhr.send();

var last_index = 0;
function parse() {
    var curr_index = xhr.responseText.length;
    if (last_index == curr_index) return; // No new data
    var s = xhr.responseText.substring(last_index, curr_index);
    last_index = curr_index;
    console.log(s);
}

var interval = setInterval(parse, 5000);
setTimeout(function(){
    clearInterval(interval);
    parse();
    xhr.abort();
}, 25000);

Here's how to do it (after LOTS of testing):

var xhr = Titanium.Network.createHTTPClient();
xhr.open("GET", "https://stream.twitter.com/1/statuses/filter.json?track=<Your-keyword-to-track>", true, '<Your-twitter-nickname>', '<Your-twitter-password>');
xhr.send();

var last_index = 0;
function parse() {
    var curr_index = xhr.responseText.length;
    if (last_index == curr_index) return; // No new data
    var s = xhr.responseText.substring(last_index, curr_index);
    last_index = curr_index;
    console.log(s);
}

var interval = setInterval(parse, 5000);
setTimeout(function(){
    clearInterval(interval);
    parse();
    xhr.abort();
}, 25000);

架构:Titanium Desktop 与 Twitter Streaming API

半城柳色半声笛 2024-12-30 14:24:06

选择您的构建目标并在“构建阶段”->; “目标依赖项”,将您使用的项目(我猜是 RestKit)添加到列表中。

Choose your build target and in "Build Phases" -> "Target Dependencies", add the project you used (which I guess is RestKit) to the list.

命令 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang 失败

半城柳色半声笛 2024-12-30 09:54:40

您可以通过持久存储来实现它。

查看这个关于存储持久数据的好教程

您也可以使用 SQLite。描述如何在 Java® 应用程序中使用 SQLite 数据库的开发指南链接:将数据存储在 SQLite 数据库中

您可以借助持久数据,使用您自己的逻辑限制用户最多尝试您的应用程序 100 次。但我认为可能有一些约定,所以尝试谷歌一下。

You can achieve it with Persistent Storage.

Check this nice tutorial about storing persistent data.

Also you can use SQLite. Link to a development guide which describes how to use SQLite databases in Java® applications: Storing data in SQLite databases.

You can restrict user for trying your application at most 100 times using your own logic with the help of persistent data. But I think there may be some convention, so try Google for that.

使用持久性显示 BB 应用程序的访问次数?

半城柳色半声笛 2024-12-30 05:31:36

当我仅选择包树中的项目节点并选择“选定资源”单选按钮时,它会在我的 Eclipse 版本中搜索该项目的所有文件。

您还可以选择项目中的任意文件,然后选择“封闭项目”。

When I select just the project node in the package tree and choose the "Selected Resources" radio button, it searches all the files of the project in my version of Eclipse.

You can also select an arbitrary file in a project, and choose "Enclosing project".

如何在Eclipse中搜索项目中的所有文件

半城柳色半声笛 2024-12-30 05:18:46

尝试#1

http://jsfiddle.net/DwApF/3/

这会隐藏阴影并然后在幻灯片完成后恢复它。这是一种破解解决方案,但这是一种可以规避多种行为的方式。

尝试#2

http://jsfiddle.net/DwApF/11/

这会执行同步动画外容器和内容器。它可以毫无瑕疵地滑动投影。但是,您需要手动操纵外部容器的高度,并隐藏内部容器的内容。不过,它确实消除了伪影问题。

尝试 #3 - 我的首选解决方案

http://jsfiddle.net/DwApF/12/

这个仍然使用外部/内部容器的同步动画。我在 IE9 中没有看到任何瑕疵。它还使用overflow:hidden来隐藏内部容器的内容。

外容器的尺寸仍然必须手动完成,但我认为这是一个足够的解决方案。应该有一种方法可以使用 jQuery 确定折叠高度,这样就不需要对该值进行硬编码。

该解决方案适用于 IE9、Chrome 和 Firefox。请注意,我添加了一些颜色/边框,以便更容易看到不同的容器。

Attempt #1

http://jsfiddle.net/DwApF/3/

This hides the shadow and then restores it after the slide is complete. It's a hack of a solution but this is a manner in which a variety of behaviors can be circumvented.

Attempt #2

http://jsfiddle.net/DwApF/11/

This does a simultaneous animation of both outer and inner containers. It slides the drop shadow with no artifacts. However, you will need to manually manipulate the height of the outer container, and also deal with hiding the contents of the inner container. It does eliminate the artifact issue though.

Attempt #3 - My Preferred Solution

http://jsfiddle.net/DwApF/12/

This still uses a simultaneous animation of both outer/inner containers. I see no artifacts in IE9. It also handles hiding the inner container's content using overflow: hidden.

The sizing of the outer container still must be done manually, but I think this is an adequate solution. There should be a way to determine the collapsed height using jQuery so that this value doesn't need to be hard-coded.

This solution works in IE9, Chrome, and Firefox. Note that I have added some colors/borders so that it's easier to see the different containers.

IE9 动画期间的阴影伪像

半城柳色半声笛 2024-12-30 00:44:06

您引用的弹出窗口称为 UIMenuController。您可以访问[UIMenuController sharedMenuController]方法来获取菜单控制器。然后,您可以将自己的 UIMenuItems 添加到菜单控制器。

UIMenuItem* myBtn1 = [[[UIMenuItem alloc] initWithTitle: @"Button 1" action:@selector( onButton1: )] autorelease];
UIMenuItem* myBtn2 = [[[UIMenuItem alloc] initWithTitle: @"Button 2" action:@selector( onButton2: )] autorelease];
UIMenuController* mc = [UIMenuController sharedMenuController];
mc.menuItems = [NSArray arrayWithObjects: myBtn1, myBtn2, nil];

现在实现这些方法

- (void) onButton1: (UIMenuController*) sender
{
}

- (void) onButton2: (UIMenuController*) sender
{
}

有关更多详细信息,请参阅 Apple 的文档。< /a>

编辑

你可以实现长手势

UILongPressGestureRecognizer* gr = [[[UILongPressGestureRecognizer alloc] initWithTarget: self action: @selector( onShowMenu: ) ] autorelease];
   [_myview addGestureRecognizer: gr];



- (void) onShowMenu: (UIGestureRecognizer*) sender
{
    [sender.view becomeFirstResponder];

    UIMenuController* mc = [UIMenuController sharedMenuController];

    CGRect bounds = sender.view.bounds;

    [mc setTargetRect: sender.view.frame inView: sender.view.superview];
    [mc setMenuVisible: YES animated: YES];
}

The popup you refer to is called a UIMenuController. You can access the [UIMenuController sharedMenuController] method to get the menu controller. You can then add your own UIMenuItems to the menu controller.

UIMenuItem* myBtn1 = [[[UIMenuItem alloc] initWithTitle: @"Button 1" action:@selector( onButton1: )] autorelease];
UIMenuItem* myBtn2 = [[[UIMenuItem alloc] initWithTitle: @"Button 2" action:@selector( onButton2: )] autorelease];
UIMenuController* mc = [UIMenuController sharedMenuController];
mc.menuItems = [NSArray arrayWithObjects: myBtn1, myBtn2, nil];

Now implement the methods

- (void) onButton1: (UIMenuController*) sender
{
}

- (void) onButton2: (UIMenuController*) sender
{
}

For more detail refer apple's Doc.

Edit

you can implement Long Gesture

UILongPressGestureRecognizer* gr = [[[UILongPressGestureRecognizer alloc] initWithTarget: self action: @selector( onShowMenu: ) ] autorelease];
   [_myview addGestureRecognizer: gr];



- (void) onShowMenu: (UIGestureRecognizer*) sender
{
    [sender.view becomeFirstResponder];

    UIMenuController* mc = [UIMenuController sharedMenuController];

    CGRect bounds = sender.view.bounds;

    [mc setTargetRect: sender.view.frame inView: sender.view.superview];
    [mc setMenuVisible: YES animated: YES];
}

iphone:UIWebView中的弹出按钮

半城柳色半声笛 2024-12-29 20:26:35

BOOTSTRAP 4

如果你不想用火箭筒杀死苍蝇,可以使用 -webkit-appearance:none;顺便说一句,这也会杀死漂亮的 sliderinputs ,并假设您正在使用引导表单 css 选择器“form-control”作为输入。

这就是解决方案:

.form-control:focus {
    box-shadow: none!important;
    border-color: #ced4da!important;
}

如果您想保留一个微小的蓝色轮廓,请保留边框颜色。

BOOTSTRAP 4

If you do not want to kill a fly with bazooka by use -webkit-appearance:none; which also kills nice sliderinputs btw and presuming you are working with the bootstrap form css selector "form-control" for your input.

This is the solution:

.form-control:focus {
    box-shadow: none!important;
    border-color: #ced4da!important;
}

If you want to keep a tiny small blue outline the leave border-color out.

为什么我无法删除 Twitter Bootstrap 中的蓝色文本区域边框?

半城柳色半声笛 2024-12-29 20:01:34

是的,您应该检查iis应用程序池并确保它正在运行.net 4.0。 (右键单击 iis 中的站点并查看属性,您应该也能够更改它在那里使用的框架。)

并确保稍后在命令提示符中运行“iisreset”命令。

Yes, you should check the iis application pool and make sure it is running .net 4.0. (Right click on the site in iis and see the property, and you should be able to change the framework it uses there too.)

and make sure you run "iisreset" command in command prompt later.

无法识别的配置节 system.web.extensions

更多

推荐作者

α

文章 0 评论 0

メ斷腸人バ

文章 0 评论 0

人间不值得

文章 0 评论 0

往事风中埋

文章 0 评论 0

别理我

文章 0 评论 0

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