|
I considered it. I really did, although I wasn't happy about that. I spent several hours to learn about it, skimming articles on the issue, with a special focus on the things I knew to be a weakness in the current library. As matters stand, every single article I've specifically searched for either didn't address the keywords I searched for, addressed them in a different context, or put a rather negative view on the whole context of LP.
I am now pretty sure that
1. LP is detrimental to team development
2. ignores interoperability with most modern SW development tools and therefore in the long run will in fact produce low quality code by modern standards, in spite of it's proclaimed goals to produce high quality.
3. Has no consideration whatsoever regarding performance, and in fact, due to automated code generation makes it near impossible to care about that. (performance is crucial for our purposes, and we made a point of that)
4. Does not prevent the programmer to produce bad code: It didn't take me long to spot some pretty horrible things in the code we got. I've yet to find out if these come from generated code or are in fact coded into the original algorithm. But in the end that does not matter.
Judging by the articles I looked into, I got the impression LP never really got outside universities. And it seems for very good reasons. I'm not going to put effort into changing that.
|
|
|
|
|
Stefan_Lang wrote: 1. LP is detrimental to team development...I got the impression LP never really got outside universities
Possible I suppose. However Literate Programming is an idiom, not a tool. The problem here is the tool.
Stefan_Lang wrote: 4. Does not prevent the programmer to produce bad code: It didn't take me long to spot some pretty horrible things in the code we got.
Not sure what that means.
Generated code doesn't have to be pretty. Myself I prefer that it makes an attempt to be so, but it isn't a requirement. And actually there are specific things that I expect from generated code, such as repeating the same code over and over again in different places.
Now it could be that the tool generates bad code (nothing to do with pretty.) Or it could be that the use of the tool in the first place was incorrect. That latter problem can be corrected by learning how the tool works and then correcting the input source so the generated code is better. The former problem can normally only be solved by fixing the tool.
Stefan_Lang wrote: 3. Has no consideration whatsoever regarding performance, and in fact, due to automated code generation makes it near impossible to care about that. (performance is crucial for our purposes, and we made a point of that)
That is a process problem not a technological problem. If your company contracted performance critical code to a third part and didn't stipulate performance criteria then then failure is in the outsourcing process and has nothing to do with the implementation. The performance failure could have resulted regardless of the implementation methodology and actually, with no performance criteria in the contract, probably would have (presuming not trivial code.)
|
|
|
|
|
jschell wrote: Generated code doesn't have to be pretty.
As it turned out the .w files were not generated after all: they're all hand-written just as they are. But I was talking about code quality anyway, not prettyness.
jschell wrote: failure is in the outsourcing process
Agreed. I could elaborate on that, but I'm not here to complain over past failures (ok, that as well, but I'm almost done on that part ), but to get advice what I could do to fix it.
|
|
|
|
|
Hi,
It Is 'UnLearnable' as I understand it, This OP was presented for his employer by one of those 'Intermediate' File Generators, produced by one of those intractable .NET,C#, Matrix, or other devilish software tool.
The File is written in CPP, but Un Documented.
Written in a format, easy to generate by a code generator, not intended for Human Consumption.
Example:
<br />
class ABCDEF110{ABCDEF110();~ABCDEF110();protected: V ABCDEF110(PQR ST){V=ST,YZ}<br />
};<br />
It deserves a Decent Decompiler before you start on this one.
That will take a Lot of Time and Efford. Someone is on the Take Here, probably Not the OP,Probably the Outside Contractor.
Bram van Kampen
|
|
|
|
|
Ouch!
One of our guys suggested some 3 years ago, that we should specify what Tools, and Platforms should be able to handle the Documentation provided for a Project. In the end, we included it reluctantly in our Doc Spec. (It may do No Good, but it doesn't do any harm, except from possibly adding a bit to the price.) I suspect that you now wish that that guy worked for you.
I Suggest you still speak to the programmer (small company). If he is half decent, and is looking for new business, and is interested in keeping up a reputation, he should be willing to assist. If at the otherhand, he takes the attitude of 'Gotche by the Goolies, I have the Real Source Code, Come to me for Ever and Ever for mantenance', that would be deception.
I take it that you have already 'at least' Part paid him.
I do not know under what jurisdiction the contract was signed. Here in the UK you would have various legal options. If you specified in your Contract that you require the source code for software maintenance purposes, you can reasonably expect to receive them in a format that 'your' tools can accept. Seeing that in this relationship he would be classed as the 'expert', it would be incumbent on him (her?) to discuss with you at an early stage as to the format details of the documentation provided.
It may also not be possible to generate Human Readible Source Code that can be loaded into an IDE, from the Source Script your developer wrote for his Code Generator. In that case, Cut your Losses (and Sue if Possible).
Best to speak to a Solicitor at this stage.
Sorry to hear about your Trouble,
Regards,
Bram van Kampen
|
|
|
|
|
Thanks for your response.
I'm afraid that legal action won't get us anything much - what we need most is get our work done, and no amount of jurisdiction will help us achieve it. And anyway, that's something my superiors will have to decide.
In the meantime I'm still stuck with the problem of making things work. That's why I posted here, in the hopes someone with experience in LP might have an idea about how to deal with it.
|
|
|
|
|
Hi,
Well, At Least you have Superiors. (I've Not). That means that your paycheck is secure. Well, look at this one, You're given an impossible problem, (which you cannot solve), You're sacked because of incompetence. In walks this stranger after you're sacked, looks at the documents provided by the contractor, and says, 'YESS' I can Work with this!, and Solves the Problem. Take care, that that was not a Stooge, planted to look for your job!
I Don't know your Circumstances, who you are or what you do!. My first reaction on reading your post was 'Shurely SoMeOne is trying to pull a Scam' 'Literal Code' essentially comprises a Program, still compilable under 'C' or 'CPP', which would be produced as an intermediate file to the final compiler.
It should come with a header File.Equally Abstract. It is Human Readible to the extent that it can be reproduced in print( it does not contain 'Awquard' Characters, such as \b(bell) etc.
Human Readible Text means just that.: That if it is printed, you can read all chars. It does not mean that what is printed makes Human Sense
Bram van Kampen
|
|
|
|
|
Is there a way to connect and use c# dll in g++ project?
Using Mono, Ubuntu, and do not know c/c++ well
added:
Found this: http://www.mono-project.com/Embedding_Mono[^]
Try to do this.. )
Thanks for answers
modified 2-Feb-12 17:51pm.
|
|
|
|
|
|
Of course Linux has NOT dll (i.e. .dll files), however it has shared libraries (.so files).
There are some tutorials available, see, for instance "Interop with Native Libraries"[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
stenlyman wrote:
Is there a way to connect and use c# dll in g++
project? Using Mono, Ubuntu, and do not know c/c++ well
I suspect that getting just C# to run on linux is not a trivial excercise.
And then you want to call C# from C++ which is a language that you lack skill in. So why are you using C++? Why are you using the C# library?
If it was me I would do the following
1. Write a wrapper around the C# code to turn it into an executable.
2. Add a communication interface consisting of one of the following: sockets, file, stdio. The choice depends on the library and how it will be used.
3. I would write the C++ code to start the executable and write code in C++ that talks to it via the communication interface.
|
|
|
|
|
Is there any option to code ssl communication using c++
|
|
|
|
|
Yes, there is.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Short and to the point
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Thank you, however Manfred's it's the right one.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Excellent
|
|
|
|
|
Well, Manfred's it's the right one.
Thank you, anyway.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yeah, I upvoted his answer but your answer sure made me
|
|
|
|
|
Going strictly by OP's question yours is the most succinct answer possible.
Have a 5!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
This book might be just for you: Secure Programming Cookbook for C and C++[^].
Content information:
•How to avoid common programming errors, such as buffer overflows, race conditions, and format string problems
•How to properly SSL-enable applications
•How to create secure channels for client-server communication without SSL
•How to integrate Public Key Infrastructure (PKI) into applications
•Best practices for using cryptography properly
•Techniques and strategies for properly validating input to programs
•How to launch programs securely
•How to use file access mechanisms properly
•Techniques for protecting applications from reverse engineering
[Edit]
Just in case I've decided to add this link to a SSL tutorial: C++ Socket library tutorial[^].
[/Edit]
Regards,
Manfred
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
I think you just answered half the questions on this board.
Two very excellent links.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Im writing some data in to file.
For that, im taking values and assign it to the struct varaible and then i add that sruct to CPtrList.
Then im writing this CPtrList in file.
But it writes some garbage value.
I dont know where im doing wrong.
Assigning values to struct:
sLbl= new SGraphLbl;
sTagName = (CString)czTagGetVal;
int pos = sTagName.Find("\n");
sName = sTagName.Left(pos-1);
if(sName.Right(1) == "Y")
{
sTagName = sName.Left(sName.GetLength()-2);
sTagName.TrimLeft();
sTagName.TrimRight();
sLbl->sTagName = sTagName;
sLbl->LblNo = Cnt;
sLbl->iTagInd = Cnt;
sLbl->PageNo = iPage;
}
LblList[iPage].AddTail(sLbl);
I am writing in to file in a seperate function
void Listtofile()
{
CFile gpFile;
if (!gpFile.Open( sFileName,CFile::modeCreate|CFile::modeWrite))
{
AfxMessageBox( sFileName + (CString)" - File Write Error");
return;
}
for(int iPage =0; iPage<NoPages; iPage++)
{
POSITION hPos = LblList[iPage].GetHeadPosition();
while(hPos)
{
SGraphLbl *Pd = (SGraphLbl *)LblList[iPage].GetNext(hPos);
gpFile.Write(Pd,sizeof( struct SGraphLbl));
}
}
gpFile.Close();
}
It writes some thing if file and also i cannot read the file also.
Anu
|
|
|
|
|
I don't know if this solves your problem, but this code may fail:
sTagName = (CString)czTagGetVal;
int pos = sTagName.Find("\n");
sName = sTagName.Left(pos-1);
pos is -1 when the string did not contain a line feed. If it contains multiple line feeds, all charaters at and right of it are removed. You are using a CString. So this may be better (removes also carriage returns):
sName.Remove('\n');
sName.Remove('\r');
|
|
|
|
|
Anu_Bala wrote: gpFile.Write(Pd,sizeof( struct SGraphLbl));
Since your struct contains a reference to a CString object, the above line is not the right way to serialize it (you're just writing the address of the CString to the file, while yout should write its content).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I am using eclipse IDE with MinGw installed. I copied all the libxl C libraries into the C:\MinGw\include but when I try to compile the program, I get the below errors :
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:14: undefined reference to `xlCreateBookCA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:17: undefined reference to `xlBookAddSheetA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:20: undefined reference to `xlSheetWriteStrA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:21: undefined reference to `xlSheetWriteNumA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:23: undefined reference to `xlBookSaveA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:24: undefined reference to `xlBookReleaseA'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 515 ms.
Here is the program I am trying to compile:
#include <stdio.h>
#include <libxl.h>int main()
{
BookHandle book = xlCreateBook(); // xlCreateXMLBook()
if(book)
{
SheetHandle sheet = xlBookAddSheet(book, L"Sheet1", 0);
if(sheet)
{
xlSheetWriteStr(sheet, 2, 1, L"Hello, World !", NULL);
xlSheetWriteNum(sheet, 3, 1, 1000, NULL);
}
xlBookSave(book, L"example.xls");
xlBookRelease(book);
}
return 0;
}
Thanks,
Faez
|
|
|
|
|