Daily Archives

Articles indexed Tuesday April 20 2010

Page 31/121 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • add Constraint on database with trigger

    - by Am1rr3zA
    Hi, I have 3 tables (Student, Course, student_course_choose(have field grade)) I defined a view on these 3 tables that get me an Average of the each student. I want to have constraint(with trigger) on these view(or on the table that need it) to limit the average of each student between 13 and 18. I somewhere read that I must use foreach statement(instead of foreach row) on trigger because when I decrease some grade of special student and his/her average become less than 13 they don't give me error (because later I increase grade of another his/her course ). how must I wrote this Trigger? (I want to implement aprh for testing trigger) note:I can write it in SQL server, oracle or Mysql no diff for me.

    Read the article

  • Fade between looped background images using jQuery

    - by da5id
    I'm trying to get the background image of a legacy div (by which I mean it already has a background image, which I cannot control & thus have to initially over-write) to smoothly fade between new images indefinitely. Here's what I have so far: var images = [ "/images/home/19041085158.jpg", "/images/home/19041085513.jpg", "/images/home/19041085612.jpg" ]; var counter = 0; setInterval(function() { $(".home_banner").css('backgroundImage', 'url("'+images[counter]+'")'); counter++; if (counter == images.length) { counter = 0; } }, 2000); Trouble is, it's not smooth (I'm aiming for something like the innerfade plugin). EDIT: question originally said "and it's not indefinite (it only runs once through the array).", but Mario corrected my stupid naming error. EDIT2: I'm now using Reigel's answer (see below), which works perfectly, but I still can't find any way to fade between the images smoothly. All help greatfully appreciated :)

    Read the article

  • pass parameter from $.post() callback to outer variable

    - by Nazmin
    basically i want to hold a parameter that retrieve value from $.post() call like this: init = function(){ var lastpage = getLastPage(); } function getLastPage(){ $.post("getInfo.php",{ last: "yes" }, function(data){ setLast(data.last); },'json'); return function setLast(data){ return data; } } so when reach at last post (last page) i should check with lastpage variable that has a value returned from getLastPage() function. I'm pretty blur with javascript pointer and all. Please help guys. update (20/4/2010): I've done the other way around, like this: init = function(){ getLastPage(); if((page+1) == $("#lastpage").val()){ alert("this is last post"); }else{ page++; //get info and display to the page here } } function getLastPage(){ $.post("getInfo.php",{ last: "yes" }, function(data){ $("#lastpage").val(data.last); },'json'); } first run the function to temporarily store the value in hidden input tag (lastpage) and then grab the value again to check it whenever i click forward button. if you all have more appropriate way please tell me.

    Read the article

  • Test-only Members: Good or Bad?

    In the article, Dino focuses on two particular situations: dealing with dependencies and testing private members. He'll be discussing this in the context of ASP.NET MVC and MSTest, but without any significant loss of generality.

    Read the article

  • ASPNET WMI class not available

    - by Nexus
    I need to extract the ASPNET\Requests Queued performance counter from some IIS servers via WMI. The WMI class for this sort of thing appears to be contained in Win32_PerfFormattedData_ASPNET_ASPNET. I've queried all available classes in root\cimv2 on my Win 2003/IIS6 servers, and it's not listed. It is, however, available on an unrelated Win2008/IIS7 box (which is interesting but doesn't really help me much) What gives? Why is this WMI class not available on my Windows 2003 servers?

    Read the article

  • Web Page Woth Grey Sides [closed]

    - by Luke
    I'm trying to make a website and I want it to have the same sort of layout as IMDB , with the white page in the middle and the grey sides beyond it. Does anybody know how to do this in HTML or CSS, im a newbie

    Read the article

  • VPS nameserver setup?

    - by mathon12
    Hi, I bought a VPS a few days back and had a domain name registered. It gave me 2 nameservers. I only have shell access (no Cpanel/WHM) and it's running CentOS 5. I can visit my site with http://IP/ but not with http://domain.com. What changes do I need to make so that I can visit my site with http://domain.com. I'm really new at this and any help would be greatly appreciated. Thanks.

    Read the article

  • Help needed on an SQL configuration problem.

    - by user321048
    I have been banging my head with this one more the two weeks, and still don't know what the problem is ( I can't narrow it down). The problem is the following. I have a solution with 3 project in it all written in c# and I with LINQ. One project is the main web site, the other is the data layer (communication with the database) and the third one is a custom little CMS. The problem is the following: On a hosting provider when I publish the site it all works perfectly, but this site was needed to be hosted on the client server so I needed to do that. But the problem is that I also needed to configure the client server, because they don't have an Administrator employed (I know, I know ;) ). For the first time I some how managed, to set it up but a problem appear. My main web site is working just as it suppose to be - it reads (communicates with) the database, but My CMS is not. It shows the first log in page, but after that when I try to log in it throws the following error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4860189 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 System.Data.SqlClient.SqlConnection.Open() +122 System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) +44 System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() +45 System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() +20 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +57 System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +23 System.Linq.Queryable.Count(IQueryable`1 source) +240 CMS.Security.UserProfile.LoginUser() in C:\Documents and Settings\Dimitar\Desktop\New Mepso Final 08_04\CMS\Classes\UserProfile.cs:132 CMS.Default.Login1_Authenticate(Object sender, AuthenticateEventArgs e) in C:\Documents and Settings\Dimitar\Desktop\New Mepso Final 08_04\CMS\Default.aspx.cs:37 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +108 System.Web.UI.WebControls.Login.AttemptLogin() +115 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 Maybe this is a dumb question, but I cannot find the root of the problem, let alone the solution. So far I have tried the following: -setting time out on connection string to a higher value -configuration and after that turning off server firewall -checking the connection string over and over again (they are the same for all three projects and are saved in web.config) Important notes: I have tried executing the project from VS2008 with a connection string to the same database and the results are the same. That's why I think the problem is the SQL Server 2005 and not the IIS7. Any bit of information is more then welcomed.

    Read the article

  • Managing a list of threads

    - by Satanlike
    Hi, I have an application (.Net 3.5) which creates threads to write something to the database so that the GUI does not block. All created threads are added to a list, so that I can wait (Thread.Join) for each thread when the application is closed (maybe not all threads are finished when the application is closed, so the app must wait for them). Because of the list I get some serious problems if there are too many threads created (OutOfMemoryException). I tried removing finished threads from the list, but somehow that didn't work. Are there better ways to manage a list of threads, so I can remove them once they are finished?

    Read the article

  • EJB3 + JEE6: What is a persistent Timer?

    - by Hank
    I'm just about to use the new EJB3 TimerService (as part of Java EE 6), and as usual, I'm impressed by the brevity of JavaDoc :) Do you know what is the effect of the persistent property of the TimerConfig object? JavaDoc TimerConfig says: The persistent property determines whether the corresponding timer has a lifetime that spans the JVM in which it was created. It is optional and defaults to true.

    Read the article

  • XML::LibXML::XPathContext - Question

    - by sid_com
    This script works with and without XPathContext. Why should I use it with XPathContext? #!/usr/bin/env perl use warnings; use strict; use XML::LibXML; use 5.012; my $parser = XML::LibXML->new; my $doc = $parser->parse_string(<<EOT); <?xml version="1.0"?> <xml> Text im Dokument <element id="myID" name="myname" style="old" /> <object objid="001" objname="Object1" /> <element id="002" name="myname" /> </xml> EOT #/ # without XPathContext my $nodes = $doc->findnodes( '/xml/element[@id=002]' ); # with XPathContext #my $root = $doc->documentElement; #my $xc = XML::LibXML::XPathContext->new( $root ); #my $nodes = $xc->findnodes( '/xml/element[@id=002]' ); for my $node ( $nodes->get_nodelist ) { say "Node: ", $node->nodeName; print "Attribute: "; print $_->getName, '=', $_->getValue, ' ' for $node->attributes; say ""; }

    Read the article

  • How to sort the numbers using c#

    - by karthik
    I need some help in code to be able to handle the following logic. The program gets many input in Integers like 10,16,3,17,21,29,6 Logic to be done : scenario : 1 First select the biggest 4 numbers of input which is 16,17,21,29 Now assign the values to A,B,C and D A = smallest in the selected 4 B = biggest in the selected 4 C = second smallest in the selected 4 D = third smallest in the selected 4 Result to be Displayed : A = 16 B = 29 C = 17 D = 21 scenario : 2 If the user gives 3 inputs like 3,6,10 assign only to A,B,C and should ignore D Result to be Displayed : A = 3 B = 10 C = 6

    Read the article

  • how to get Contact database schema.

    - by kamiomar
    Dear, is there any link that provide me the Contact Schema. when i store new phone number in mobile, the informaion store in the database. so i need schema to create my own table for back purpose. i have alreay get People table column by the follwoing code. boolean displayFlag = false; String str = ""; Uri CONTACT_URI = People.CONTENT_URI; Cursor cursor = mContext.getContentResolver().query(CONTACT_URI, null, null, null, null); String columnNames = ""; if (cursor != null) { try { cursor.getCount(); if (cursor.moveToFirst()) { String[] columns = cursor.getColumnNames(); for (int i = 0; i < columns.length; i++) { columnNames += "colName" + cursor.getColumnName(i) + " : " + cursor.getString(i) + "colValue"; } } } finally { cursor.close(); } } createImage(columnNames); if (displayFlag) { Toast.makeText(mContext, str, Toast.LENGTH_SHORT).show(); } } Thanks

    Read the article

  • RMIServer running exception

    - by Mayan Alagar Pandi
    hi, Why this exception happened for RNI Server running. 2java.rmi.server.ExportException: remote object implements illegal remote interf ace; nested exception is: java.lang.IllegalArgumentException: illegal remote method encountered: p ublic abstract java.lang.String RmiServerInterface.message() where message() is remote method. Regards, Alagar

    Read the article

  • C# Multithreading File IO (Reading)

    - by washtik
    We have a situation where our application needs to process a series of files and rather than perform this function synchronously, we would like to employ multi-threading to have the workload split amongst different threads. Each item of work is: 1. Open a file for read only 2. Process the data in the file 3. Write the processed data to a Dictionary We would like to perform each file's work on a new thread? Is this possible and should be we better to use the ThreadPool or spawn new threads keeping in mind that each item of "work" only takes 30ms however its possible that hundreds of files will need to be processed. Any ideas to make this more efficient is appreciated.

    Read the article

  • Flex textarea control not updating properly.

    - by ielashi
    I am writing a flex application that involves modifying a textarea very frequently. I have encountered issues with the textarea sometimes not displaying my modifications. The following actionscript code illustrates my problem: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600"> <mx:TextArea x="82" y="36" width="354" height="291" id="textArea" creationComplete="initApp()"/> <mx:Script> <![CDATA[ private var testSentence:String = "The big brown fox jumps over the lazy dog."; private var testCounter:int = 0; private function initApp():void { var timer:Timer = new Timer(10); timer.addEventListener(TimerEvent.TIMER, playSentence); timer.start(); } private function playSentence(event:TimerEvent):void { textArea.editable = false; if (testCounter == testSentence.length) { testCounter = 0; textArea.text += "\n"; } else { textArea.text += testSentence.charAt(testCounter++); } textArea.editable = true; } ]]> </mx:Script> </mx:Application> When you run the above code in a flex project, it should repeatedly print, character by character, the sentence "The big brown fox jumps over the lazy dog.". But, if you are typing into the textarea at the same time, you will notice the text the timer prints is distorted. I am really curious as to why this happens. The single-threaded nature of flex and disabling user input for the textarea when I make modifications should prevent this from happening, but for some reason this doesn't seem to be working. I must note too that, when running the timer at larger intervals (around 100ms) it seems to work perfectly, so I am tempted to think it's some kind of synchronization issue in the internals of the flex framework. Any ideas on what could be causing the problem?

    Read the article

  • Calculation route length

    - by Paul Peelen
    Hi, I have a map with about 80 annotations. I would like to do 3 things. 1) From my current location, I would like to know the actual route distance to that position. Not the linear distance. 2) I want to be able to show a list of all the annotations, but for every annotation (having lon/lat) I would like to know the actual route distance from my position to that position. 3) I would like to know the closest annotation to my possition using route distance. Not linear distance. I think the answer to all these three points will be the same. But please keep in mind that I don't want to create a route, I just want to know the distance to the annotation. I hope someone can help me. Best regards, Paul Peelen

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >