问题列表 - 第42224页

Hibernate - 加入un相关对象

我有一个要求,其中我必须使用Hibernate HQL加入两个不相关的对象.这是POJO类的示例

class Product{
int product_id;        
String name;
String description;
}
Run Code Online (Sandbox Code Playgroud)

Class Item{
int item_id;
String name;
String description;
int quantity;
int product_id; //Note that there is no composed product object.
}
Run Code Online (Sandbox Code Playgroud)

现在我想在p.product_id = i.item_id上执行类似select*from Product p left outer join Item i的查询

我想要一个多维数组作为此查询的输出,这样我就可以拥有Product和Item的单独实例,而不是另一个实例.在Hibernate中有没有办法做到这一点?

hibernate hql

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

MySQL与DB2 Express-C

我今天开始了解Free DB2 Express C. 我有几个问题.有人可以告诉我

  • Free DB2 Express C与MySQL相比如何?
  • 从MySQL切换到Express C是一个坏主意吗?
  • 免费版有哪些限制?我在其网站上找不到这些信息.

mysql database db2

4
推荐指数
1
解决办法
4040
查看次数

SWI-Prolog编辑器的问题

前段时间我正在摆弄SWI-Prolog编辑器,试图让某些东西起作用,我改变了一些配置设置.它没有用,所以我把它改回来了.现在SWI-Prolog编辑器工作不正常.我将加载文件但是当我点击'consult'时它会抛出这个错误:

协商( 'C:/Users/Cubearth/Documents/Prolog/'filename.pl').

我无法在知识库上执行查询......它什么也没做.我知道它应该返回:

% library(win_menu) compiled into win_menu 0.00 sec, 20,952 bytes
% library(swi_hooks) compiled into pce_swi_hooks ......... (etc, etc)

For help, use ?- help(Topic). or ?- apropos(Word).
Run Code Online (Sandbox Code Playgroud)

但我甚至没有得到那个.我尝试卸载prolog和编辑器,但仍然没有运气.

有想法该怎么解决这个吗?

为了帮助,我已经包含了prolog的配置转储:

安装

  C:\Program Files (x86)\SWIPrologEditor\SWIMachine.ini
  C:\Users\Cubearth\AppData\Roaming\SWIPrologEditor\SWIUser.ini
  C:\Users\Cubearth\AppData\Roaming\SWIPrologEditor\SWIColor.ini

[SWI]
PortableApplication=0 
Verzeichnis=C:\Program Files\pl
Manual=C:\Program Files\pl\bin\doc\Manual\Contents.html
XPCE=C:\Program Files\pl\bin\doc\UserGuide\Contents.html 

[Program] 
InterpreterParameter=-L32M 
FileExtension=.pl 

[Editor] 
TabWidth=2 
Indent=2 
Indenthelp=1 
AutomaticIndent=1 
FileTab=1 
Linenumbering=1 
BracketPair=0 
CursorBehindLine=1 
Author= 
Encoding=0 
Structure=0 

[Code] 
Code-Completion=1 
Parameter-Hints=1 
Delay=100 

[Options] 
ColoredConsole=1 
IntegratedWindow=1 
ReturnToContinue=1 
TraceStopsDebugToo=1 
BAKFiles=1 
RemoveWriteProtection=1 
FileTabsMultiline=1 
Language=C:\Program Files (x86)\SWIPrologEditor\english.ini 

[Browser]
UseIEinternForDocuments=1 …
Run Code Online (Sandbox Code Playgroud)

editor swi-prolog

1
推荐指数
1
解决办法
5263
查看次数

C#WinForms MDI问题

你好guyes我有一个问题我有1个父母形式和3个孩子我只是想打开他们最大化但是当我在左侧做这个3控制.如何在没有此控件的情况下打开一个表单.如果我以错误的方式做这件事,请告诉我一些mdi对这些事情好吗?

请看这张图片http://img440.imageshack.us/img440/6831/mdinz.jpg http://img139.imageshack.us/img139/4687/mdi1.jpg

c# mdi winforms

1
推荐指数
1
解决办法
1435
查看次数

禁用文本框中的HTML文本颜色

我有一个text boxHTML,我已设置text boxdisabled,

<input type="text" style="background-color:transparent; text-align:center" disabled="disabled" />
Run Code Online (Sandbox Code Playgroud)

所以这里的文字颜色text box是灰色的,我怎么能把它改成我想要的任何颜色?

html textbox

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

NSMenuItem自定义视图上方的差距

我在a上使用setView:方法NSMenuItem来设置自定义视图.在此自定义视图中,有一个图像占据整个视图.在NSMenuItem这个自定义视图是在菜单的第一个,但问题是,它不坐与菜单的顶部齐平,有很大的差距,你可以在这里看到:

替代文字

为什么会这样,我怎么能阻止它呢?


编辑

我现在正在使用此代码,但我正在EXC_BAD_ACCESS上线InstallControlEventHandler.

-(void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    HIViewRef contentView;
    MenuRef menuRef = [statusMenu carbonMenuRef];

    HIMenuGetContentView(menuRef, kThemeMenuTypePullDown, &contentView);

    EventTypeSpec hsEventSpec[1] = {
        { kEventClassMenu, kEventMenuCreateFrameView }
    };

    InstallControlEventHandler(contentView,
                           NewEventHandlerUPP((EventHandlerProcPtr)hsMenuCreationEventHandler),
                           GetEventTypeCount(hsEventSpec),
                           hsEventSpec,
                           NULL,
                           NULL); // Get EXC_BAD_ACCESS here.
}

static OSStatus hsMenuContentEventHandler( EventHandlerCallRef caller, EventRef event, void* refcon )
{
    OSStatus  err;

    check( GetEventClass( event ) == kEventClassControl );
    check( GetEventKind( event ) == kEventControlGetFrameMetrics );

    err = CallNextEventHandler( caller, event ); …
Run Code Online (Sandbox Code Playgroud)

macos cocoa objective-c nsmenu nsmenuitem

19
推荐指数
1
解决办法
3817
查看次数

如何在OS X下从Applescript调用可可方法

在以前的OS X版本(10.6之前的版本)中,可以通过applescript(“ Applescript Studio”)中的“ call method”命令来调用Cocoa方法。例如,这种方式: “ Applescript编辑器”(10.6)中的脚本解释器不理解命令“ call method”。-“ Applescript编辑器”(10.6)是否等效? set theURL to "http://www.apple.com" set URLWithString to (call method "stringByAddingPercentEscapesUsingEncoding:" of theURL with parameter 30)

macos cocoa applescript objective-c

5
推荐指数
1
解决办法
1882
查看次数

如何在TabLayout中为每个活动设置图标到标题栏

在我的tablayout示例中,我创建了3个选项卡,因为通常我为每个选项卡设置3个活动.我可以将图像设置为活动的标题栏,这会将意图添加到每个选项卡.因此,标题栏中的图像在所有3个选项卡中都可见.我的要求是为每个活动的标题栏设置不同的图像.我按照这个将图像设置为标题栏.但是,当我要对每个活动执行相同的操作时,android.util.AndroidRuntimeException: You cannot combine custom titles with other title features会终止此错误和应用程序.

的manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.aptitsolution.tablayout"
  android:versionCode="1"
  android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/MyTheme">
    <activity android:name=".TabLayoutDemo"
              android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

 <activity android:name="AlbumsActivity"></activity>
Run Code Online (Sandbox Code Playgroud)

TabLayoutDemo.java

public class TabLayoutDemo extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(R.layout.main);
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.my_title);

    Resources res = getResources(); 
    TabHost tabHost = getTabHost(); 
    TabHost.TabSpec spec;  
    Intent intent;  

    intent = …
Run Code Online (Sandbox Code Playgroud)

android

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

Windows下iOS开发的替代方案

可能重复:
如何使用Windows开发机器为iPhone开发?
Windows上的iPhone开发

我刚买了新iPad,现在我有两台iOS设备,一台iPod和一台iPad.所以我意识到iOS是一个很好的操作系统来开发一些东西,但问题是我在Windows下,我没有任何购买Mac的计划.无论如何我想要的不是SDK for Windows的端口,所以我可以用Objective-C开发.但我想知道的是所有(也许)我必须为iPad开发的替代品(我现在更感兴趣)和其他iOS设备.

PS:我对应用程序开发感兴趣,而不是游戏开发

iphone port windows-7 ipad ios

41
推荐指数
3
解决办法
4万
查看次数

在coffeescript中编写jquery插件 - 如何获取"(function($)"和"(jQuery)"?

我在coffeescript中编写了一个jquery插件,但我不确定如何使函数包装器部分正确.

我的coffeescript从这开始:

$.fn.extend({
    myplugin: ->
        @each ->
Run Code Online (Sandbox Code Playgroud)

哪个用函数包装器创建javascript:

(function() {
  $.fn.extend({
      myplugin: function() {
          return this.each(function() {
Run Code Online (Sandbox Code Playgroud)

但我希望像这样传入'$':

(function($) {
  $.fn.extend({
Run Code Online (Sandbox Code Playgroud)

类似于我的结局......在coffeescript中没有特别的.
我在javascript中得到这个:

})();
Run Code Online (Sandbox Code Playgroud)

但是想这样:

})(jQuery);
Run Code Online (Sandbox Code Playgroud)

有谁知道如何使用coffeescript编译器实现这一目标?或者在coffeescript中完成这项工作的最佳方法是什么?

javascript jquery coffeescript

36
推荐指数
3
解决办法
1万
查看次数