legacy

Adding unit tests to an existing project

情到浓时终转凉″ 提交于 2019-12-13 12:01:19
问题 My question is quite relevant to something asked before but I need some practical advice. I have "Working effectively with legacy code" in my hands and I 'm using advice from the book as I read it in the project I 'm working on. The project is a C++ application that consists of a few libraries but the major portion of the code is compiled to a single executable. I 'm using googletest for adding unit tests to existing code when I have to touch something. My problem is how can I setup my build

How do I Open a Stored Procedure and Edit it in SQL*Plus

假装没事ソ 提交于 2019-12-12 20:16:24
问题 I need to make some changes to an old Oracle stored procedure on an obsolete box that is being kept around to run an old legacy process. The only tool I can connect to the db with is SQL Plus. How do I load a stored proc into memory for editing in SQL Plus? The tutorials I've found on-line don't exlain how that's done. :-( 回答1: It would be a lot easier to download the trial version of TOAD scratch that previous suggestion, I just tried out the Oracle SQL Developer link suggested and it works

Mixing C++ ABIs to build against legacy libraries

人盡茶涼 提交于 2019-12-12 11:31:49
问题 Here's the situation, I've got a C++ codebase which is using a recent GCC (4.3.3), but I need to link against an older library which was built using GCC 3.2.3. There is no newer version of the library available, I can't go without it, and it's closed source so it can't be rebuilt. This seems to pose a problem since there are ABI incompatibilities between GCC 4.3.3 and 3.2.3, so I'm trying to see what my options are for resolving this. A few additional details: I can rebuild everything in my

What's unsafe/legacy about brk/sbrk?

删除回忆录丶 提交于 2019-12-12 10:44:11
问题 I've heard in a lot of places (musl mailing list, macOS forums, etc.) that brk() and sbrk() are unsafe. Many of these places either don't give explanations at all, or give very vague explanations. For example, this link states that "these functions are fundamentally broken", and goes on to say that the malloc and sbrk subsystems are utterly broken, that they ruin the heap, et al. My question is: Why is this so? If malloc is used in such a way that it allocates a block of memory with sbrk

legacy gcc compiler issues

倖福魔咒の 提交于 2019-12-12 10:39:21
问题 We are using a legacy compiler, based on gcc 2.6.0, to cross compile for an old imbedded processor we are still using (yes, it is still in use since 1994!). The engineer that did the gcc port for this chip has long since moved on. Although we might be able to recover the gcc 2.6.0 source from somewhere on the web, the change set for this chip has disappeared in the halls of corporate history. We have muddled along until recently as the compiler still ran and produced workable executables, but

in a pickle: how to serialise legacy objects for submission to a Python multiprocessing pool

梦想与她 提交于 2019-12-12 04:40:01
问题 I have written a nice parallel job processor that accepts jobs (functions, their arguments, timeout information etc.) and submits then to a Python multiprocessing pool. I can provide the full (long) code if requested, but the key step (as I see it) is the asynchronous application to the pool: job.resultGetter = self.pool.apply_async( func = job.workFunction, kwds = job.workFunctionKeywordArguments ) I am trying to use this parallel job processor with a large body of legacy code and, perhaps

No Private Setter for Fields - Unit Testing Legacy Code

别说谁变了你拦得住时间么 提交于 2019-12-12 02:57:13
问题 For testing MyClass - I Have: MyClass{ private MyThing usedThing = new MyThing(); public String funcToTest(){ return usedThing.Fields.something.ToString(); } } QUESTION: This is only a section of the method, but my question is without a setter, or without changing the prod code, how can I inject the mocked MyThing object into the test? thanks 回答1: You can use reflection for that. It is bad, because it allows you to use private methods or fields outside the owning class, breaking the

How can I export data in a legacy DOS application when no export option is available?

梦想与她 提交于 2019-12-11 21:16:13
问题 We've been given the task by my customer to export data from a legacy DOS system, using a RAIMA database , so it can be imported into a new system we are writing for them. It looks like the data is stored in a flat file format, though when we open the files most of the text is gibberish. We do see Raima Database Manager along the top of the files we opened ... We tried Googling that term and seems it is an old database format. Needless to say the vendor who wrote the software no longer

Activating Angular JS on an already loaded non-Angular webpage

徘徊边缘 提交于 2019-12-11 19:30:07
问题 I'm looking for a way to load Angular JS not on page load, but later on, when needed. My use case is a pre-existing web app, that uses old-school jQuery and Ajax to show and replace various blocks on the page. This is from before Angular JS times. Now, we need to develop a somewhat more complex part on this page, for which we want to use Angular JS, because it would otherwise get quite complex to develop the desired functionality. Without changing the app too much, we want to include Angular

Porting PHP5 to legacy PHP4, DOMDocument quibbles

瘦欲@ 提交于 2019-12-11 14:56:47
问题 I'm trying to make some of my php5 code work on a legacy server, which unfortunately cannot be upgraded (client's machine). if (!isset($docRoot)) { $docRoot = $_SERVER['DOCUMENT_ROOT']; } // generic storage class for the words/phrases $t = new stdClass(); $t->lang = $curPage->lang; // load xml translations, could split this into different files.. $translations = new DOMDocument(); $translations->load($docRoot."/xml/translations.xml"); $words = $translations->getElementsByTagName("word");