Daily Archives

Articles indexed Saturday June 5 2010

Page 24/79 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • foreign key and index issue

    - by George2
    Hello everyone, I am using SQL Server 2008 Enterprise. I have a table and one of its column is referring to another column in another table (in the same database) as foreign key, here is the related SQL statement, in more details, column [AnotherID] in table [Foo] refers to another table [Goo]'s column [GID] as foreign key. [GID] is primary key and clustered index on table [Goo]. My question is, in this way, if I do not create index on [AnotherID] column on [Foo] explicitly, will there be an index created automatically for [AnotherID] column on [Foo] -- because its foreign key reference column [GID] on table [Goo] already has primary clustered key index? CREATE TABLE [dbo].[Foo]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [AnotherID] [int] NULL, [InsertTime] [datetime] NULL CONSTRAINT DEFAULT (getdate()), CONSTRAINT [PK_Foo] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] ALTER TABLE [dbo].[Foo] WITH CHECK ADD CONSTRAINT [FK_Foo] FOREIGN KEY([Goo]) REFERENCES [dbo].[Goo] ([GID]) ALTER TABLE [dbo].[Foo] CHECK CONSTRAINT [FK_Foo] thanks in advance, George

    Read the article

  • function takes only half of the inputs

    - by gcc
    /*-> struct sam set_of_data[4] -<*/ int main (void) {int k=0; for(i=0;i<4;++i) { {char nm; double thelow,theupp; double numbers[200]; scanf("%c %lf %lf",&nm ,&thelow ,&theupp); for(k=0;scanf("%lf",&numbers[k])!=0;++k) ; set_of_data[i]=construct_struct(nm,thelow,theupp,numbers,k); } ; } .. /* helper function to construct data structure*/ sam_t construct_struct(char name,double thelow,double theupp,double *numbers,int k) { stored_name_t stn; stn.name=name; stn.the_lower_limit=thelow; stn.the_upper_limit=theupp; for(i=0 ; i<k && numbers[k]!='\n' && numbers[k]!='\0' ; ++i) stn.numbers[k]=numbers[k]; return stn; } these two funtion takes only half of the inputs(lines starting with D and B didnot be taken,why? inputs: C 3.25 18. 0.01 .01 .02 .04 .08 .02 .02 .05 .065 .08 .1 .13 .2 .05 .04 .04 .03 .01 .005 .0 A 0 7.5 .054 .031 .016 .008 .116 .124 .147 .155 .039 .023 .016 .008 .124 .062 .031 .016 .008 .008 .008 .006 D -1.5 0.5 .012 .025 .05 .1 .1 .1 .025 .012 0 0 0 .012 .025 .1 .2 .1 .05 .039 .025 .025 B 1 3 .117 .058 .029 .015 .007 .007 .007 .015 .022 .029 .036 .044 .051 .058 .066 .073 .080 .088 .095 .103

    Read the article

  • Passing parameter map (list of values) to JQuery

    - by bsreekanth
    Hello, to initialize a javascript loaded grid, I need to pass a list of values from controller/gsp. Since the javascript is activated once the page is rendered/loaded, there may not be a direct way to do it. 2 possibilities 1. do an ajax call, and retrieve the list of values from the server 2. store the list in html as a hidden element, and read it from javascript. option 2 seems better as it avoids few calls back to server. So, which control should I use for a list of values? Any jQuery code snippet to read it back into array/list. thanks in advance.

    Read the article

  • In-document schema declarations and lxml

    - by shylent
    As per the official documentation of lxml, if one wants to validate a xml document against a xml schema document, one has to construct the XMLSchema object (basically, parse the schema document) construct the XMLParser, passing the XMLSchema object as its schema argument parse the actual xml document (instance document) using the constructed parser There can be variations, but the essense is pretty much the same no matter how you do it, - the schema is specified 'externally' (as opposed to specifying it inside the actual xml document). If you follow this procedure, the validation occurs, sure enough, but if I understand it correctly, that completely ignores the whole idea of the schemaLocation and noNamespaceSchemaLocation attributes from xsi. This introduces a whole bunch of limitations, starting with the fact, that you have to deal with instance<-schema relation all by yourself (either store it externally or write some hack to retrieve the schema location from the root element of the instance document), you can not validate the document using multiple schemata (say, when each schema governs its own namespace) and so on. So the question is: maybe I am missing something completely trivial or doing it wrong? Or are my statements about lxml's limitations regarding schema validation true? To recap, I'd like to be able to: have the parser use the schema location declarations in the instance document at parse/validation time use multiple schemata to validate a xml document declare schema locations on non-root elements (not of extreme importance) Maybe I should look for a different library? Although, that'd be a real shame, - lxml is a de-facto xml processing library for python and is regarded by everyone as the best one in terms of performace/features/convenience (and rightfully so, to a certain extent)

    Read the article

  • RichFaces Toolbargroup centering a group

    - by Jeremiah
    Hello there I am trying use a toolbar so that it has three parts part A is aligned left part B is aligned Center part C is aligned right both the right and left i can use the location attribute ... but since there is no center attribute i am not able to center part b. I can use a rich:spacer but this makes the toolbar rigid and when the screen size is reduced the toolbar gets overlapped ... is there any i can center this without the toolbar getting over lapped. Any suggestions or workarounds is welcome cheers

    Read the article

  • Accordion nonfunctional in Opera

    - by nona
    While working as expected in all other browsers, opera refuses to tween the height of content. oddly enough, as i sat annoyed rapidly clicking it over and over again, if it's closed, and you select some text, and keep clicking the same spot long enough, sometimes it pops open. lol. seriously. ahh, it seems to sometimes open the first time clicked after the page is loaded. wth? the javascript: window.addEvent('domready', function(){ var content_height = [];i=0; $$( '.bio_accordion' ).each(function(item){ i++; content_height.push(item.getElement('.moreInfo').offsetHeight); var thisSlider = new Fx.Slide( item.getElement( '.moreInfo' ), { mode: 'horizontal' } ); thisSlider.hide(); item.getElement('.moreInfo').set('tween').tween('height', '0px'); var morph = new Fx.Morph(item.getElement( '.divToggle' )); var selected = 0; item.getElement( '.divToggle' ).addEvents({ 'mouseenter': function(){ if(!selected) this.morph('.div_highlight'); }, 'mouseleave': function(){ if(!selected) { this.morph('.divToggle'); } }, 'click': function(){ if (!selected){ if (this.getElement('.symbol').innerHTML == '+') this.getElement('.symbol').innerHTML = '-'; else this.getElement('.symbol').innerHTML = '+'; item.getElement('.moreInfo').set('tween', { duration: 1500, transition: Fx.Transitions.Bounce.easeOut }).tween('height', content_height[i]); selected = 1; thisSlider.slideIn(); } else{ if (this.getElement('.symbol').innerHTML == '+') this.getElement('.symbol').innerHTML = '-'; else this.getElement('.symbol').innerHTML = '+'; thisSlider.slideOut(); item.getElement('.moreInfo').set('tween', { duration: 1000, transition: Fx.Transitions.Bounce.easeOut }).tween('height', '0px'); selected = 0; } } }); } ); }); the html: <div class="bio_accordion"> <div class="divToggle">test<span class="symbol">-</span></div> <div class="moreInfo" style="margin-left:10px;"> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf </div> </div> the css: .bio_accordion { padding:0px; margin:0px; } .divToggle { cursor: pointer; color: #ffffff; background-color:#1089b5; padding: 8px; } .div_highlight { padding-left:30px; padding-right:30px; background-color:#096687; } .moreInfo { padding: 2px; padding-top:15px; padding-bottom:15px; overflow: hidden; } .symbol { float:right; }

    Read the article

  • Application wide messaging... without singletons?

    - by StormianRootSolver
    So, I want to go for a more Singleton - less design in the future. However, there seem to be a lot of tasks in an application that can't be done in meaningful way without singletons. I call them "application wide services", but they also fall into the same category as the cross cutting concerns, which I usually fix via AOP. Lets take an example: I want an application wide message queue that dispatches messages to components, every component can subscribe and publish there, it's a very nice multicast thing. The message queue and dispatching system are usually a (rather short) singleton class, which is very easy to implement in, say, C#. You can even use double dispatching and utilize message type metadata and the like, it's all so easy to do, it's almost trivial. However, having singletons is not really "object oriented design" (it introduces global variables) and it makes testing harder. Do you have any ideas? I'm asking this question because I'm willing to learn more about this topic, a LOT more. :-)

    Read the article

  • Encoding non-English characters

    - by Martin
    Hey there! I'm having a bit of trouble here and I was hoping someone throws me a hint :) I'm getting some GET VARS with JS but I have trouble with non-latin charsets: cyrillic for example. The cyrillic var appears correct in the url but when I retrieve it with JS I get some dummy string. I was wondering of a function similar to "unescape" for such a case. Alternatively, if someone knows a way I could convert a cyrillic string to the same dummy string I get from the URL, it will still do me the trick, since all I need is compare. :) Thanks! Martin

    Read the article

  • User settings mechanism for Yii

    - by Peterim
    Hi guys! I need some help with user settings mechanism for my Yii-based application. I've created the following db structure to store user settings: table user with the following fields id | username | email | etc. table settingslist (to store a list of all possible settings with descriptions) with the following fields id | code | name | description table settings (to store all user settings) with the following fields id | userid | settingslistcode | value Now I'm stuck with the form which allows user to change his settings. I had to deal before with the regular models (i.e. for posts, comments, etc.) where every new model had only one row in the database (Post model - id | title | body |) with the certain amount of attributes (fields of the table). But now I need to store user settings in 10-15 rows and I don't know how to apply Yii model mechanism to work with this, so I can retrieve those settings in a single form (so user could change his preferences). Any suggestions are greatly appreciated. Thank you!

    Read the article

  • How to load a library that depends on another library, all from a jar file

    - by Philip
    I would like to ship my application as a self-contained jar file. The jar file should contain all the class files, as well as two shared libraries. One of these shared libraries is written for the JNI and is essentially an indirection to the other one (which is 100% C). I have first tried running my jar file without the libraries, but having them accessible through the LD_LIBRARY_PATH environment variable. That worked fine. I then put the JNI library into the jar file. I have read about loading libraries from jar files by copying them first to some temporary directory, and that worked well for me (note that the 100% C library was, I suppose, loaded as before). Now I want to put both libraries into the jar, but I don't understand how I can make sure that they will both be loaded. Sure I can copy them both to a temporary directory, but when I load the "indirection" one, it always gives me: java.lang.UnsatisfiedLinkError: /tmp/.../libindirect.so: /libpure.so: cannot open shared object file: No such file or directory I've tried to force the JVM to load the "100% C" library first by explicitely calling System.load(...) on its temporary file, but that didn't work better. I suspect the system is looking for it when resolving the links in libindirect.so but doesn't care about what the JVM loaded. Can anyone help me on that one? Thanks

    Read the article

  • Is OOP based on any branch of mathematics?

    - by ektrules
    I know relational databases are based on set-theory, functional programming is based on lambda calculus, logic programming is based on logic (of course :)), and now that I think of it; I'm not sure if imperative and generic programming is based on any particular branch of mathematics either.

    Read the article

  • solution for different tab bars in other screen

    - by haicnpmk44
    Hi Guys I am finding the solution for my application. I create an iphone application have 3 screen: First screen not contain any tab bar. Second screen have 2 tab bar item. Third screen have 3 tab bar item. http://c.upanh.com/upload/7/719/L50.11932623_1_1.jpg If i create a UITabBarController - the tab bar will be appeared from first screen. So I have to hide tab bar in first screen. But second and third screen have different tab bar - not good idea. Do you have solution for this issue, please help me. Thank you !!!

    Read the article

  • how to show all method and data when the object not has "__iter__" function in python..

    - by zjm1126
    i find a way : (1):the dir(object) is : a="['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__', '_errors', '_fields', '_prefix', '_unbound_fields', 'confirm', 'data', 'email', 'errors', 'password', 'populate_obj', 'process', 'username', 'validate']" (2): b=eval(a) (3)and it became a list of all method : ['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__', '_errors', '_fields', '_prefix', '_unbound_fields', 'confirm', 'data', 'email', 'errors', 'password', 'populate_obj', 'process', 'username', 'validate'] (3)then show the object's method,and all code is : s='' a=eval(str(dir(object))) for i in a: s+=str(i)+':'+str(object[i]) print s but it show error : KeyError: '__class__' so how to make my code running . thanks

    Read the article

  • On Mac, two jpg's whose color should match do not

    - by Tim
    So I'm designing a myspace page and I have two images, one is a repeating bg image, and another is an image which loads on a layer above it, which acts as a header/masthead. For some reason, on Macs only, and only in the browser (tested in safari and ff), the masthead renders slightly darker than the repeating bg image, creating this color inconsistency. The block that extends up behind the album artwork is a solid box made with css which blocks some of myspace's standard content. It actually renders as the proper color, blending in well with the bottom portion of this image, which is the repeating part of the background, but becomes noticeable as it extends up, over the masthead, which is darker than it should be. Both images where created in GIMP and saved as jpg's using, as far as i can tell, the same settings. Here's the pic of what is going on: Screenshot - Click Me!!! Here is the code which controls this part of the design. <div class="masthead"><span></span></div> .masthead {width: 1600px; height: 1940px; background-image:url(http://www.sourtricks.com/myspace/bdww/myspace_bg09.jpg); position: absolute; margin-left: -800px; left: 50%; top: 0px; z-index: -1; overflow-x: hidden;} body.bodyContent{ margin: 0 !important; padding: 0 !important; background-color: 000000 !important; font-size: 1px; background-image: url(http://www.sourtricks.com/myspace/bdww/bg_repeat05.jpg); background-position: center bottom; _background-position: right bottom; background-attachment: scroll; background-repeat: repeat-y; z-index: -2; overflow-x: hidden; font-family: arial, sans-serif !important; } Any help would be much, much, much appreciated. Thanks for your time, Tim

    Read the article

  • UIWebView - get total height of contents using Javascript

    - by Emil
    Hey. I'm trying to use a UIWebView for displaying content higher than the screen of the iPhone, without needing to scroll in the webView itself. For that, I need a way to get the total document size, including the scrollable area. I have tried a number of different Javascript solutions: (document.height !== undefined) ? document.height : document.body.offsetHeight // Returns height of UIWebView document.body.offsetHeight // Returns zero document.body.clientHeight // Returns zero document.documentElement.clientHeight // Returns height of UIWebView window.innerHeight // Returns height of UIWebView -2 Can you think of any other way to do it? Thanks.

    Read the article

  • Third party Application's Idle Session expiry

    - by Manjoor
    We have a third party application running. It shows login dialog when idle for 20 minutes. We need to prevent the application to display login screen. We do not have any idea how idle state is handled internally in that application. We have done the follwoing with no luck. Created an small application in c# which focus it after every 5 minutes (using SetForegroundWindow()) and send a BM_CLICK message to one of its child window. Does not work. focus it after every 5 minutes (using SetForegroundWindow()) and move the cursor few pixels then restore cursor at its previous position. This does not work too! Is there any other way to achieve the goal?

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >