junior-programmer

Javascript toFixed function

Hello, I have a question regarding toFixed() function. If I have a float e.g. - 3.123123423 and 0. How can I output it to input box with toFixed(2) so the inputbox values would be 3.12 and 0. I mean if the value is integer I want output it without trailing .00 :) ...

About code quality and designing

Hello, I don't know if I am only like this or maybe some people has same problem. Always when I get a project I don't know how to design it well. I mean I just try to make UML design, but always it doesn't show the final result. In the end project has so many changes which aren't in the design, so my drawn UML gets useless to people who...

MFC IMPLEMENT_DYNCREATE with template

Hello, Is there any way to use IMPLEMENT_DYNCREATE with an template class? If not maybe someone could explain why?Or maybe there is another solution to this? :) Example: template<typename T> class A : public B{ public: A(){ printf("A constuctor "); } void fn( ){ T* a = new T(); } }; IMPLEMENT_DYNCREATE(A<CObject>, B); ...

C++ specialization, type_of or just typeid

Hello, I would like to know what is better to use in my situation and why. First of all I heard that using RTTI (typeid) is bad. Anyone could explain why? If I know exactly types what is wrong to compare them in a runtime? Furthermore is there any example how to use boost::type_of? I have found none searching through the mighty google :...

PHP get from one php to another

Hello, I have a question: How go from one *.php file to another *.php ? In example if I have this in index.php <?php <form method="POST" action="second.php"> <input type="button" name="GO"> </form> ?> and in another second.php: <?php if ($_POST['GO']) // HERE SHOULD BE SOME CODE LIKE INCLUDE OR SMTH TO GO TO index...

Design with (pure)virtual C++

Hello, First of all I have to mention that I have read many C++ virtual questions in on stackoverflow. I have some knowledge how they work, but when I start the project and try to design something I never consider/use virtual or pure virtual implementations. Maybe it is because I am lack of knowledge how do they work or I don't know ho...

Compiler compiling external includes

Hello, I have a little problem in my project. I have build static library(e.g. test.lib) . Included it into my binary project linker and included #include "test.h" into stdafx.h. But when binary starts to build, C error occurs on CSomeObject test: "error C2146: syntax error : missing ';' before identifier 'test'". What could be wr...

QT exited with code 0 on release

Hello, Does anyone have stucked on strange problem with QT Creator. When I try to build my simple console app in it with release in output window i see only: Starting C:\Users\xxxxx\Documents\Composite\Compositing\debug\Compositing.exe... C:\Users\xxxx\Documents\Composite\Compositing\debug\Compositing.exe exited with code 0...

QT drawing without erasing widget

Hello, If I have a derived object of QWidget class and on slot function in it I have an update(). here is some pseudocode: *.h slot: updateNow(); *.cpp constructor() { setPalllete(QPallete(QColor(250,250,200))); setAUtoFillBackground(true); } updateNow() { update(); } paintEvent() { QPainter painter(this); painter.d...

Released/production version got heap corruption. Solution preventing it?

In our company we somehow got code to production which crashed(because Heap got corrupted somehow). Developers developed, after that testers had hands on it and later on it was released natural way(monthly release). Everything was fine till it crashed... We tried to investigate it and found many places where we could get a heap corruptio...

Is there a tool for Visual Studio to track (or breakpoint) variable value?

Is there is a tool or a setting in the debugger to stop on the break point or if variable is set to a particular value? I mean if I know that value will be set to "HELLO" then the debugger will stop or do the same if it reached some break point in the loop? Any advise would be helpful! ...

How to explain C++ templates to junior developers?

One could break the question into two: how to read and to write templated code. It is very easy to say, "it you want an array of doubles, write std::vector<double>", but it won't teach them how the templates work. ...

Loop through MFC Child Dialogs, MDIFrames and etc

Hello, Is there a way to loop through all MFC Child Dialogs, MDI frames and etc? And is there a way to find out which dialog or window I am looping through? Any answer would be appreciated! ...

How to get PHP $_GET array ?

Hello, I have a question. Is it possible to have a value in $_GET as an array? If I am trying to send a link with http://link/foo.php?id=1&amp;id=2&amp;id=3, and I want to use $_GET['id'] on the php side, how can that value be an array? Because right now echo $_GET['id'] is returning 3. Its the last id which is in the header link. Any ...

Component Object Model via C++(maybe VS)

Hello, I was searching through google about Microsoft Component Object Model. Found only few normal articles and only 1 step by step example, which doesn't work. Is there any links/references/books/tutorials you know how to build simple COM component via VS C++? Any answer or help would be appreciated! ...

UML arrows/pointers explanation

Hello, I have recently been studying UML and drawing simple diagrams with ordinary plain arrows between classes. But I know its not enought, there is plenty other arrows generalization, realization and etc which has meaning to the diagram reader. Maybe is there a nice resource which could explain each arrow(ordinary,plain, dotted, diamo...

Is it bad for developer to understand with debugging

Hello, I was wondering is it a problem if I only understand code when I debug? Always when I get some kind of project I try to read project, but if methods is not in English language, code isn't commented at all and methods could contain more than 1k lines I get frustrated and miss stuff(lose info)... But when I try to debug it I am hav...

Graduate / Junior Web developer

Hi, I was wondering whether I could get some advice from some more experienced developers out there. Basically I will be graduating this summer with a degree in computing and am keen to go into web development. At the moment I have a a fair bit of experience with php (object orientated) and while I have also have a fair bit of c# expe...

Scala for Junior Programmers?

Hi, we are considering Scala for a new Project within our company. We have some Junior Programmers with only PHP knowledge, and we are in doubt that they can handle Scala. What are your opinions? Some say: "Scala is a complicated beast!", some say: "It's easy once you got it." Maybe someone has real-world experience? ...

how to cope with deadline pressure ?

How do you cope with deadline pressure on a coding job? ...