Daily Archives

Articles indexed Saturday March 20 2010

Page 10/89 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • memset for initialization in C++

    - by skydoor
    memset is sometimes used to initialize data in a constructor like the example below. Does it work in general ? Is it a good idea in general? class A { public: A(); private: int a; float f; char str[35]; long *lp; }; A::A() { memset(this, 0, sizeof(*this)); }

    Read the article

  • Silverlight performance with a large number of Objects Org Chart.

    - by KC
    Hello, I’m working on a org chart project(SL 3) and I’m seeing the UI thread hang when the chart is building around 2,000 nodes and when it renders it takes about a min and then FPS drop to a crawl. Here is the code flow. Page.xaml.cs calls a wcf service that returns a list of AD users. Then we use Linq to build a collection of nodes to bind to the Orgchart.cs OrgChart.cs is a canvas and displays a collection of nodes and connecting lines. Node.cs is a canvas and has user data can contain children nodes. NodeContent.xaml is a user control that has borders so I can set the background, textblocks to display user's data, Events that handle the selected and expaned nodes, and storyboards that resize the nodes when they are selected or expanded.I noticed during hours of debugging , here in the InitializeComponent(); section where it loads the xaml it seems to be where the preformance hit is happening. System.Windows.Application.LoadComponent(this, new System.Uri("/Silverlight.Custom;component/NodeContent.xaml", System.UriKind.Relative)); So I guess I have two questions. Can threading help in any way with the UI thread hanging while drawing the nodes? How can I avoid the hit when calling this user control? Any advice or direction anyone can lend would be greatly appreciated. Thanks, KC

    Read the article

  • java.net.SocketTimeoutException: Read timed out

    - by Rafael Soto
    Hi Folks, I have an application with client server architecture. The client use Java Web Start with Java Swing / AWT and the sert uses HTTP server / Servlet with Tomcat. The communication is made from the serialization of objects, create a ObjectOutput serializes a byte array and send to the server respectively called the ObjectInputStream and deserializes. The application follows communicating correctly to a certain time of concurrency where starting to show error "SocketException read timeout". The erro happens when the server invoke the method ObjectInputStream.getObject() in my servlet doPost method. The tomcat will come slow and the errors start to decrease server response time until the crash time where i must restart the server and after everything works. Someone went through this problem ?

    Read the article

  • iPhone - phone goes to sleep even if idleTimerDisabled is YES

    - by lostInTransit
    Hi I am using this in my appdelegate's applicationDidFinishLaunching: method to make sure the iPhone doesn't go to sleep during the time the app is open [application setIdleTimerDisabled:YES]; It works great on all screens but on one of the screens the iPhone goes to sleep. I could not figure out how to reproduce this and it seems to happen at random times. Can someone please tell me how to handle this situation. Thanks

    Read the article

  • Error for Minitab program (statistics)

    - by user216428
    I have a problem with Minitab (a statistics program). When I enter my general model and want to see the results, the program warns me: too few arguments or space missing. Everything seems true, and I can't determine where the problem is. Could anyone help me on this subject?

    Read the article

  • SEO Secrets an SEO Specialist Won't Want You to Know About

    The market place for self claimed 'SEO secrets' is littered with shoddy SEO specialists and cowboys trying to push the common information available to anyone with a computer, internet connection, and a search engine. Here's the breaking news people - there is no secret email that Google sends out to these SEO specialists, and they don't keep a stack of top secret documents back just for the lucky few. It just doesn't work like that.

    Read the article

  • How does GMail implement Comet?

    - by Morgan Cheng
    With the help of HttpWatch, I tried to figure out how GMail implement Comet. I Login in GMail with two account, one in IE and the other in Firefox. Chatting in GTalk in GMail with some magic words like "WASSUP". Then, I logoff both GMail accounts, filter any http content without "WASSUP" string. The result shows which HTTP request is the streaming channel. (Note: I have to logoff. Otherwise, never-ending HTTP would not show content in HttpWatch.) The result is interesting. The URL for stream channel is like: https://mail/channel/bind?VER=8&at=xn3j33vcvk39lkfq..... There is no surprise that GMail do Comet in IE with IFRAME. The Http content starts with " Originally, I guessed that GMail do Comet in Firefox with multipart XmlHttpRequest. To my surprise, the response header doesn't have "multipart/x-mixed-replace" header. The response headers are as below: HTTP/1.1 200 OK Content-Type: text/plain; charset=utf-8 Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: Fri, 01 Jan 1990 00:00:00 GMT Date: Sat, 20 Mar 2010 01:52:39 GMT X-Frame-Options: ALLOWALL Transfer-Encoding: chunked X-Content-Type-Options: nosniff Server: GSE X-XSS-Protection: 0 Unfortunately, the HttpWatch doesn't tell whether a HTTP request is from XmlHttpRequest or not. The content is not HTML but JSON. It looks like a response for XHR, but that would not work for Comet without multipart/x-mixed-replace, right? Is there any way else to figure out how GMail implement Comet? Thanks.

    Read the article

  • how to stop animation after using beginAnimations?

    - by www.ruu.cc
    i use the following code to do a string rolling, but how to stop the animation? [UIView beginAnimations:@"ruucc" context:NULL]; [UIView setAnimationDuration:12.8f]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [UIView setAnimationDelegate:self]; [UIView setAnimationRepeatAutoreverses:NO]; [UIView setAnimationRepeatCount:999999]; frame = label1.frame; frame.origin.x = -12; label1.frame = frame; [UIView commitAnimations];

    Read the article

  • ASP.NET MVC Ajax.ActionLink's weird behavior

    - by Alex
    I'm doing the simplest ajax request possible: public ActionResult SayHello() { return Content("YYAAAY"); } ////////// <div id="Div1"> <%= Ajax.ActionLink("SAY HELLO", "SayHello", new AjaxOptions { UpdateTargetId = "Div1" })%> </div> It works when I start an empty ASP.NET MVC project, but when I use it in my current project, it displays the whole page recursively instead of YYAAAY phrase only. Where might be the problem?

    Read the article

  • Need explanation for this boost::asio timer example

    - by ApplePieIsGood
    There is a line in the 3rd tutorial on Boost asio that shows how to renew a timer and yet prevent there from being drift. The line is the following: t->expires_at(t->expires_at() + boost::posix_time::seconds(1)); Maybe it's me but I wasn't able to find documentation on the 2nd usage of expires_at(), with no parameters. expires_at(x) sets the new expiration, cancelling any pending completion handlers. So presumably expires_at() does what, return time of the last expiry? So by adding one second, if there should be some number of ms, say n ms, then it will in essence be "subtracted" from the next expiry since the time is being accounted for? What happens then if the time it takes to perform this handler is greater than 1 second in this example? Does it fire immediately?

    Read the article

  • How to find the longest continuous subsequence whose reverse is also a subsequence

    - by iecut
    Suppose I have a sequence x1,x2,x3.....xn, and I want to find the longest continuous subsequence xi,xi+1,xi+2......xi+k, whose reverse is also a subsequence of the given sequence. And if there are multiple such subsequences, then I also have to find the first. ex:- consider the sequences: abcdefgedcg here i=3 and k=2 aabcdddd here i=5, k=3 I tried looking at the original longest common subsequence problem, but that is used to compare the two sequences to find the longest common subsequence.... but here is only one sequence from which we have to find the subsequences. Please let me know what is the best way to approach this problem, to find the optimal solution.

    Read the article

  • How to append new elements to Xml from stream

    - by Wololo
    I have a method which returns some xml in a memory stream private MemoryStream GetXml() { XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; using (MemoryStream memoryStream = new MemoryStream()) { using (XmlWriter writer = XmlWriter.Create(memoryStream, settings)) { writer.WriteStartDocument(); writer.WriteStartElement("root"); writer.WriteStartElement("element"); writer.WriteString("content"); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); } return memoryStream; } } In this example the format of the xml will be: <?xml version="1.0" encoding="utf-8"?> <root> <element>content</element> </root> How can i insert a new element under the root e.g <?xml version="1.0" encoding="utf-8"?> <root> <element>content</element> ----->New element here <------ </root>

    Read the article

  • Does anybody know of existing code to read a mork file (Thunderbird Address Book)?

    - by bruceatk
    I have the need to read the Thunderbird address book on the fly. It is stored in a file format called Mork. Not a pleasant file format to read. I found a 1999 article explaining the file format. I would love to know if someone already has gone through this process and could make the code available. I found mork.pl by Jamie Zawinski (he worked on Netscape Navigator), but I was hoping for a .NET solution. I'm hoping StackOverflow will come to the rescue, because this just seems like a waste of my time to write something to read this file format when it should be so simple. I love the comments that Jamie put in his perl script. Here is my favorite part: # Let me make it clear that McCusker is a complete barking lunatic. # This is just about the stupidest file format I've ever seen.

    Read the article

  • Matlab - plot multiple data sets on a scatter plot

    - by Mark
    Hey all, I have 2 sets of data (Ax, Ay; Bx, By) - I'd like to plot both of these data sets on a scatter plot with different colors, but can't seem to get it to work because it seems scatter() does not work like plot(). Is it possible to do this? I've tried... scatter(Ax, Ay, 'g', Bx, By, 'b') And scatter(Ax, Ay, 'g') scatter(Bx, By, 'b') The first way returns an error. The latter only plots the Bx/By data. Many thanks!

    Read the article

  • Deploy java (command line) app using Netbeans / ant

    - by Haes
    I've finally managed to create a Netbeans project out of an old standalone (not Web-) Java application which consisted only out of single .java sources. Now I have basically two questions regarding Netbeans Subversion interaction and application deployment: Do you check in all the Netbeans project files into the repository, normally? If I build the project using Netbeans (or ant) I get a .jar file and some additional jar libraries. In order for the app to run properly on the server, some additional config files and directories (log/ for example) are needed. The application itself is a J2SE application (no frameworks) which runs from the command line on a Linux platform. How would you deploy and install such an application? It would also be nice if I could see what version of app is currently installed (maybe by appending the version number to the installed app path). Thanks for any tips.

    Read the article

  • Visual Studio - How to disable autoformat/correct while running macro?

    - by Sam
    When running a macro that changes the selected text, tags are automatically closed and the text formatted. How can I prevent that from happening? For example, wrapping text in a tag: DTE.ActiveDocument.Selection.Text = String.Format("<tag>{0}</tag>", DTE.ActiveDocument.Selection.Text) Ends up with two closing tags: <tag>Text</tag></tag> Even stranger, multiple lines fails: <li>One</li> <li>Two</li> <li>Three</li> An ends up as <ul> <li>One</li> <li>Two</li> <li>Three</li></li></ul> How can I prevent that? As can be seen by the last example, the formatting is wrong and there is an extra </li>

    Read the article

  • getwindowtext not retrieving text

    - by omair iqbal
    I tried the following code but it does not retrieve text from foreground window! procedure TForm1.Button1Click(Sender: TObject); var title : pansichar; s : string; begin GetWindowText(GetForegroundWindow(), title,GetWindowTextLength(GetForegroundWindow()) + 1); s := title; showmessage(s); end;

    Read the article

  • Word 2007, Open XML - embedding an image

    - by agnieszka
    Do you know what basic information MUST include a paragraph (w:p) in document.xml inside a *.docx document, that specifies an image? I do know there must be <a:blip r:embed="rId4" /> specifing the relation id, but what else? It's very hard to find it in google and experimenting with cutting out tags from a ready document or reading the specification takes a lot of time. An example with all the required tags would be greatly appreciated.

    Read the article

  • .net XML serialization: how to specify an array's root element and child element names

    - by Jeremy
    Consider the following serializable classes: class Item {...} class Items : List<Item> {...} class MyClass { public string Name {get;set;} public Items MyItems {get;set;} } I want the serialized output to look like: <MyClass> <Name>string</Name> <ItemValues> <ItemValue></ItemValue> <ItemValue></ItemValue> <ItemValue></ItemValue> </ItemValues> </MyClass> Notice the element names ItemValues and ItemValue doesn't match the class names Item and Items, assuming I can't change the Item or Items class, is there any why to specify the element names I want, by modifying the MyClass Class?

    Read the article

  • How to get Visual Studio to step into third party assemblies

    - by ForeverDebugging
    When I'm debugging or even coding, it would be really uesful to examine third party assemblies but I can only see their metadata. Given that tools like reflector can decompile assemblies, is there someway or some tool which would allow visual studio to do the same thing? If I happen to have access to the PDB files for an assemblies, would placing them into my applications bin folder allow me to examine the assemblies content through visual studio?

    Read the article

  • Adding Chart to WordprocessingML

    - by kern
    I would like to generate an Open XML document containing a Chart using the Open Xml SDK 2. I found an SpreadsheetML example, but I can't work out how to add the chart in a .docx... Is there a good source for documentation/examples for the Open Xml SDK 2?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >