Search Results

Search found 13112 results on 525 pages for 'exception duck'.

Page 53/525 | < Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >

  • AssemblyCleanup() after test fail/exception

    - by Tommy Jakobsen
    Hello, I'm running a few unit tests that requires a connection to the database. When my test project get initialized, a snapshot of the database is created, and when tests are done the database gets restored back to the snapshot. Here is the implementation: [TestClass] public static class AssemblyInitializer { [AssemblyInitialize()] public static void AssemblyInit(TestContext context) { var dbss = new DatabaseSnapshot(...); dbss.CreateSnapshot(); } [AssemblyCleanup()] public static void AssemblyCleanup() { var dbss = new DatabaseSnapshot(...); dbss.RevertDatabase(); } } Now this all works, but my problem arise when I have a failing test or some exception. The AssemblyCleanup is of course not invoked, so how can I solve this problem? No matter what happens, the snapshot has to be restored. Is this possible?

    Read the article

  • Java invalid stream header Problem

    - by David zsl
    Hi all, im writen a client-server app, and now i´m facing a problem that I dont know how to solve: This is the client: try { Socket socket = new Socket(ip, port); ObjectOutputStream ooos = new ObjectOutputStream(socket .getOutputStream()); SendMessage message = new SendMessage(); message.numDoc = value.numDoc; message.docFreq = value.docFreq; message.queryTerms = query; message.startIndex = startIndex; message.count = count; message.multiple = false; message.ips = null; message.ports = null; message.value = true; message.docFreq = value.docFreq; message.numDoc = value.numDoc; ooos.writeObject(message); ObjectInputStream ois = new ObjectInputStream(socket .getInputStream()); ComConstants mensajeRecibido; Object mensajeAux; String mensa = null; byte[] by = null; do { mensajeAux = ois.readObject(); if (mensajeAux instanceof ComConstants) { System.out.println("Thread by Thread has Search Results"); String test; ByteArrayOutputStream testo = new ByteArrayOutputStream(); mensajeRecibido = (ComConstants) mensajeAux; byte[] wag; testo.write( mensajeRecibido.fileContent, 0, mensajeRecibido.okBytes); wag = testo.toByteArray(); if (by == null) { by = wag; } else { int size = wag.length; System.arraycopy(wag, 0, by, 0, size); } } else { System.err.println("Mensaje no esperado " + mensajeAux.getClass().getName()); break; } } while (!mensajeRecibido.lastMessage); //ByteArrayInputStream bs = new ByteArrayInputStream(by.toByteArray()); // bytes es el byte[] ByteArrayInputStream bs = new ByteArrayInputStream(by); ObjectInputStream is = new ObjectInputStream(bs); QueryWithResult[] unObjetoSerializable = (QueryWithResult[])is.readObject(); is.close(); //AQUI TOCARIA METER EL QUICKSORT XmlConverter xce = new XmlConverter(unObjetoSerializable, startIndex, count); String serializedd = xce.runConverter(); tempFinal = serializedd; ois.close(); socket.close(); } catch (Exception e) { e.printStackTrace(); } i++; } And this is the sender: try { QueryWithResult[] outputLine; Operations op = new Operations(); boolean enviadoUltimo=false; ComConstants mensaje = new ComConstants(); mensaje.queryTerms = query; outputLine = op.processInput(query, value); //String c = new String(); //c = outputLine.toString(); //StringBuffer swa = sw.getBuffer(); ByteArrayOutputStream bs= new ByteArrayOutputStream(); ObjectOutputStream os = new ObjectOutputStream (bs); os.writeObject(outputLine); os.close(); byte[] mybytearray = bs.toByteArray(); ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(mybytearray); BufferedInputStream bis = new BufferedInputStream(byteArrayInputStream); int readed = bis.read(mensaje.fileContent,0,4000); while (readed > -1) { mensaje.okBytes = readed; if (readed < ComConstants.MAX_LENGTH) { mensaje.lastMessage = true; enviadoUltimo=true; } else mensaje.lastMessage = false; oos.writeObject(mensaje); if (mensaje.lastMessage) break; mensaje = new ComConstants(); mensaje.queryTerms = query; readed = bis.read(mensaje.fileContent); } if (enviadoUltimo==false) { mensaje.lastMessage=true; mensaje.okBytes=0; oos.writeObject(mensaje); } oos.close(); } catch (Exception e) { e.printStackTrace(); } } And this is the error log: Thread by Thread has Search Results java.io.StreamCorruptedException: invalid stream header: 20646520 at java.io.ObjectInputStream.readStreamHeader(Unknown Source) at java.io.ObjectInputStream.<init>(Unknown Source) at org.tockit.comunication.ServerThread.enviaFicheroMultiple(ServerThread.java:747) at org.tockit.comunication.ServerThread.run(ServerThread.java:129) at java.lang.Thread.run(Unknown Source) Where at org.tockit.comunication.ServerThread.enviaFicheroMultiple(ServerThread.java:747) is this line ObjectInputStream is = new ObjectInputStream(bs); on the 1st code just after while (!mensajeRecibido.lastMessage); Any ideas?

    Read the article

  • java.lang.ClassFormatError: Extra bytes at end of class file

    - by CheesePls
    I'm getting an odd error when I try and run this program. The class compiles fine into multiple .class files and I compiled it last week (before editing it) just fine. But now, I see this: Exception in thread "main" java.lang.ClassFormatError: Extra bytes at the end of class file blah/hooplah/fubar/nonsense/IndexId$Transaction From what I've looked up, Java 6 build 1.5 could fix it since it allows extra bytes at the end of class files (I think), but I would much rather use build 1.6. Any clear ideas on how this happened or how to fix it?

    Read the article

  • HttpWebRequest and BindIPEndPointDelegate getting socket exception

    - by Evgeny Gavrin
    I've got c# code running on a computer with multiple network interfaces, and the following code to select an IP address for a HttpWebRequest to bind ServicePoint: HttpWebRequest request = (HttpWebRequest)WebRequest.Create(remoteFilename); request.KeepAlive = false; request.ServicePoint.BindIPEndPointDelegate = delegate( ServicePoint servicePoint, IPEndPoint remoteEndPoint, int retryCount) { return new IPEndPoint(IPAddress.Parse(ipAddr), 0); }; But it works only for one of the available network interfaces. Trying to access remote server through others throws an exception: System.Net.WebException: Unable to connect to the remote server --- System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable network How can it be solved?

    Read the article

  • WMI Win32_OperatingSystem OSArchitecture field causes exception

    - by Andrew J. Brehm
    I am trying to get information on the version of Windows installed from WMI. Most fields work. I can get the operating system "Name" as well as the "Version", both are fields of the Win32_OperatingSystem object I have. But another field "OSArchitecture" generates an exception ("Not found"). strScope = "\\" + strServer + "\root\CIMV2" searcher = New ManagementObjectSearcher(strScope, "SELECT * FROM Win32_OperatingSystem") For Each mo In searcher.Get strOSName = mo("Name") strOSVersion = mo("Version") strOSArchitecture = mo("Architecture") strStatus = mo("Status") strLastBoot = mo("LastBootUpTime") Next The documentation says that the field ought to exist and is a String: http://msdn.microsoft.com/en-us/library/aa394239(VS.85).aspx Any ideas?

    Read the article

  • WMI Win32_OperatingSystem OSArchitecture field causes exception

    - by Andrew J. Brehm
    I am trying to get information on the version of Windows installed from WMI. Most fields work. I can get the operating system "Name" as well as the "Version", both are fields of the Win32_OperatingSystem object I have. But another field "OSArchitecture" generates an exception ("Not found"). strScope = "\\" + strServer + "\root\CIMV2" searcher = New ManagementObjectSearcher(strScope, "SELECT * FROM Win32_OperatingSystem") For Each mo In searcher.Get strOSName = mo("Name") strOSVersion = mo("Version") strOSArchitecture = mo("Architecture") strStatus = mo("Status") strLastBoot = mo("LastBootUpTime") Next Ignore the for each loop, I don't think it has anything to do with the field missing. The documentation says that the field ought to exist and is a String: http://msdn.microsoft.com/en-us/library/aa394239(VS.85).aspx Any ideas?

    Read the article

  • QuickReport throws "There Is No Default Printer Currently Selected" Exception

    - by M Schenkel
    I have created a Delphi Service which prints TQuickReports. Everything works fine if compiled and run as a Windows Application. But when converted to operate as a service trying to create a form containing a TQuickRep component throws the exception. This service runs fine on many other boxes but not this one in particular. Here are some details: Using QuickReport version 4.07 Box is a Windows Server 2008 operating system. Using Delphi 2007 Printer.Printers.Count is returning a positive value. In fact I can list out all of the printers. I have tried running the service both using Local System Account and Logged on as an Admin.

    Read the article

  • WCF Data Service Exception

    - by Ravi
    Hi, I am working on C#.Net with ADO.NET Dataservice WCF Data Services. I try to update one record to relational table, when I reach context.SetLink() I am getting exception("The context is not currently tracking the entity"). I don't know how to solve this problem. My code is specified below. LogNote dbLogNote =logNote; LogSubSession dbLogSubSession = (from p in context.LogSubSession where p.UID == logNote.SubSessionId select p).First<LogSubSession>() as LogSubSession; context.AddToLogNote(dbLogNote); dbLogNote.LogSubSession = dbLogSubSession; context.SetLink(dbLogNote, "LogSubSession", dbLogSubSession); context.SaveChanges(); Here LogSubSession is a primary table and LogNote is a foreign table. I am updating data into foreign table based on primary key table. Thanks

    Read the article

  • c#, asp.net, dynamicdata Validation Exception Message Caught in JavaScript, not DynamicValidator (Dy

    - by Perplexed
    I have a page here with a few list views on it that are all bound to Linq data sources and they seem to be working just fine. I want to add validation such that when a checkbox (IsVoid on the object) is checked, comments must be entered (VoidedComments on the object). Here's the bound object's OnValidate method: partial void OnValidate(ChangeAction action) { if (action == ChangeAction.Update) { if (_IsVoid) { string comments = this.VoidedComments; if (string.IsNullOrEmpty(this._VoidedComments)) { throw new ValidationException("Voided Comments are Required to Void an Error"); } } } } Despite there being a dynamic validator on the page referencing the same ValidationGroup as the dynaimc control, when the exception fires, it's caught in JavaScript and the debugger wants to break in. The message is never delivered to the UI as expected. Any thoughts as to What's going on?

    Read the article

  • Fluent NHibernate - exception occurred during configuration of persistence layer

    - by inutan
    Hello there, I am using Fluent NHibernate with an external 'hibernate.cfg.xml' file. Following is the configuration code where I am getting error: var configuration = new Configuration(); configuration.Configure(); _sessionFactory = Fluently.Configure(configuration) .Mappings(m => m.FluentMappings.AddFromAssemblyOf<Template>()) .BuildSessionFactory(); return _sessionFactory; But When NHibernate is trying to configure, I am getting floowing error: An exception occurred during configuration of persistence layer. Please help.

    Read the article

  • OpenCV 2.0 C++ API using imshow: returns unhandled exception and "bad-flag"

    - by Konrad
    I'm trying to use the new OpenCV 2.0 API in MS Visual C++ 2008 and wrote this simple program: cv::Mat img1 = cv::imread("image.jpg",1); cv::namedWindow("My Window", CV_WINDOW_AUTOSIZE); cv::imshow("My Window", img1); Visual Studio returnes an unhandled exception and the Console returns: OpenCV Error: bad flag (parameter or structure field) (Unrecognized or unsupported array type) in unknown function, file ..\..\..\..\ocv\opencv\src\cxcore\cxarray.cpp, line 2376 The image is not displayed. Furthermore the window "My Window" has a strange caption: "ÌÌÌÌMy Window", which is not dependent on the name. The "old" C API using commands like cvLoadImage, cvNamedWindow or cvShowImage works without any problem for the same image file. I tried a lot of different stuff without success. I appreciate any help here. Konrad

    Read the article

  • LIST<> AddRange throwing ArgumentException

    - by Tim
    Hi all, I have a particular method that is occasionally crashing with an ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.: at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable) at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex) at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection) The code that is causing this crash looks something like this: List<MyType> objects = new List<MyType>(100); objects = FindObjects(someParam); objects.AddRange(FindObjects(someOtherParam); According to MSDN, List<.AddRange() should automatically resize itself as needed: If the new Count (the current Count plus the size of the collection) will be greater than Capacity, the capacity of the List<(Of <(T)) is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added. Can someone think of a circumstance in which AddRange could throw this type of exception?

    Read the article

  • 'System.Windows.Forms.AxHost+InvalidActiveXStateException' in WPF

    - by Gagan
    I am trying to make a WPF Application and using the Visio Controls. I have a dll named AxInterop.Microsoft.Office.Interop.VisOcx and I refer it to instantiate an object of the type AxDrawingControl(). Now as soon as I write this code: AxDrawingControl objDrawControl=new AxDrawingControl(); and check the attributes of this object objDrawControl in the debug mode, I see this message: Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown. Here is how it looks like: Please help me to get this thing resolved! Please!

    Read the article

  • NServiceBus FullDuplex sample compiled and debugging against .NET 4.0 framework throws exception

    - by Jim
    I just installed VS2010 RC and launched the FullDuplex sample from NServiceBus 2.0.0.1145 and it ran fine. I then changed the target framework of each project in the solution to ".NET Framework 4", recompiled and launched in the debugger and received the following exception: System.InvalidOperationException was unhandled Message=No endpoint configuration found in scanned assemblies. This usually happens when NServiceBus fails to load your assembly contaning IConfigureThisEndpoint. Try specifying the type explicitly in the NServiceBus.Host.exe.config using the appsetting key: EndpointConfigurationTypeScanned path: C:\Development\Personal\ThirdParty\NServiceBus\samples\FullDuplex\MyClient\bin\Debug\ Source=NServiceBus.Host StackTrace: at NServiceBus.Host.Program.ValidateEndpoints(IEnumerable`1 endpointConfigurationTypes) in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Program.cs:line 189 at NServiceBus.Host.Program.GetEndpointConfigurationType() in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Program.cs:line 171 at NServiceBus.Host.Program.Main(String[] args) in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Program.cs:line 32 InnerException:

    Read the article

  • Selenium and Headless Environment

    - by sdmythos_gr
    I recently installed Python 2.7, Robot Framework and the Selenium Library (I still don't know if I succeded though...) on a Red Hat Server to run some test on a web application. So I tried a simple test case using the robot framework to see if Selenium Library is functional, just to Open a web page, nothing more... Selenium Server is up and running according to the result of ps, and firefox binaries are in the PATH... Running the test case from the Robot Framework (with the pybot testcasename.tsv) I get an exception: ERROR: Problem capturing a screenshot to string: java.awt.AWTException: headless environment So, what is the Headless Environment? Does anyone have an idea if there is something else that needs to be istalled or to be configured as well?

    Read the article

  • Exception from HRESULT: 0x800A03EC

    - by Daniel
    Any help is appreciated: I'm developing a C#.Net app in VS2010 that interacts with Excel. The app works correctly on my local machine. Uploading to a remote Windows 2003 server however, breaks the app. Originally, I received the following message Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 After Googling the problem (which suggested a permissions problem) i tried this: Installing Excel 2007 Going into Component Services on the remote server and following the instructions here: http://blog.crowe.co.nz/archive/2006/03/02/589.aspx Now I get this message on the same operation: Exception from HRESULT: 0x800A03EC Google searches seem to be suggesting that this is a version match error. However, both the local machine and the remote server use Excel 2007. Any suggestions would be very welcome. Thanks in advance. -Daniel

    Read the article

  • NHibernate WCF Rest IIS7 Fails with Security Exception

    - by RyanFetz
    Here is the error: System.TypeInitializationException: The type initializer for 'NHibernate.Cfg.Environment' threw an exception. --- System.Security.SecurityException: Request for ConfigurationPermission failed while attempting to access configuration section 'hibernate-configuration'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared. --- System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) We have the trust level set to Full. Note also that we also have a web site that runs the SAME Nhibernate code and has NO issues. Only the WCF REst Web Service Application has this error? Any Thoughts as to WHY this is a problem?

    Read the article

  • Single-threaded apartment - cannot instantiate ActiveX control

    - by martin.malek
    I need to get information about applied CSS styles in HTML page. I used AxWebBrowser and iterate IHTMLDOMNode. I'm able to get all the data I need and move the code into my application. The problem is that this part is running inside of the background worker and I got exception when trying to instantiate the control. AxWebBrowser browser = new AxWebBrowser(); ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment. Is there any way how to solve this or other option than AxWebBrowser?

    Read the article

  • Exception when creating new Iphone/Ipad window in MonoDevelop

    - by Jones D R
    I get this exception every time i try to create a new Iphone/Ipad solution? I have been following the guides and have both XCode, interface builder and IOS SDK installed. Any clues are welcome:) System.ApplicationException: Can't create display binding for mime type: application/vnd.apple-interface-builder at MonoDevelop.Ide.Gui.Workbench.NewDocument (System.String defaultName, System.String mimeType, System.IO.Stream content) [0x00000] in :0 at MonoDevelop.Ide.Templates.FileTemplate.CreateFile (MonoDevelop.Ide.Templates.FileDescriptionTemplate newfile, MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String directory, System.String language, System.String name) [0x00000] in :0 at MonoDevelop.Ide.Templates.FileTemplate.Create (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String directory, System.String language, System.String name) [0x00000] in :0 at MonoDevelop.Ide.Projects.NewFileDialog.OpenEvent (System.Object sender, System.EventArgs e) [0x00000] in :0

    Read the article

  • How to solve lazy initialization exception using JPA and Hibernate as provider

    - by rupertin
    I am working on a project for a customer who wants to use lazy initialization. They always get "lazy initialization exception" when mapping classes with the default lazy loading mode. @JoinTable(name = "join_profilo_funzionalita", joinColumns = {@JoinColumn(name = "profilo_id", referencedColumnName = "profilo_id")}, inverseJoinColumns = {@JoinColumn(name = "funzionalita_id", referencedColumnName = "funzionalita_id")}) //@ManyToMany(fetch=FetchType.EAGER) - no exceptions if uncommented @ManyToMany private Collection<Funzionalita> funzionalitaIdCollection; Is there a standard pattern using JPA classes to avoid this error? Snippets are welcome, thanks a lot for your time.

    Read the article

  • Microsoft Workflow - "Event cannot be delivered"

    - by Wojtek
    I have strange problem. My application is using Windows Workflow Foundation. It is simple app that creates requests and then other presons accepts/denies these requests. Everything was working very fine until my client took application to other servers (app and db). From this time WF instances are created in DB but when app tries to fire event to WF instance it strikes exception: "Event "EventName" for instance id "instanceGUID" cannot be delivered". What went wrong? Any suggestion where to start find the problem?

    Read the article

  • Suggestion for chkstk.asm stackoverfolw exception in C++ with Visual Studio 2010

    - by Gulshan
    I am working with an implementation of merge sort. I am doing C++ Visual Studio 2010. But when I took a array of 300000 integers for timing, it is showing an unhandled stackoverflow exception and taking me to a readonly file named "chkstk.asm". I reduced the size to 200000 and it worked. Again the same code worked with C-free 4 editor (mingw 2.95) without any problem while the size was 400000. Do you have any suggestion to get the code working in Visual Studio? May be the recursion in the mergesort is causing the problem.

    Read the article

  • NETWORK_ERROR: XMLHttpRequest Exception 101

    - by pawan Mangal
    I am getting this Error NETWORK_ERROR: XMLHttpRequest Exception 101 when trying to get XML content from one site. Here is my code var xmlhttp; if(window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } xmlhttp.onReadyStateChange=function() { if(xmlhttp.readyState==4) { var value =xmlhttp.responseXML; alert(value); } } xmlhttp.open("GET",url,false); xmlhttp.send(); //alert(xmlhttp.responseXML); } xmlhttp.open("GET",url,false); xmlhttp.send(null); Does any one have a solution?

    Read the article

  • Method may fail to close stream on exception

    - by 01
    I get the critical error with finbugs The method creates an IO stream object, does not assign it to any fields, pass it to other methods, or return it, and does not appear to close it on all possible exception paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensure that streams are closed. try { ... stdError = new BufferedReader(new InputStreamReader(p.getErrorStream())); ... } catch (IOException e) { throw new RuntimeException(e); } finally { try { if (stdInput != null) { stdInput.close(); } if (stdError != null) { stdError.close(); } } catch (IOException e) { throw new RuntimeException(e); } } do i need to close also InputStreamReader or p.getErrorStream(it returns InputStream) ??

    Read the article

  • Firefox throwing a exception with HTML Canvas putImageData

    - by mr.doob
    So I was working on this little javascript experiment and I needed a widget to track the FPS of it. I ported a widget I've been using with Actionscript 3 to Javascript and it seems to be working fine with Chrome/Safari but on Firefox is throwing an exception. This is the experiment: Depth of Field This is the error: [Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)" location: "http://mrdoob.com/projects/chromeexperiments/depth_of_field__debug/js/net/hires/debug/Stats.js Line: 105"] The line that is complaning about is this one: graph.putImageData(graphData, 1, 0, 0, 0, 69, 50); Which is a crappy code to "scroll" the bitmap pixels. The idea is that I only draw a few pixels on the left of the bitmap and then on the next frame I copy the whole bitmap and paste it on pixel to the right. This error usually is thrown because you're pasting a bitmap bigger than the source and it's going off the limits, but in theory that shouldn't be the case as I'm defining 69 as the width of the rectangle to paste (being the bitmap 70px wide). And this is full code: var Stats = { baseFps: null, timer: null, timerStart: null, timerLast: null, fps: null, ms: null, container: null, fpsText: null, msText: null, memText: null, memMaxText: null, graph: null, graphData: null, init: function(userfps) { baseFps = userfps; timer = 0; timerStart = new Date() - 0; timerLast = 0; fps = 0; ms = 0; container = document.createElement("div"); container.style.fontFamily = 'Arial'; container.style.fontSize = '10px'; container.style.backgroundColor = '#000033'; container.style.width = '70px'; container.style.paddingTop = '2px'; fpsText = document.createElement("div"); fpsText.style.color = '#ffff00'; fpsText.style.marginLeft = '3px'; fpsText.style.marginBottom = '-3px'; fpsText.innerHTML = "FPS:"; container.appendChild(fpsText); msText = document.createElement("div"); msText.style.color = '#00ff00'; msText.style.marginLeft = '3px'; msText.style.marginBottom = '-3px'; msText.innerHTML = "MS:"; container.appendChild(msText); memText = document.createElement("div"); memText.style.color = '#00ffff'; memText.style.marginLeft = '3px'; memText.style.marginBottom = '-3px'; memText.innerHTML = "MEM:"; container.appendChild(memText); memMaxText = document.createElement("div"); memMaxText.style.color = '#ff0070'; memMaxText.style.marginLeft = '3px'; memMaxText.style.marginBottom = '3px'; memMaxText.innerHTML = "MAX:"; container.appendChild(memMaxText); var canvas = document.createElement("canvas"); canvas.width = 70; canvas.height = 50; container.appendChild(canvas); graph = canvas.getContext("2d"); graph.fillStyle = '#000033'; graph.fillRect(0, 0, canvas.width, canvas.height ); graphData = graph.getImageData(0, 0, canvas.width, canvas.height); setInterval(this.update, 1000/baseFps); return container; }, update: function() { timer = new Date() - timerStart; if ((timer - 1000) > timerLast) { fpsText.innerHTML = "FPS: " + fps + " / " + baseFps; timerLast = timer; graph.putImageData(graphData, 1, 0, 0, 0, 69, 50); graph.fillRect(0,0,1,50); graphData = graph.getImageData(0, 0, 70, 50); var index = ( Math.floor(Math.min(50, (fps / baseFps) * 50)) * 280 /* 70 * 4 */ ); graphData.data[index] = graphData.data[index + 1] = 256; index = ( Math.floor(Math.min(50, 50 - (timer - ms) * .5)) * 280 /* 70 * 4 */ ); graphData.data[index + 1] = 256; graph.putImageData (graphData, 0, 0); fps = 0; } ++fps; msText.innerHTML = "MS: " + (timer - ms); ms = timer; } } Any ideas? Thanks in advance.

    Read the article

< Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >