Click here to Skip to main content

Nemanja Trifunovic - Professional Profile

Summary

18,460
Author
7,575
Authority
30,619
Debator
25
Editor
90
Enquirer
9,717
Organiser
5,133
Participant
Born in Kragujevac, Serbia. Now lives in Boston area with his wife and daughters.
 
Wrote his first program at the age of 13 on a Sinclair Spectrum, became a professional software developer after he graduated.
 
Very passionate about programming and software development in general.
Member since Tuesday, June 12, 2001 (11 years, 11 months)
  • 24 Aug 2009: Best C++/MFC article of July 2009
  • 24 Feb 2007: Best C++/MFC article of Jan 2007

Contributions

Articles 15 (Legend)
Tech Blogs 0
Messages 6,095 (Master)
Q&A Questions 0
Q&A Answers 50
Tips/Tricks 0
Comments 19

Links

Reputation

For more information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege, and the given member types also gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilverAdmin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your biographybronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an Articlesilversilversilversilver
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

Actions with a green tick can be performed by this member.


 
You must Sign In to use this message board.
Search this forum  
GeneralStandard Features Missing From VC++ 7.1 Pin
Friday, April 2, 2010 3:23 PM by Nemanja Trifunovic
Six years ago I wrote a short series of aticles about the three Standard C++ features not implemented by Visual C++ 7.1. Interestingly[^] one of these three features is being removed from the standard (keyword export) and another deprecated (exception specifications).

 
GeneralConcepts voted out of C++ 0x Pin
Monday, July 20, 2009 7:02 AM by Nemanja Trifunovic
A shocking news from the the C++ standards committee meeting in Frankfurt: concepts are removed from the new C++ standard[^]. It seems that we are going to deal with "interesting" compiler errors from templated code.
 

 
GeneralWindows Web Services API Pin
Tuesday, March 31, 2009 10:23 AM by Nemanja Trifunovic
Ever since ATL Server[^] was moved to CodePlex, we have had no native SOAP library from Microsoft. Now, there is Windows Web Services API (WWSAPI)[^] which comes preinstalled on Windows 7 and Windows Server 2008, but can be separatelly installed even on XP.
 

GeneralRe: Windows Web Services API PinmvpRajesh R Subramanian26 Jun '09 - 9:28 
 
GeneralRvalue references Pin
Thursday, March 13, 2008 4:42 AM by Nemanja Trifunovic
A nice and easy to reade article A Brief Introduction to Rvalue References[^] was published at artima.com
 
What is the deal with rvalue references? They are introduced to enable move semantics, which would avoid many unneeded copies - think factory functions, STL containers, etc.
 
Another good article on the same topic can be found here[^]
 

GeneralRe: Rvalue references PinmemberHamid.23 May '08 - 6:53 
GeneralRe: Rvalue references PinmemberNemanja Trifunovic23 May '08 - 7:12 
GeneralRe: Rvalue references Pinmembersuper_ttd20 Aug '08 - 9:50 
 
GeneralState of C++ Evolution Pin
Tuesday, March 4, 2008 11:31 AM by Nemanja Trifunovic
The current state of the new C++ 09 Standard is summed up here[^].
 
The best thing I see is that the Garbage Collector is dropped out Jig | [Dance]
 

GeneralRe: State of C++ Evolution PinmvpRajesh R Subramanian5 Mar '08 - 6:38 
 
GeneralBoost 1.34.0 Pin
Monday, May 14, 2007 8:27 AM by Nemanja Trifunovic
It's been a while, but finally the new version of Boost[^] is out.
 
Among the new libraries there is Boost.Foreach[^] which enables something like:
 
std::string hello( "Hello, world!" );
    
BOOST_FOREACH( char ch, hello )
{
   std::cout << ch;
}
 
Also, there are Boost Statechart[^] for easy coding of finite state machines, Expressive[^], a regex library that enables compile time regexes and Boost.Typeof[^] that offers a library-based alternative to the typeof keyword, planned to be introduced in the next version of the Standard.
 
As for the library updates, I find the performance optimization of Boost.Function significant - now it doesn't use heap at all in some cases.
 

 
GeneralCopying C-style arrays [modified] Pin
Tuesday, January 30, 2007 3:29 AM by Nemanja Trifunovic
It always astonishes me how I learn something new after all these years of programming with C++.
 
Say you have a built-in array of C++ string objects:
 
string s1[3] = {"1", "2", "3"};
 
Declare the second array of the same type, and try to assign the first array to the second one:
 
string s2[3];
s2 = s1;
 
and you'll get a compiler error (C2106 with VC++ 8.0).
 
OK, we all knew that, right? But what happens if we just wrap it in a class:
 
struct test {
  string s[3];
};
 
// ...

test a = {"1","2","3"};
test b = a;
 
This works just fine: members of b are copies of the members of a.
 
This is the result of the standard behavior of default copy constructors:
 
The implicitly-defined copy constructor for class X performs a member-
wise copy of its subobjects. The order of copying is the same as the
order of initialization of bases and members in a user-defined con-
structor (see _class.base.init_). Each subobject is copied in the
manner appropriate to its type:
 

--if the subobject is of class type, the copy constructor for the
class is used;
 

--if the subobject is an array, each element is copied, in the manner
appropriate to the element type;

 

--if the subobject is of scalar type, the built-in assignment operator
is used.


 

GeneralRe: Copying C-style arrays Pinmemberyadrif2 Oct '07 - 6:01 
GeneralRe: Copying C-style arrays PinmemberNemanja Trifunovic2 Oct '07 - 8:54 
 
GeneralDisabling checked iterators in VC 8.0 Pin
Wednesday, October 4, 2006 2:34 AM by Nemanja Trifunovic
Many developers are shocked by a drop in performance when upgrading an application that uses STL from VC 2003 to VC 2005. The reason for this is that the MS version of the Standard Library has checked iterators[^]switched on by default even in release mode. To turn this feature off, define _SECURE_SCL to be 0 in your project settings; the performance gain is impressive.
 

 

 
GeneralC++0x: Lambda expressions Pin
Tuesday, March 21, 2006 8:48 AM by Nemanja Trifunovic
I was happy to learn that an official proposal for introducing lambda expressions to the next version of the C++ Standard was submitted.
 
According to that proposal, a lambda expression would look like:
 
<>(int n)->int {return 2*n;}
 
That may not be very pretty, but who cares - as long as we don't need to write functors for every for_each operation.
 
The proposal can be found here[^]

 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

 
Generalfor each in C++ 0x Pin
Wednesday, December 28, 2005 2:09 PM by Nemanja Trifunovic
According to Herb Sutter's PDC presentation[^], for each syntax in C++0x will most likely be modeled after Java, and not after C# or C++/CLI. It may be we will write something like:
 
for each (int i : v) {...}
 
rather than
 
for each (int i in v) {...}
 
Two small remarks from my side:
 
1. Isn't C++ too expressive already? I know the C++ standard comitee is very reluctant to introduce new keywords, but the price is too often reduced readability.
2. Is C++ now catching up with Java and C#? Of course, with all these millions of existing lines of code written in C++, being conservative is the only way to go, but where is the fine line between the helthy dose of conservativism and becoming obsolete? For instance, C# 3.0 is getting lambda expressions, and it is going to be released probably in a couple of years. The next version of C++, optimistically called C++0x which may or may not include lambda expressions is far from being adopted, and even when it happens, how long will it take for major compiler vendors to implement its features?
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

GeneralRe: for each in C++ 0x Pinmembertoxcct31 Jan '06 - 0:03 
GeneralRe: for each in C++ 0x PinmemberPavel Vozenilek18 Mar '06 - 17:25 
GeneralRe: for each in C++ 0x PinmemberNemanja Trifunovic19 Mar '06 - 1:44 
GeneralRe: for each in C++ 0x PinmemberPavel Vozenilek19 Mar '06 - 14:02 
 
GeneralType inference in C++ 0x Pin
Sunday, December 18, 2005 5:25 AM by Nemanja Trifunovic
One of the language features that are likely to get included into the next version of the standard is type inference. Namely, if the compiler can deduce the type of the variable, we can declare it with keyword auto:
auto i = 1;
Many people confuse type inference with variant types, but it is not the case. In the sample above, i is declared as int, not variant. In other words, it is exactly equivalent to:
int i = 1;
Type inference is also going to be included in C# 3.0, but the choice of the keyword is very unfortunate: var. For instance the same construct:
var i = 1;
means one thing in JavaScript (i is variant) and another in C# (i is int)
 
How is this useful? It can save us a lot of typing, and annoying syntax errors. Say we have:
vector<int> v;
vector<int>::iterator b = v.begin(); //without type inference
auto e = v.end(); // with type inference
For more information, see the official proposal document.[^]

GeneralRe: Type inference in C++ 0x Pinmembertoxcct30 Jan '06 - 23:57 
GeneralRe: Type inference in C++ 0x PinmemberNemanja Trifunovic31 Jan '06 - 1:57 
 
GeneralVisual C++ 2005 Pin
Friday, November 18, 2005 1:47 AM by Nemanja Trifunovic
In general, I try to be somewhat conservative when it comes to adopting new technologies in production work. Sure, it is important to stay informed and try all the latest buzz, but for the work that actually brings food to the table I prefer widely adopted and well tested tools.
 
Having said all that, I spent last couple of days porting the client side of a distributed linguistic application from VC++ 6.0 to VC++ 8.0 (aka VC++ 2005), and the later was released a couple of weeks ago. That was a two-step operation: first I did the port from 6.0 to 7.1 which I know very well, and once it compiled there, another step was from 7.1 to 8.0.
 
It was somewhat surprising how many errors appeared in the second step. Most of them actually come from unstandard programming practices that originate in VC 6.0, but were tolerated in VC 7.1 (declarations within for loops, wchar_t a typedef for unsigned short,...), but some of them are really surprising. For instance, I found out that some libraries (xalan, crypto++) compile fine in Release mode, but in compile mode they report compile error C2678 somewhere from xutility. The solution is not exactly obvious: adding a preprocessor definition _HAS_ITERATOR_DEBUGGING=0.
 
All in all, I like VC 2005 so far. The compiler is better, and IDE has some nice new features: Error window, graying out "ifdef-ed" code, Intelisense is better than ever. The interesting question is C++/CLI. Is it going to be adopted among developers? I wish it did, but frankly it would surprise me: C++ developers don't need .NET, and .NET developers don't know what to do with C++.
 

 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
QuestionRe: Visual C++ 2005 Pinmemberddtopham5 May '07 - 19:29 
AnswerRe: Visual C++ 2005 PinmemberNemanja Trifunovic6 May '07 - 2:30 
QuestionRe: Visual C++ 2005 [modified] Pinmemberddtopham6 May '07 - 5:12 
AnswerRe: Visual C++ 2005 PinmemberNemanja Trifunovic6 May '07 - 14:49 
 
GeneralC# 3.0 Pin
Thursday, September 15, 2005 9:31 AM by Nemanja Trifunovic
It is no secret that I am not very impressed with C#. I have worked with it because at one point it was declared a standard language in the company I work for, but I never really enjoyed it. Version 2.0 that is expected to appear in November is an improvement, but still nothing that would tempt me to switch to C# as my primary programming language.
 
However, I have seen the proposals for C# 3.0, and now I begin to wonder. So far, the new features include:
 
- type inference[^] for local variables;
- lambda expressions[^];
- anonymous types[^];
- object and collection initializers;
- query expressions;
 
C# 3.0 looks like a hybrid between an object and a functional language, almost like OCaml. To be honest I never expected C# team to be that brave in introducing new features, especially given the profile of a typical C# developer. It still does not mean I would take it by default for my new projects when I have a chance to choose: lack of performance and the fact that it runs in a managed environment still turn me off; however, just for the curiosity, I might take a good look into it.

 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

GeneralRe: C# 3.0 PinmemberLongHC29 Oct '05 - 5:10 
GeneralRe: C# 3.0 PinmemberNemanja Trifunovic29 Oct '05 - 7:57 
 
GeneralA memory leak, or a memory drop Pin
Thursday, September 1, 2005 3:27 AM by Nemanja Trifunovic
So, I downloaded Boost 1.33, built it with BJam, and checked it in our VSS database. Having finished the whole exercise much sooner than originally planned, I decided to play a little bit with Boost Thread library. So I ran a simple test:
 
#include <vld.h>
#include "boost/thread.hpp"
#include <iostream>
 
void threadFunc ()
{
	std::cout << "Hello, thread!";
}
 
int main()
{
	boost::thread th(threadFunc);
	th.join();
}
 
Note the vld.h header. I got into habbit of using the excellent Visual Leak Detector[^] by Dan Moulding, and sometimes I just include it even in the most trivial samples like the one above.
 
Surprise! The output from VLD:
 
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 137 at 0x00328DE8: 24 bytes ----------
  Call Stack:
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\mutex.inl (55): `anonymous namespace'::new_critical_section
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\mutex.cpp (48): boost::mutex::mutex
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\tss_hooks.cpp (29): `anonymous namespace'::init_threadmon_mutex
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\once.cpp (174): boost::call_once
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\tss_hooks.cpp (150): on_thread_exit
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\thread.cpp (117): thread_proxy
    f:\vs70builds\3077\vc\crtbld\crt\src\threadex.c (241): _threadstartex
    0x7C80B50B (File and line number not available): GetModuleFileNameA
  Data:
    A0 3F 14 00    FF FF FF FF    00 00 00 00    00 00 00 00     .?...... ........
    00 00 00 00    00 00 00 00                                   ........ ........
 
---------- Block 136 at 0x00328AB0: 8 bytes ----------
  Call Stack:
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\tss_hooks.cpp (29): `anonymous namespace'::init_threadmon_mutex
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\once.cpp (174): boost::call_once
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\tss_hooks.cpp (150): on_thread_exit
    c:\myprojects\libraries\boost\v1.33\libs\thread\src\thread.cpp (117): thread_proxy
    f:\vs70builds\3077\vc\crtbld\crt\src\threadex.c (241): _threadstartex
    0x7C80B50B (File and line number not available): GetModuleFileNameA
  Data:
    E8 8D 32 00    01 CD CD CD                                   ..2..... ........
 
Visual Leak Detector detected 2 memory leaks.
'cpptest.exe': Unloaded 'C:\WINDOWS\system32\dbghelp.dll'
'cpptest.exe': Unloaded 'C:\WINDOWS\system32\version.dll'
 
What happened here? Let's concentrate on the second one, from tss_hooks.cpp. The function from which the leak is reported looks like this:
 
void init_threadmon_mutex(void)
  {
  threadmon_mutex = new boost::mutex;
  if (!threadmon_mutex)
    throw boost::thread_resource_error();
  }
 
So, the mutex object is created, but apperently never destroyed. Why?
 
If we look again at the call stack reported by VLD, we'll notice that function init_threadmon_mutex was called by boost::call_once, which in effect means we have a singleton here: threadmon_mutex can be created only once. Therefore, we don't really have a leak here: an object is created on the heap and never destroyed (more precisely, it gets destroyed when the process ends), but that's it. The problem with memory leaks is really repeatingly allocating memory that never gets released, and thus ending up with a crash; with Boost Thread library it can't happen - we can't create threadmon_mutex multiple times, it is a singleton. It is really a "memory drop", not a memory leak.
 

GeneralRe: A memory leak, or a memory drop Pinmembertrapitox19 Dec '06 - 23:20 
 
GeneralBoost 1.33 and new look Pin
Sunday, August 21, 2005 3:29 PM by Nemanja Trifunovic
A week ago or so, I noticed the new look of Boost[^] website. But more important, there is a new release with 5 new libraries and many updates for existing ones. This will be the first time I actually build Boost libraries - until now it was handled by a co-worker of mine who has left the company several months ago. Time to learn BJam[^] I guess Smile | :)
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
 
GeneralRefactoring to Patterns Pin
Thursday, July 14, 2005 3:29 PM by Nemanja Trifunovic
I ran into this book[^] in a bookstore. Generally, I dislike hype very much, and the title of this book is really "Hype to Hype", but I still decided to skim it. The things I expected to find were "how to apply 50 design patterns to write Hello World in Java".
 
What a surprise! In the very first chapter, author mentions the two most common errors in software design: overengineering and underengineering, and describes how he learned to avoid the first pitfall. Against my expectations, he does his best to warn readers of "patterns panacea" and "pattern happy" programmers. Instead, he advises the use of test driven development, and refactoring to patterns only when a real need justifies it.
 
I have suffered from both underengineered and overengineered design in my career, but it is the later that actually makes me angry more than the former: I don't want to waste my time learning someone's bloated frameworks that serve no real life purpose, and constrain me in solving real life problems. This kind of behavior is mostly typical of Java culture, which I don't belong to, but recently I have seen the same trend among C# developers, although to a lesser extent: everybody designs their own plug-in frameworks, their own XAML's, their own "enterprise frameworks", and complicate the design of their applications without any real need.
 
Does anybody remember the "KISS" principle any more? It seems that Joshua Kerievsky does, inspite of the title of his book.
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

 
GeneralPrivate virtual functions in C++/CLI Pin
Saturday, June 25, 2005 10:24 AM by Nemanja Trifunovic
One of the things I generally liked about Managed C++ (as opposed to i.e. C#) is the support for private virtual functions[^]. Ie. the following code will compile and run fine with MC++:
 
__gc class Base { 
        virtual void SomeVirtualFunction() 
        {Console::WriteLine(S"Base");} 
public: 
        void SomeAccessibleFunction() 
        {SomeVirtualFunction();} 
 

}; 
 
__gc class Derived : public Base { 
        virtual void SomeVirtualFunction() 
        {Console::WriteLine(S"Derived"­);} 
 

}; 
 
int _tmain() 
{ 
    Base* handle = new Derived(); 
    handle->SomeAccessibleFunction­(); 
    return 0; 
} 
 
However, take a look at the equivalent C++/CLI (Beta 2) code:
 
ref class Base { 
        virtual void SomeVirtualFunction() 
        {Console::WriteLine(L"Base");} 
public: 
        void SomeAccessibleFunction() 
        {SomeVirtualFunction();} 
}; 
ref class Derived : public Base { 
        virtual void SomeVirtualFunction() override
        {Console::WriteLine(L"Derived"­);} 
}; 
int main() 
{ 
        Base^ handle = gcnew Derived(); 
        handle->SomeAccessibleFunction­(); 
        return 0; 
} 
 
 
(Note the override keyword in the derived class)
 
This program will compile, but with warnings like:
warning C4486: 'Base::SomeVirtualFunction' : 
a private virtual method of a ref class or value class should be marked 
'sealed' 
 
However, when the program is run, an exception is thrown:
An unhandled exception of type 'System.TypeLoadException' occurred in 
Virtual.exe 
 
Additional information: Method 'SomeVirtualFunction' on type 'Derived' 
from assembly 'Virtual, Version=1.0.1999.26811, Culture=neutral, 
PublicKeyToken=null' is overriding a method that is not visible from 
that assembly. 

 
When comparing the IL generated by the two versions of Managed C++, I found out that C++/CLI adds an attribute strict to the declaration of virtual functions, and that caused this exception at run time.
 
The explanation came from Microsoft program managers Ronald Laeremans and Brandon Bray: Allowing private virtual functions is a security breach in managed (but not in unmanaged!!!)code, and that's why all Microsoft complers now emit strict.
 
Take a look at the complete thread here[^]
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
 
GeneralDispose Pattern Pin
Thursday, June 2, 2005 8:44 AM by Nemanja Trifunovic
If you have ever thought dispose pattern was simple, read this[^] and you will definitelly change your mind WTF | :WTF:
 
I just hope C++/CLI will automate this once it is finished.
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
GeneralRe: Dispose Pattern Pinmemberwaxie12 Jun '05 - 21:42 
GeneralRe: Dispose Pattern PinmemberNemanja Trifunovic15 Jun '05 - 5:50 
 
General"Try simpifying the program" Pin
Monday, May 23, 2005 6:26 AM by Nemanja Trifunovic
I guess I was sleepy when I tried this (Windows Forms C#) code:
 
private void FillList()
{
	System.IO.DirectoryInfo di = new System.IO.DirectoryInfo (lblPath.Text);
	System.IO.FileSystemInfo[] files = di.GetFileSystemInfos();
	lstFiles.ObjectCollection = files;
}
 
The last line is obviously a mistake, but the error that was reported by compiler could easily make somebody reinstall Visual Studio:
 

Performing main compilation...
error CS0583: Internal Compiler Error (0xc0000005 at address 535DB559): likely culprit is 'BIND'.
 
An internal error has occurred in the compiler. To work around this problem, try simplifying or changing the program near the locations listed below. Locations at the top of the list are closer to the point at which the internal error occurred.

c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(30,4): error CS0585: Internal Compiler Error: stage 'BIND'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(26,16): error CS0584: Internal Compiler Error: stage 'BIND' symbol 'DefectTrackingConverter.MainForm.FillList()'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(26,16): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter.MainForm.FillList()'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(26,16): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter.MainForm.FillList()'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(26,16): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter.MainForm.FillList()'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(13,15): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter.MainForm'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(8,11): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(1,1): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol ''
C:\Documents and Settings\ntrifunovic\My Documents\ChangeManagement\DefectTrackingToVI\DefectTrackingConverter\MainForm.cs: error CS0586: Internal Compiler Error: stage 'COMPILE'
error CS0587: Internal Compiler Error: stage 'COMPILE'
error CS0587: Internal Compiler Error: stage 'BEGIN'
error CS0583: Internal Compiler Error (0xc0000005 at address 536250C6): likely culprit is 'BIND'.
 
An internal error has occurred in the compiler. To work around this problem, try simplifying or changing the program near the locations listed below. Locations at the top of the list are closer to the point at which the internal error occurred.

c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(26,16): error CS0584: Internal Compiler Error: stage 'BIND' symbol 'DefectTrackingConverter.MainForm.FillList()'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(26,16): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter.MainForm.FillList()'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(26,16): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter.MainForm.FillList()'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(26,16): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter.MainForm.FillList()'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(13,15): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter.MainForm'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(8,11): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'DefectTrackingConverter'
c:\documents and settings\ntrifunovic\my documents\changemanagement\defecttrackingtovi\defecttrackingconverter\mainform.cs(1,1): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol ''
C:\Documents and Settings\ntrifunovic\My Documents\ChangeManagement\DefectTrackingToVI\DefectTrackingConverter\MainForm.cs: error CS0586: Internal Compiler Error: stage 'COMPILE'
error CS0587: Internal Compiler Error: stage 'COMPILE'
error CS0587: Internal Compiler Error: stage 'BEGIN'
 
Build complete -- 23 errors, 0 warnings
 

 
My favorite part is this:
 

An internal error has occurred in the compiler. To work around this problem, try simplifying or changing the program near the locations listed below. Locations at the top of the list are closer to the point at which the internal error occurred.

 
Just "simplify" the program, and everything should be fine Big Grin | :-D
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
 
GeneralException handling in a wizard-generated code Pin
Wednesday, May 4, 2005 3:18 AM by Nemanja Trifunovic
If you ever use the Visual Studio Add-in wizard to generate a skeleton for a VS add-in, pay attention to this piece of code:
 
catch(System.Exception e)
{
    //TODO: You know...Exceptions were invented for a reason!!! :-)
}
 
Yeah, I know, error handling is not easy, but it can't be replaced by humor.
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
 
GeneralA first look into F# Pin
Wednesday, April 27, 2005 9:37 AM by Nemanja Trifunovic
I decided to play with F#[^], an ML dialect that maps to .NET framework. Reasons? I've never really learned any functional language, and F# looks like an interesting first step. I downloaded the installer from the MS site, and although there were some glitches, I installed it successfuly. It even integrates into VS, although it is far from perfect. Documentation is very poor, so I am mostly using OCaml tutorials for the time being. Here is a simple program in F#:
 
(* A sample function *)
let avg a b =
	let sum = a +. b in 
	sum /. 2.;;
 
(* this is what we used to call main *)
let _ =
	System.Console.WriteLine(avg 4. 6.);;
 
Sexy, ah? Cool | :cool: One thing I hate about C-like languages is curly braces all over the place, and look how cute it looks without them. I might just get to like F#...
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
GeneralRe: A first look into F# PinstaffNishant Sivakumar20 Jun '05 - 2:19 
 
GeneralIncreasing the amount of available memory with LARGEADDRESSAWARE flag Pin
Tuesday, April 12, 2005 4:33 AM by Nemanja Trifunovic
Consider this piece of code:
 
#include<new>
#include<iostream>
#include <string>
#include <vector>
using namespace std;
 

int main()
{
    int i = 0;
    const wstring rec(1024*1024, L'A');
    vector<wstring> korpus;
    try
        {
        for (;;i++)
            korpus.push_back(rec);
        }
    catch (bad_alloc& be)
        {
        cout << be.what() << " " << i ;
        }
    catch (exception& e)
        {
        cout << e.what();
        }
    return 0;
}
 
When I run it on my machine, it throws bad_alloc at iteration 711. That means I have roughly 1.4Gb of available heap, which is in line with what I expected. But what if I need more? The ultimate solution is to switch to 64 bits of course, but it may be too early for that: the user needs to have hardware and OS that supports this new architecture. However, it turns to be pretty easy to increase available heap by 50% on existing architectures. Here is the procedure for that:
 
- Link your application with /LARGEADDRESSAWARE flag. If you don't have the source or don't want to recompile, use the utility Editbin.exe to add this flag to an existing executable.
- On a client machine, add /3GB parameter to boot.ini and restart the machine.
Result: for my test application, the exception is thrown at 1066th iteration - a 50% increase in memory space.

 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
 
GeneralFriend template functions Pin
Monday, February 7, 2005 2:24 AM by Nemanja Trifunovic
At a forum I moderate, someone asked why this code results in a linker error:
 
#include<iostream>
using namespace std;
template<class T>
class SomeClass{
   private:
       T member;
   public:
...
   friend ostream& operator<<(ostream &,SomeClass <T>&);
};
 
template <typename T>
ostream& operator<<(ostream &os, const SomeClass<T>&some){
          os<<"( " <<some.member <<") ";
          return os;
}    
 
int main(int argc, char* argv[])
{
SomeClass<int> sc(5);
cout << sc; // Problem????
return 0;
}
 
 
It reported that operator << was not found.
 
The problem is that in the class definition, a friend was declared as a function, not a template function. To make the code link properly, the friend declaration should be changed to:
 
friend ostream& operator<< <>(ostream &,SomeClass <T>&);
 
Just another little C++ twist Smile | :)
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
 
GeneralAn ideal programming language Pin
Thursday, December 23, 2004 6:45 AM by Nemanja Trifunovic
There has been a Code Project survey[^] on the features of an "ideal" language, and also several VB vs C# rants in the Lounge recently. That made me think again: how would my favourite language look like?
 
Without any doubt, semantics would be modeled after C++[^]. I simply love its static type system, support for value semantics and multi-paradigm nature. One thing I don't like about C++ is the syntax: in my opinion it is too expressive and unreadable. Even Bjarne Stroustrup admits he would have prefered to use Algol 68-like syntax, but C was much more popular.
 
On the other hand, I like the syntax of Modula-3[^]. Watch this snippet of code:
MODULE MyModule;
 
IMPORT IO;
 
PROCEDURE PrintThing(READONLY r: Thing) = 
  BEGIN
    IO.Put(r.name&"\t");
    IO.PutInt(r.size);
    IO.Put("\n");
  END PrintThing;
 
PROCEDURE MakeThing(n: TEXT; s: INTEGER): Thing =
  BEGIN
    RETURN Thing{n, s};
  END MakeThing;
 
END MyModule.
Even if you've never programmed with Modula-3 (I didn't), the code is readable and logical. Compare
  END MakeThing;
 
END MyModule.
with (Java or C#)
  }
}
However, I don't like Modula-3 semantics: single inheritance, garbage collector on per type basis, no support for type-safe collections, no deterministic finalization.
 
The solution would be: a language with Modula-3 syntax and C++ semantics. Funny enough, some of the most popular languages are quite opposite: C++ syntax and Modula-3 semantics - in my eyes the worst of both worlds.
 


My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
GeneralRe: An ideal programming language Pinmemberbob1697230 Sep '05 - 23:10 
GeneralRe: An ideal programming language PinmemberNemanja Trifunovic3 Oct '05 - 3:05 
JokeRe: An ideal programming language PinmemberShermansLagoon12 Feb '07 - 23:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 21 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid