Will be Prosumer's Revolution and Technical Revolution in the Future!
Linux User/Developer is also Windows User/Developer... Cross Platform Engineer...
"이제는 공학인을 대통령, 국회의원으로 만들자!" "더욱 더 많은 동지분들이 공학제국 건설에 동참할 수 있도록 널리 알려주세요~" [ F = m * a ]
어느덧 리눅스는 공학인 뿐만 아니라 모든 사람들이 탐험해 보아야 할 필수 요소가 된것 같습니다!
한번쯤 색 다른 미지의 세계를 경험해보는 것도 나쁘진 않을 것입니다. 재미있잖아요.(PLAY~ LINUX!) ^^
어떤 형태로든 자신이 작업/테스트/삽질?해 보았던 경험들을 LUG에 문서로 남겨두면 후배, 동지분들에게 도움이 되겠지요.
Is there a way in standard C++ for a function to determine where it was called from? For example. add(int x, int y) { std::cout << "Called by: " << what_function? << std::endl; return x + y; So if add() was called directly from main() then main() would be printed. Or if add() was called by another function, then the name of
I've just got bitten by this in the new Visual Studio, where in conformance to the new 0x standard the types of set::iterator and set::const_iterator are identical. We have quite a bit of code that relies on being able to modify objects in sets. I'm pretty sure the idea is that a set falls in a big heap if you do
In article <lnbp88kpc0....@nuthaus.mib.or g>, ks...@mib.org says... Because the loops absolutely, positively must execute at least once. My attempt at a C++ version failed. I am not sure what is wrong with the second method. class MWC { private: unsigned long xs; unsigned long xcng; unsigned long Q[4691];
[This article is cross-posted to comp.lang.c++ and comp.programming] I was a bit shocked when I saw this a few days ago. I then used the MIT Open Courseware feedback option to inform them of the problems, where I explained things at about the same detail level as below, and was told that if a response
Hello all, I have written a simple function as follows: void test(float &b) { b = 100; int main() { float *a; a = new float[2]; test(*a); delete [] a; Now I initialized the first element of array using b =100 inside function test(). But I cant find how to initialize the second element of this array ?
Hello, I am unable to find any decent article on multiple inheritance. Can someone point me to the same? I am specifically interested in implementation details of virtual inheritance. (i.e. how are the objects laid out in memory, how is the virtual pointer table made etc. Thanks...
For free Download Lectures of Programming Languages and Presentation related to the field of Computer Science.Visit [link] This blog include all the relevant subject related to the field of Computer Science. This blog will help computer science teachers as well as students in
Hello, I'm Alberto from Italy, and I would be glad to know if it's true that a good C++ programmer is very well payed in the U.S.A. and in Australia. Thanks, Alberto.
I need to find some information on how a program can deal sensible information on users' computers in such a way that it is not directly accessible and/or modifiable? Any information is appreciated. Thanks
Hi all, I'm porting a library to a cpp research compiler. Unfortunately compiler support for templates is limited and I must create specialised versions of each template function I come across. This ends up with a lot of code duplicated by hand. I'm looking for a quick way to do this automatically, that I can easily remove; likely in a
Why Insulation is a Good Investment Investing in products to make homes more energy efficient pays significant dividends over a lifetime — with none of the wild fluctuations of Wall Street. Insulation contributes to: - Greater comfort - Even temperature distribution - Improved acoustics - Better moisture control, which can reduce floor squeaks, drywall
Hello, I am trying to optimize integer rescaling (see example at the end). There is a range or integer elements (in the example, elements are of type unsigned short), current range maximum, and the desired maximum. Straight forward way is to multiply by new maximum, and then to divide by old maximum (taking care about the overflow).
string func() { string msg="ABC"; return msg; int main() { string s; s=func(); cout<<s; return 0; The program prints s as "ABC", but msg was a local string of func() and not of main & hence the output should have been any garbage value but not the same string as "ABC". Is it occuring because on the top of the stack(that gets generated on
Hi I need this not only for Win/Lin but also for Mac. So it's fine for / and \ within paths but how should I add the old : which were used once for mac paths? Many thanks Michael string Texstr = filepath; string::size_type n = Texstr.find_last_of("/\\\:");
These days telecom industries face many challenges such as rise of branded services platforms, user interface differentiations, localization of mobile applications and the need of matching mobile phones with new initiatives like new technology bands and innovative operating systems like open source and Android.
Hi all! Given: std::vector<TYPE> v; void process(size_t count, TYPE* data); Is there any problem if I do if (!v.empty()) { std::vector<TYPE>::reference r = *v.begin(); // or r = v[0]; // or r = v.at(0); process_raw(v.size(), &p); ? (This is what I do all the time to interface with lower-level code,
hi, there, Can I pass auto_ptr in the following manner? auto_ptr<T> obj; // The obj is not initialized and null here, right? function(obj); // Do I get the initialized obj here? void function(auto_ptr<T> obj){// can I pass a null auto_ptr into the function and get initialized inside? obj(new T()); Thanks a lot.
hi, i'm a newbie of c++ and i have a strange problem with compiling a c++ source kdeveloper, gcc 4.2.4, slack. i've 2 files, S3.cpp and S3.h s3.h: using namespace std; ... class campo { public: campo() { fldInp=new_field(1, 1, 1, 1, 0, 0); } campo(int intXInp, int intYInp, int intLungInp, int intAltInp,
Hi again! I am still learning through examples, and still I am struggling with matrix classes! :) I have a probably naive question: how do I "force" C++ to use a const member? I mean, I have learned (through your suggestions) about const members, for example my at() member in the matrix class: class matrix
Hello all, I have recently experimented (just for experiment's sake) with declaring variables and functions of arbitrarily complicated types without using typedefs, and finally learned to do it. By saying arbitrarily complicated, I DO mean arbitrarily complicated :). This led me to believe that any piece of code(let's precautiously add
Hi, I want to do a task of modifying the elements in a range, say 5th element to 10th element.. I also know that there is a function TRANSFORM which is used to transform the elements of any container, say a vector, but in that function, the arguments are iterators, and what I have is a range and not iterators to these elements.
Hi, I wrote a utility class, say Util, which will be used by several projects. It's like the following senario: Util.h, Util.cpp --> will be used by project A, project B. option1: I can make Util.cpp a dll, which can be shared by A and by B. --> but exporting a class is not good, also not elegant.
Range-based for loop description says 6.5.4/1: "... begin-expr and end-expr are begin(__range) and end(__range), respectively, where begin and end are looked up with argument-dependent lookup (3.4.2)." And 3.4.2 says at 3.4.2/3: "Let X be the lookup set produced by unqualified lookup (3.4.1) and let Y be
std::string s = "easy"; std::string unicode_string; std::string::const_iterator it, for(it = s.begin(); it != s.end(); ++it) { unicode_string.push_back(*it); unicode_string.push_back('\0') ; The above for loop would make unicode_string look like this: "e null a null s null y null" Is there a faster way to do this... in place maybe?
Hi, ----------code---- int main(){ char Md5Str[34] = "670B14728AD9902AECBA32E22FA4F 6BDx"; char Md5Value[1]; sscanf(Md5Str, "%02X", &Md5Value[0]); -------------------- It gives me "run-time check failure #2 stack around the variable was corrupted" error. But I expected the Md5Value array is large enough to hold the only
The desired outcome of the following is that it works (latest draft, n3126) template<typename T> void f() { } template<typename T> void g(T) { } int main() { g(&f<int>); } But I see a problem with that: When is the "&f" inspected in the gist of 14.8.1/3? We can have several places where we could apply it:
Hello, I have measurements done daily (work days) for the past 20 years or so, in the order then of 5000 or so entries. I currently have them in a text file (I've hand written the parser but I'll move to boost::spirit eventually) The application is growing: . I may move to 20 years worth of measures every few seconds and arrive at a
Hello everybody out there using C++, My C++ program should retrieve binary data from a database and write it to a file. It looks like this: using namespace std; int main(void) { PGconn *conn; PGresult *res; conn = PQconnectdb("hostaddr='my.remo te.host' port='5432' dbname='my_db' user='user' password='secret' connect_timeout='9'");
With MSVC 10.0 std::bitset<32>( 666u ) does not compile. Apparently due to an extra constructor taking 'int' argument. Is that allowed by the standard? Cheers, - Alf
Hi there, as far as I've been able to understand, if a raw pointer contains an invalid value (that is, it does not point to any valid object of the type it is a pointer to) then some of the actions performed on these pointers will lead to UB. As it seems, two actions in particular should be safe and well defined:
Hello, I have a std::map<std::string, boost::shared_ptr<my_type_t>>. I often lookup based on the key (std::string) I have a use case where I want to iterate over all the map except for keys that begin with "RF". I could iterate and check if iterator->first.find("RF")==0, then ignore it. typedef std::map<std::string, boost::shared_ptr<my_type_t>> my_container_t;
Hi, the following code does not compile and being a newbie, i am unable to figure it out. could you please help? int add( int i, int j ) { return i+j; } BOOST_AUTO_TEST_CASE( my_test ){ BOOST_CHECK( add( 2,2 ) == 4 ); compiled with the command, g++ test.cpp -lboost_unit_test_framework Error: undefined reference to `main'
Libraries of data structures designed to support concurrent operations and to scale well with the number of threads are common, e.g., ConcurrentHashMap and ConcurrentLinkedQueue in Java, ConcurrentQueue and ConcurrentBag in .NET, concurrent_queue and concurrent_vector in TBB and PPL. If the comments in a
hi, there, Assume I have a vector of points vector<obj*> v and I need to free the memory. More over, some of the element in v are already deleted (null pointer). Is it ok if I do like this: for (vector<Obj*>::iterator it(v.begin()), ite(v.end()); it!= ite; + +it{ if (*it != 0){ delete *it;
Hello, I'm writing some cross-platform software in C++, within it I have a list of strings for various languages - My problem now is, how do I determine the language setting of the person running the code so I can present them information in the correct language? I'd rather not have to resort to an entire framework just for this small function.
Hello, I have a template like below : template<class T, class U> struct X { void f(); I want a partial specialization as : template <class T> void X<T, char>::f() { cout << "Partial specialization 1" << endl; } It doesnt work. My Visual studio 2008 compiler says : error C3860: template argument list following class template name must
Hi, Can anyone explain please why gcc (and possibly other compilers too) treats scalar types and classes differently in terms of the order in which their operator++ is executed? For example, the following code: int x(0), y(0); y = x++ + x++; printf("x=%d y=%d\n", x, y); yields output: x=2 y=0 as if the code had been:
Hi there, just wondering... what are the chances of a compiler to inline a member function in a case like this: struct A { void method() { helper(); } void helper() { //... } The definition of helper() is not available where it's being used, would that mean that the compiler will not be able to inline it?
Hello, I find myself writing a lot of code like the one below where I find something out of a map and then use a reference to second to interrogate the mapped object: class Expensive { /* lots of stuff here... */ }; int main() { std::map<int,Expensive> m; m.insert(std::make_pair(1,Expe nsive(3))); // and then later
Hello, I have a piece of code that I am trying to optimize. It is nothing special - just some calculations, including trigonometric functions (bunch of multiplications with sin and cos here and there). My code duplicates in some places, but that is ok. The questions are : How complex are sin and cos functions? Are they simple look up tables?
Hi, ----injection--- class Util{ public: void print(){...} class Work{ void SetUtil(Util* pUtil){m_pUtil = pUtil;} Util* m_pUtil; ----end---- ----static---- class Util{ public: static void print(){...} ---------- What's the advantages/disadvantages when comparing these two methods? When I use these two methods in dll interface(Work class inside dll;
I am trying to set the strategy (algorithm) used in a context by template. Here is my context class (which is incorrectly implemented): template <class TStrategy> class Context //TStrategy is the algorithm { private: TStrategy * strategy_; //knows about StrategyInterface public: void execute() const
So, I'm trying to learn more about threading. Which papers are the most current? Which are the most readable breakdowns which I might comprehend without delving too deep into standardese? I've thus far found these links to be of great use: [link] [link]
Hi, Why does for (list<string> newlines = frame(oldlines), list<string>::iterator line = newlines.begin(); line != newlines.end(); ++line) not work, while list<string> newlines = frame(oldlines); for (list<string>::iterator line = newlines.begin(); line != newlines.end();
To all concerned, There are some technical problems we're experiencing with the moderation server for 'comp.lang.c++.moderated', which caused temporary suspension of processing of articles. If you posted recently and are still awaiting for your post to appear, it is due to that reason, most likely.
위 내용은 RSS를 지원하는 사이트에서 방금 읽어온 내용으로만 구성되어 있습니다.
한국LUG는 대한민국의 리눅스 지식인[사용자/개발자]들의 커뮤니티입니다. [매년 1~2회의 공개세미나 개최]
한국LUG :
울산
- 광주
- 전북
- 인천
- 대전
- LUG 위키
한국LUG 사이트는 1024 x 768 해상도(운영자 노트북:14")에 최적화 되어 있습니다. : LINUX FANSITE
WWW.LUG.OR.KR Server is made by CentOS Linux, P4 1.8G, Memory 512MB, Main HDD 160GB, Backup HDD 40GB and LAMP, qmail MTA.
CentOS Linux & Mozilla Firefox UTF-8 Base Created.
1998-2010 www.lug.or.kr Directed By Great Dragon, Kim.
Top
LUG 포인트 정책 : [회원가입 : +100점] [로그인(하루한번) : +50점] [글쓰기 : +20점] [코멘트 : +10점] [다운로드 : -200점] [질문 포인트 : 최소 200점]
데스크탑 프로그래밍(gcc, g++, wxGTK[wxWidgets] 등)은 "Fedora"를 사용하고, 서버 운영(WEB, FTP 등)은 "CentOS"를 사용하시길 권장합니다.
도전하는자, 자신을 투자하는자만이 뜻하는바를 이룰 수 있다.
Information should be Exchanged with Interactive, not One Way Direction. 준회원,
정회원,
우수회원,
VIP회원,
기업회원,
관리자
System Uptime : 06:01:01 up 44 days, load average: 0.24, 0.18, 0.17
Be Maker!
인생에서, 100% 순이익을 보장하는건 없다. 1%의 지식을 나눔으로써, 가끔씩 손해볼 필요도 있다.
그대가 가진 1%의 지식만이라도 공공을 위해 포스팅하라. 손해본다는 생각이 앞선다면 그대의 인생은 힘들어질것이다.
자신이 가진 지식의 1%도 투자하지 않고, 오로지 자신의 이익만 탐하는자와는 동지가 되지마라.
만나서 대화하면 모두 좋은 사람들이지만, 유독 인터넷에서만 자신을 밝히지 않고, 좀비로 서식하는 사람들이 많다.
부지불식간[不知不識間], 좀비(하류) 인생이 될지도 모르니, 항상 자신을 경계하도록 하라. [writer TY Kim]
[工學, engineering]
대한민국이 Global Leader로 자리매김하기 위해서는 공학(소프트웨어, 하드웨어, 기계, 전자, 전기, 화공, 재료, 건축, 토목 등) 우선 정책이 필수이다.
특히, 모든 산업의 핵심 부분을 담당하며, 고부가가치 창조의 원천인 소프트웨어 기반 산업의 약진과 수출에 한반도의 존폐가 달려있다고해도 과언이 아니다.
[도서 안내]
1. CentOS Linux
2. gcc로 공부하는 C++
베스트셀러 입성^^