Daily Archives

Articles indexed Wednesday June 2 2010

Page 8/120 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Help, I need to debug my BrowserHelperObject (BHO) (in C++) after a internet explorer 8 crash in Rel

    - by BHOdevelopper
    Hi, here is the situation, i'm developping a Browser Helper Object (BHO) in C++ with Visual Studio 2008, and i learned that the memory wasn't managed the same way in Debug mode than in Release mode. So when i run my BHO in debug mode, internet explorer 8 works just fine and i got no erros at all, the browser stays alive forever, but as soon as i compile it in release mode, i got no errors, no message, nothing, but after 5 minutes i can see through the task manager that internet explorer instances are just eating memory and then the browser just stop responding every time. Please, I really need some hint on how to get a feedback on what could be the error. I heard that, often it was happening because of memory mismanagement. I need a software that just grab a memory dump or something when iexplorer crashes to help me find the problem. Any help is appreciated, I'll be looking for responses every single days, thank you.

    Read the article

  • execute a string of PHP code on the command line

    - by Matthew J Morrison
    I'd like to be able to run a line of PHP code on the command line similar to how the following options work: :~> perl -e "print 'hi';" :~> python -c "print 'hi'" :~> ruby -e "puts 'hi'" I'd like to be able to do: :~> php "echo 'hi';" I've read that there is a -r option that can do what I need for php, however it doesn't appear to be available when I try to use it. I've tried using PHP 5.2.13 and PHP 4.4.9 and neither have an -r option available. I wrote this script (that I called run_php.php) - which works, but I'm not a huge fan of it just because I feel like there should be a more "correct" way to do it. #!/usr/bin/php5 -q <?php echo eval($argv[1]); ?> My question is: is there a -r option? If so, why is it not available when I run --help? If there is no -r option, what is the best way to do this (without writing an intermediary script if possible)? Thanks!

    Read the article

  • "variable tracking" is eating my compile time!

    - by wowus
    I have an auto-generated file which looks something like this... static void do_SomeFunc1(void* parameter) { // Do stuff. } // Continues on for another 4000 functions... void dispatch(int id, void* parameter) { switch(id) { case ::SomeClass1::id: return do_SomeFunc1(parameter); case ::SomeClass2::id: return do_SomeFunc2(parameter); // This continues for the next 4000 cases... } } When I build it like this, the build time is enormous. If I inline all the functions automagically into their respective cases using my script, the build time is cut in half. GCC 4.5.0 says ~50% of the build time is being taken up by "variable tracking" when I use -ftime-report. What does this mean and how can I speed compilation while still maintaining the superior cache locality of pulling out the functions from the switch? EDIT: Interestingly enough, the build time has exploded only on debug builds, as per the following profiling information of the whole project (which isn't just the file in question, but still a good metric; the file in question takes the most time to build): Debug: 8 minutes 50 seconds Release: 4 minutes, 25 seconds

    Read the article

  • Lots of first chance Microsoft.CSharp.RuntimeBinderExceptions thrown when dealing with dynamics

    - by Orion Edwards
    I've got a standard 'dynamic dictionary' type class in C# - class Bucket : DynamicObject { readonly Dictionary<string, object> m_dict = new Dictionary<string, object>(); public override bool TrySetMember(SetMemberBinder binder, object value) { m_dict[binder.Name] = value; return true; } public override bool TryGetMember(GetMemberBinder binder, out object result) { return m_dict.TryGetValue(binder.Name, out result); } } Now I call it, as follows: static void Main(string[] args) { dynamic d = new Bucket(); d.Name = "Orion"; // 2 RuntimeBinderExceptions Console.WriteLine(d.Name); // 2 RuntimeBinderExceptions } The app does what you'd expect it to, but the debug output looks like this: A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll 'ScratchConsoleApplication.vshost.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted DynamicMethods Assembly' A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll Any attempt to access a dynamic member seems to output a RuntimeBinderException to the debug logs. While I'm aware that first-chance exceptions are not a problem in and of themselves, this does cause some problems for me: I often have the debugger set to "break on exceptions", as I'm writing WPF apps, and otherwise all exceptions end up getting converted to a DispatcherUnhandledException, and all the actual information you want is lost. WPF sucks like that. As soon as I hit any code that's using dynamic, the debug output log becomes fairly useless. All the useful trace lines that I care about get hidden amongst all the useless RuntimeBinderExceptions Is there any way I can turn this off, or is the RuntimeBinder unfortunately just built like that? Thanks, Orion

    Read the article

  • How can I import code from LaunchPad.net?

    - by Robert A Henru
    Hi all, I want to import code from Launchpad.net. How can I do it? Is that using SVN? Can I use SVN to keep updated with the code changes? Thank you so much, Robert FYI: this is the code I want to import https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-extra-addons

    Read the article

  • Generating 8000 text files from xml files

    - by Ray
    Hi all, i need to generate the same number of text files as the xml files i have. Within the text files, i need the title and maybe some other tags of it. I can generate text files with the elements i wanted but not all xml files can be generated. Only some of them are generated. Something might be wrong with my parser so help out please thanks. This is my code. Please have a look and give me suggestions. Thanks in advance. import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.*; import java.io.*; public class AccessingXmlFile1 { public static void main(String argv[]) { try { //File file = new File("C:\\MyFile.xml"); // create a file that is really a directory File aDirectory = new File("C:/Documents and Settings/I2R/Desktop/test"); // get a listing of all files in the directory String[] filesInDir = aDirectory.list(); System.out.println(""+filesInDir.length); // sort the list of files (optional) // Arrays.sort(filesInDir); //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // have everything i need, just print it now for ( int a=0; a<filesInDir.length; a++ ) { String xmlFile = filesInDir[a]; String newLine = System.getProperty("line.separator"); File file = new File(xmlFile); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document document = db.parse(file); document.getDocumentElement().normalize(); //System.out.println("Root element " + document.getDocumentElement().getNodeName()); NodeList node = document.getElementsByTagName("metadata"); System.out.println("Information of Xml File"); System.out.println(xmlFile.substring(0, xmlFile.length() - 4)); //////////////////////////////////////////////////////////////////////////////////// String titleStoreText = ""; String descriptionStoreText = ""; String collectionStoreText = ""; String textToWrite = ""; //////////////////////////////////////////////////////////////////////////////////// for (int i = 0; i < node.getLength(); i++) { Node firstNode = node.item(i); if (firstNode.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) firstNode; NodeList titleElementList = element.getElementsByTagName("title"); Element titleElement = (Element) titleElementList.item(0); NodeList title = titleElement.getChildNodes(); //////////////////////////////////////////////////////////////////////////////////// if(titleElement == null) titleStoreText = " There is no title for this file."+ newLine; else titleStoreText = titleStoreText+((Node) title.item(0)).getNodeValue() + newLine; //titleStoreText = titleStoreText+((Node) title.item(0)).getNodeValue()+ newLine; //////////////////////////////////////////////////////////////////////////////////// System.out.println("Title : " + titleStoreText); NodeList collectionElementList = element.getElementsByTagName("collection"); Element collectionElement = (Element) collectionElementList.item(0); NodeList collection = collectionElement.getChildNodes(); //////////////////////////////////////////////////////////////////////////////////// if(collectionElement == null) collectionStoreText = " There is no collection for this file."+ newLine; else collectionStoreText = collectionStoreText+((Node) collection.item(0)).getNodeValue() + newLine; //collectionStoreText = collectionStoreText+((Node) collection.item(0)).getNodeValue()+ newLine; //////////////////////////////////////////////////////////////////////////////////// System.out.println("Collection : " + collectionStoreText); NodeList descriptionElementList = element.getElementsByTagName("description"); Element descriptionElement = (Element) descriptionElementList.item(0); NodeList description = descriptionElement.getChildNodes(); //////////////////////////////////////////////////////////////////////////////////// if(descriptionElement == null) descriptionStoreText = " There is no description for this file."+ newLine; else descriptionStoreText = descriptionStoreText+((Node) description.item(0)).getNodeValue() + newLine; //descriptionStoreText = descriptionStoreText+((Node) description.item(0)).getNodeValue() + newLine; //////////////////////////////////////////////////////////////////////////////////// System.out.println("Description : " + descriptionStoreText); //////////////////////////////////////////////////////////////////////////////////// textToWrite = "=====Title=====" + newLine + titleStoreText + newLine + "=====Collection=====" + newLine + collectionStoreText + newLine + "=====Description=====" + newLine + descriptionStoreText;// + newLine + "=====Subject=====" + newLine + subjectStoreText; //////////////////////////////////////////////////////////////////////////////////// } } ///////////////////////////////////////////write to file part is here///////////////////////////////////////// Writer output = null; File file2 = new File(xmlFile.substring(0, xmlFile.length() - 4)+".txt"); output = new BufferedWriter(new FileWriter(file2)); output.write(textToWrite); output.close(); System.out.println("Your file has been written"); //////////////////////////////////////////////////////////////////////////////////// } } catch (Exception e) { e.printStackTrace(); } } }

    Read the article

  • Dynamically sized panels

    - by codemnky
    I have a dynamically created tabpage for windows forms. the tabpage is split into two horizontal panels. The top panel should be able to hold up to 4 textboxes like this TextBox1 TextBox2 TextBox3 TextBox4 There WILL be atleast one TextBox. Maximum is 4. How do I create a TabPage with two panels where the top panel only takes up the real estate as needed(i.e only use up the real estate for one textbox or 2 textboxes, or 3 textboxes or the maximum 4 textboxes) and the rest of the tabpage is available for Panel2.

    Read the article

  • Cannot connect to a SQL Server 2005 Analysis Services cube after installing SQL Server 2008 SP1.

    - by Luc
    I've been developing an application that talks directly to an SSAS 2005 OLAP cube. Note that I also have SQL Server 2008 installed, so the other day I did a Windows Update and decided to include SQL Server 2008 SP1 in my update. After doing that, my SSAS 2005 cube is no longer accessible from my application. I'm able to browse the data just fine within SQL Server 2005 BI Studio Manager, but I'm not able to connect to the cube from my application. Here is my connection string that used to work: Data Source=localhost;Provider=msolap;Initial Catalog=Adventure Works DW Here is the error message I get: Either the user, [Server]/[User], does not have access to the Adventure Works DW database, or the database does not exist. Here is the beginning of my stack trace if it would help: Microsoft.AnalysisServices.AdomdClient.AdomdErrorResponseException was unhandled by user code HelpLink="" Message="Either the user, Luc-PC\\Luc, does not have access to the Adventure Works DW database, or the database does not exist." Source="Microsoft SQL Server 2005 Analysis Services" ErrorCode=-1055391743 StackTrace: at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Microsoft.AnalysisServices.AdomdClient.IDiscoverProvider.Discover(String requestType, IDictionary restrictions, DataTable table) at Microsoft.AnalysisServices.AdomdClient.ObjectMetadataCache.Discover(AdomdConnection connection, String requestType, ListDictionary restrictions, DataTable destinationTable, Boolean doCreate) at Microsoft.AnalysisServices.AdomdClient.ObjectMetadataCache.PopulateSelf() at Microsoft.AnalysisServices.AdomdClient.ObjectMetadataCache.Microsoft.AnalysisServices.AdomdClient.IObjectCache.Populate() at Microsoft.AnalysisServices.AdomdClient.CacheBasedNotFilteredCollection.PopulateCollection() at Microsoft.AnalysisServices.AdomdClient.CacheBasedNotFilteredCollection.get_Count() at Microsoft.AnalysisServices.AdomdClient.CubesEnumerator.MoveNext() at Microsoft.AnalysisServices.AdomdClient.CubeCollection.Enumerator.MoveNext() at blah blah... I've looked for a solution for the last 4+ hours and haven't had any success. Thanks in advance for any help. Luc

    Read the article

  • Php/Shell remote SVN tarballs

    - by Tom J Nowell
    I'd like to set up daily tarballs/zip archives on my host for an SVN of a related project. I do not have access to their server, however they do have a publicly accessible SVN. How would I grab this SVN and build archives with minimal load ( dreamhost shared ), via Cron task + php/shell script?

    Read the article

  • Removing an Entity from an EntitySet during Iteration...

    - by Gregorius
    I've got this code... seems nice and elegant, but apparently the framework don't like it when i mess with a collection while iterating through it: foreach (KitGroup kg in ProductToTransfer.KitGroups) { // Remove kit groups that have been excluded by the user if (inKitGroupExclusions != null && inKitGroupExclusions.Contains(kg.KitGroupID)) ProductToTransfer.KitGroups.Remove(kg); else { // Loop through the kit items and do other stuff //... } } The error it throws when it iterates to the 2nd object in the collection is: "EntitySet was modified during enumeration" I know i could create a new collection of KitGroup objects (or even just IDs) that i want to remove, and then another loop afterwards to loop through these, and remove them from the collection, but this just seems like unnecessary extra code... can anybody suggest a more elegant way of achieving the same thing? Cheers Greg

    Read the article

  • iPhone noob - setting NSMutableDictionary entry inside Singleton?

    - by codemonkey
    Yet another iPhone/Objective-C noob question. I'm using a singleton to store app state information. I'm including the singleton in a Utilities class that holds it (and eventually other stuff). This utilities class is in turn included and used from various view controllers, etc. The utilities class is set up like this: // Utilities.h #import <Foundation/Foundation.h> @interface Utilities : NSObject { } + (id)GetAppState; - (id)GetAppDelegate; @end // Utilities.m #import "Utilities.h" #import "CHAPPAppDelegate.h" #import "AppState.h" @implementation Utilities CHAPPAppDelegate* GetAppDelegate() { return (CHAPPAppDelegate *)[UIApplication sharedApplication].delegate; } AppState* GetAppState() { return [GetAppDelegate() appState]; } @end ... and the AppState singleton looks like this: // AppState.h #import <Foundation/Foundation.h> @interface AppState : NSObject { NSMutableDictionary *challenge; NSString *challengeID; } @property (nonatomic, retain) NSMutableDictionary *challenge; @property (nonatomic, retain) NSString *challengeID; + (id)appState; @end // AppState.m #import "AppState.h" static AppState *neoAppState = nil; @implementation AppState @synthesize challengeID; @synthesize challenge; # pragma mark Singleton methods + (id)appState { @synchronized(self) { if (neoAppState == nil) [[self alloc] init]; } return neoAppState; } + (id)allocWithZone:(NSZone *)zone { @synchronized(self) { if (neoAppState == nil) { neoAppState = [super allocWithZone:zone]; return neoAppState; } } return nil; } - (id)copyWithZone:(NSZone *)zone { return self; } - (id)retain { return self; } - (unsigned)retainCount { return UINT_MAX; //denotes an object that cannot be released } - (void)release { // never release } - (id)init { if (self = [super init]) { challengeID = [[NSString alloc] initWithString:@"0"]; challenge = [NSMutableDictionary dictionary]; } return self; } - (void)dealloc { // should never be called, but just here for clarity [super dealloc]; } @end ... then, from a view controller I'm able to set the singleton's "challengeID" property like this: [GetAppState() setValue:@"wassup" forKey:@"challengeID"]; ... but when I try to set one of the "challenge" dictionary entry values like this: [[GetAppState() challenge] setObject:@"wassup" forKey:@"wassup"]; ... it fails giving me an "unrecognized selector sent..." error. I'm probably doing something really obviously dumb? Any insights/suggestions will be appreciated.

    Read the article

  • Mount an additional Xserve volume with autofs on Linux

    - by daustin777
    A few years ago I setup autofs on a RH Linux box to mount volumes from four XServes. I need to add a couple new volumes from these same Xserves so that I can access files from the Linux box. I've completely forgotten how to do this and haven't been able to find a solution online. How do I add the new volumes? Do I need to add paths to the new volumes?

    Read the article

  • Three20 TTSectionedDataSource row height

    - by Ward
    Hey there, I'm using Three20 to create a table with several textfields for user registration. I've found two possible methods using Three20. The first uses the TTSectionedDataSource's tableDidLoadModel method to manually add UI components and the second adds custom items that contains pre formatted UI components. The second option seems way more complex and I'm having a difficult time accessing the individual fields. So if one field is a textfield for the username, I need to access the field to submit the username and it doesn't seem like there's an easy answer. The first option gives me a lot of flexibility, but I can't figure out how to set the individual row heights. One row may have a label above a text field, another may have an image, etc. Is there a method that can be used in TTSectionedDataSource that will allow me to set the height for each row? Thus far, I'm using method one and creating UIViews to hold a label field and a text field. I've tried changing the frame of the uiview before it is added to the items array, but it has no affect. Any ideas?

    Read the article

  • Swapping an image during web development

    - by detly
    I'm trying to see what a certain webpage would look like if I replaced a certain image with another. Rather than upload the image, edit the site, etc, each time I tweak it, I'd like to know if there's a way to change the image in the page to my local version while viewing the remote page. I use Firebug for debugging web development usually, but I'm open to any other tool that might do this. (It is absolutely impossible to search for this and find anything but questions about dynamic image swapping on a deployed website, so sorry if this is a duplicate.)

    Read the article

  • Can bad stuff happen when dividing 1/a very small float?

    - by Jeremybub
    If I want to check that positive float A is less than the inverse square of another positive float B (in C99), could something go wrong if B is very small? I could imagine checking it like if(A<1/(B*B)) but if B is small enough, would this possibly result in infinity? If that were to happen, would the code still work correctly in all situations? in a similar vein, I might do if(1/A>B*B) Which might be slightly better because B*B might be zero if B is small (is this true?) Finally, a solution that I can't imagine being wrong is if(sqrt(1/A)>B) Which I don't think would ever result in zero division, but still might be problematic if A is close to zero. So basically, my questions are Can 1/X ever be infinity if X is greater than zero (but small)? Can X*X ever be zero if X is greater than zero? Will comparisons with infinity work the way I would expect them to?

    Read the article

  • JQuery Cycle Plugin hover when paused issue, activeSlide

    - by user202141
    Almost all is dialed in except then I click the pause/play button, the current activeSlide div doesn't fade in on rollover like the other slides do. Bit at a loss to figure out why it's not allowing hover even though it works when the cycle is not manually paused (i.e. when just rolling over the pager numbers). Thanks for any guidance! http://www.xtracycle.com/home-test-a-rooney

    Read the article

  • [BUG] Bus Error - What causes this in Ruby?

    - by viatropos
    I have run into this error 5 or 10 times over the past few years and have never found a clear answer to this problem. Here is the error: $ rake db:migrate /usr/lib/ruby/gems/1.8/gems/libxml-ruby-0.9.5/lib/libxml_ruby.bundle: [BUG] Bus Error ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.7.0] Abort trap The app I am running this in is using RMagick. I have run into this problem when installing ImageMagick a while ago, and when installing Nokogiri, and when installing MySQL. For Nokogiri it was because I needed a more recent version of libxml. What are your thoughts on this? Any fixes? How can I check the version of RMagick the project is loading? I am on a Mac, 10.5.8. Thanks for the help, Lance

    Read the article

  • How to move or position a legend in ggplot2

    - by Dan Goldstein
    I'm trying to create a ggplot2 plot with the legend beneath the plot. The ggplot2 book says on p 112 "The position and justification of legends are controlled by the theme setting legend.position, and the value can be right, left, top, bottom, none (no legend), or a numeric position". The following code works (since "right" it is the default), and it also works with "none" as the legend position, but "left", "top", "bottom", all fail with "Error in grid.Call.graphics("L_setviewport", pvp, TRUE) : Non-finite location and/or size for viewport" library(ggplot2) (myDat <- data.frame(cbind(VarX=10:1, VarY=runif(10)), Descrip=sample(LETTERS[1:3], 10, replace=TRUE))) qplot(VarX,VarY, data=myDat, shape=Descrip) + opts(legend.position="right") What am I doing wrong? Re-positioning a legend must be incredibly common, so I figure it's me.

    Read the article

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