Posts
 
Reputation
Joined
Last Seen
Ranked #530
Strength to Increase Rep
+5
Strength to Decrease Rep
-1
81% Quality Score
Upvotes Received
12
Posts with Upvotes
10
Upvoting Members
10
Downvotes Received
3
Posts with Downvotes
3
Downvoting Members
2
9 Commented Posts
~55.4K People Reached
PC Specs
Intel Core i5-750@2.7GHzATI Radeon HD58502 GB RAM (due to breakdown)2x640GB RAID0 + 1TBW7/Debian dual…

68 Posted Topics

Member Avatar for vegaseat

Sorry if this has been posted before: [url=https://www.spoj.pl/]SPOJ[/url] especially tutorial problems. It can a bit challenging, since most problems are demanding algorithmically and SPOJ judges (yes, software ones) are pretty strict on I/O, but it is also pretty much fun.

Member Avatar for vegaseat
20
18K
Member Avatar for vegaseat

+1 for that WaltP By comparing maximal values (using Mathematica) uint32 will work up to 12!, uint64 up to 20!. Looking at IEEE 754-2008 and again comparing the values, long double (binary128 in IEEE 754) should work somewhere to the upper thirties, didn't check the exact value. But still, that's …

Member Avatar for vegaseat
0
1K
Member Avatar for Nikita Sachdev

@triumphost try Orwell's Dev-C++, that guy picked it up after all those years. And YES, the compiler is more-or-less up to date.

Member Avatar for jaskij
0
193
Member Avatar for OrangeTree

If a non-portable way is enough for you, try the `system()` function from `cstdlib`, which works as though you have just typed the command given as a parameter in the command line.

Member Avatar for OrangeTree
0
245
Member Avatar for jaskij

Hope I don't start a holy war ;) This question rose to my mind after starting a project with a couple of friends (my very first team project to be honest). We all agreed on CamelCase, but one friend suggested somethin unnatural to me, that is, starting names of all …

Member Avatar for two[ ][ ]
0
176
Member Avatar for DubyStev

@rubberman: passing by value... not a good idea, unless the arrays are extremly small... Since someone already post their code, I'll post mine too. Since an array is essentially a pointer, an array of arrays is an array of pointers, so a pointer to pointer (as far, as types are …

Member Avatar for mike_2000_17
0
241
Member Avatar for MasterHacker110

Try Orwell Dev-C++ - someone finally picked up Dev-C++ after all those years. http://sourceforge.net/projects/orwelldevcpp/

Member Avatar for MasterHacker110
0
193
Member Avatar for Hellblazer.

As for IDEs, you might try Orwell Dev-Cpp ( http://sourceforge.net/projects/orwelldevcpp/ )- this is the one most of my friends started out with, and it has seen some updates recently, like un up-to-date compiler ;P If you need some pre-made tasks, try some online solving system, like http://www.spoj.pl/

Member Avatar for sternone
0
203
Member Avatar for baby_c

Depending on the game, there are all kinds of answers. If it's a Uni assignment, try Space Invaders - I've seen it written in under 500 lines of code, in a nasty way though.

Member Avatar for sternone
0
270
Member Avatar for Valiantangel

First, a lil bit of history and theory: since C++ is based on C, and C is a pretty low-level language, many things are closer to how computer does them, then they are to human's way. Arrays (or container) indexing is one such case. They are indexed beginning at 0 …

Member Avatar for jaskij
0
97
Member Avatar for jakezcop

WaltP isn't that OS-dependant? Anyways, Windows (at least W7) supporst slashes too. Another thing is, AFAIK if you supply the flags, you HAVE to specify the write flag too, so: walletfile.open("C:\accounts\wallet.acnt", ios::trunc | ios::out); should help too

Member Avatar for jakezcop
0
2K
Member Avatar for Prisms

If you insist on using MS Excel spreadsheet, you could try exporting the data to csv and then re-importing it if your program changes that. That is IF Excel supports csv.

Member Avatar for Prisms
0
204
Member Avatar for phorce

IMO, you could just go by every single value and check if they're equal. Like when comparing strings. It doesn't really matter how you go through them, if the matrices are equal you WILL go through every single value anyways. And what you do just asks for bugs. Why not …

Member Avatar for phorce
0
117
Member Avatar for triumphost

1. [ICODE]#include <typeinfo>[/ICODE] and [ICODE]typeid()[/ICODE] [URL="http://en.wikipedia.org/wiki/Typeid"]http://en.wikipedia.org/wiki/Typeid[/URL] 3. I tend to be wrong recently, but IMO an empty template parameter would incur a compile error.

Member Avatar for mrnutty
0
4K
Member Avatar for jaskij

I have to write an interpreter for tristate logic as a Uni assignment. I got most of the things down, like expression tree and such, there is just one thing that's bugging me, that is input, or a particular part of it. The thing is, in the expression there can …

Member Avatar for jaskij
0
114
Member Avatar for rfrapp

Tutorials (like [url]http://edn.embarcadero.com/article/31863[/url] ) are an obvious reply, but since I don't know much about UML, I can't tell whether they are good. The second part is nice software. Personally, I like the free [URL="http://modelio.org/downloads/download-modelio.html"]Modelio[/URL], which is IMO quite strict about UML (don't know if this is what you're looking …

Member Avatar for jaskij
0
176
Member Avatar for Vladnaka

I'm not that good with streams and such, but you could try using [icode]istream::get[/icode] or [icode]getc[/icode] if you are using [icode]cstdio[/icode].

Member Avatar for jaskij
0
253
Member Avatar for Mona..

You give too little info here, but my guess is one of the two: you have an invalid or non-standard declaration of [icode]int main()[/icode] or you are trying to compile your own lib as an application (this can be changed in project settings).

Member Avatar for jaskij
0
95
Member Avatar for pendo826

Maybe it is not really the case, but IMO the whole class should be a template, not just one function or member... Like: [code] template <class T> class Array{ public: T* m_array; } [/code] Although it's 3:30 am and I might've gotten this wrong.

Member Avatar for jaskij
0
241
Member Avatar for jackbauer24

@_@ impressive list BitBit Well: C++ Fairly: Mathematica Barely: Pascal, HTML, CSS, XML, XSLT, XML schema Intending to learn a scripting language, pondering between ruby and python.

Member Avatar for diafol
0
238
Member Avatar for minghags

You do not populate the people vector. This should work correctly, if memory serves: [code] std::sort(seznam_student,seznam_student+st_studentov,sort_by_name) [/code] Or just use a vector from the beginning: [code] std::vector<student> seznam_student; if(meni==1) { seznam_student.push_back(vpis(st_studentov)); st_studentov++; } if(meni==2) { for(int a=0;a<st_studentov;a++) { izpis(seznam_student[a]); } } if(meni==3) { std::vector<student> people; std::sort( people.begin(), people.end(), sort_by_name ); …

Member Avatar for jaskij
0
1K
Member Avatar for stereomatching

According to Marshall Cline's C++ FAQ, which I really like, it is not if the code should be human readable. [url]http://www.parashift.com/c++-faq-lite/new/convert-to-c.html[/url]

Member Avatar for jaskij
0
246
Member Avatar for bryeguy2012

Ancient Dragon: there is actually a new version of Dev-C++, although not by Bloodshed. It contains MinGW GCC 4.6.2, so it should support most of the features even for C++11 ;) [url]http://sourceforge.net/projects/orwelldevcpp/[/url]

Member Avatar for jaskij
0
324
Member Avatar for ADHDinIT

Another one with ADD here. Still a CS Uni student. What I avoid: repetitive tasks. What I want to do: challenges, things that occupy my mind. So my job of choice would be with algorithmics and software engineering rather then coding itself.

Member Avatar for daniel.walker01
0
153
Member Avatar for The_Purple_Mask

Also, a word of warning if you are using MS Visual Studio: VS has a lot of runtime checks built in their debug implementation of STL, so if you run it under debug it will most likely feel terribly slow. In my case it came out when I wrote a …

Member Avatar for mike_2000_17
0
268
Member Avatar for jaskij

Hi there everyone :) Recently, I started to feel a strong need to learn a scripting language. The question is which. Right now I'm pondering between Ruby and Python. The conditions are that it should be high-level, object or object oriented and not a functional language. What say you, geeks? …

Member Avatar for DavidB
0
114
Member Avatar for sergent

W7/Cygwin Notepad++/g++ for smaller aps (such as helping out on the c++ board) MS Visual Studio 2010 Premium (bless my Uni and MSDNAA) for bigger aps (mainly due to debugger, I don't have the patience to learn or use gdb).

Member Avatar for hystaspes
0
331
Member Avatar for Karlwakim

1) Mostly internet and friends, although books help too. Never got myself into reading others code. 2) Interested and challenged. 3) Pascal, due to school, then switched to C++. 4) Some basics of a few languages, but none enough to be useful.

Member Avatar for therockon7throw
0
238
Member Avatar for rfrapp

First of all, iterate over those powers, don't just put them in the code. Putting a number to any given base always used a [url=http://en.wikipedia.org/wiki/Greedy_algorithm]Greedy Algorithm[/url] and that is enough for you too. The only part, that could get tricky here is computing the modulus for floating point numbers, but …

Member Avatar for rfrapp
0
3K
Member Avatar for zios007

Nice one, that :) Your number is 5-digit in binary. Based on that, in each guess, you set one digit of the number to 1, and then output all the possibilities for the other four digits (which are exactly sixteen), if the user answers 'yes' - you leave that digit …

Member Avatar for zios007
0
249
Member Avatar for Rimojenkins

It's a problem of context. The pointer [icode]node* head[/icode] is local to the constructor. Depending on what it is you are trying to do, maybe a [icode]static node *head[/icode] member will be the right choice for you?

Member Avatar for Rimojenkins
0
176
Member Avatar for inspire_all

[url]http://cplusplus.com/doc/tutorial/polymorphism/[/url] - a pretty nice explanation IMO

Member Avatar for inspire_all
0
141
Member Avatar for engineerchica

Maybe something along these lines, although I'm not sure if it really works. Probably the loop is wrong and will skip the last character... But you have something to work with :) [CODE] const int len=sizeof(search); char* tmp=new char[len]; int i=0; while(const int len=sizeof(search) char* tmp=new char[len] int i=0; while(!fileIn.get(&tmp[i]).eof()){ …

Member Avatar for engineerchica
0
236
Member Avatar for SCass2010

There's a ton of good XML libraries out there, like the GNOME [url=http://xmlsoft.org/]libxml[/url] or [url=http://www.boost.org/]boost[/url], most of them are in the repos ;) Also, as much a PITA it can be, you could wrute your own XML-schema and validate the files against it, to ensure you don't make mistakes in …

Member Avatar for jaskij
0
382
Member Avatar for ruval002

First, consider writing a constructor, like [code] struct PCB{ PCB(el_t id_,string state_){ id=id_; state=state_; } }; [/code] Second, consider making the state an enum - that would be much better IMO, but it depends on you. Finally, an array of structs is nothing special, just use [icode]operator.()[/icode], like: [code] int …

Member Avatar for ruval002
0
205
Member Avatar for EnriqueI

Arrays are EVIL. Use a [url=http://cplusplus.com/reference/stl/vector/]vector[/url] of vectors. They work similarly to arrays, but have resizing and a bunch of other things, like checking if you don't call for elements outside of the array. Like this: [code] #include <vector> #include <iostream> using namespace std; void display(vector<vector<int> > &arr){ // do …

Member Avatar for EnriqueI
0
206
Member Avatar for LdaXy

This [code] #include <iostream> using namespace std; template<class T> bool logicalAnd(T x, T y){ return !(x == y); } int main(){ int x = 3, y = 5; cout << logicalAnd(x,y) << endl; } [/code] compiled without any errors or warnings using [icode]g++ -Wall[/icode], so if it doesn't compile under …

Member Avatar for jaskij
0
302
Member Avatar for inspire_all

Look at the STL algorithm header, there is a whole load of functions using this concept, like [url=http://cplusplus.com/reference/algorithm/count_if/][icode]std::count_if()[/icode][/url]. Also, if you want to compute an integral over a range, I found it preferable to pass the integrated function as a pointer, but that's a whole another case and may not …

Member Avatar for rubberman
0
254
Member Avatar for minnnnnas

Dynamic array==[icode]vector[/icode], [url]http://cplusplus.com/reference/stl/vector/[/url] There are at least two ways to do what you want, depending on the specifics of your problem. One is to make three vectors, or make your own struct/class to hold all three in a single place. The other is make a struct with name and those …

Member Avatar for sota
0
170
Member Avatar for ruval002

You could do a bubble sort, it's fairly simple, but works in [tex]O(n^2)[/tex]. If I am not wrong, you could also use a quicksort, since it iterates through all the elements in each recurring call anyways. But not the in-place version, since requires random access. Or you could just copy …

Member Avatar for Kanoisa
0
276
Member Avatar for jaskij

This here is a code of my recent uni assignment to render Mandelbrot, Julia and Burning Ship sets, using SDL. The code works properly, using MS Visual Studio 2010 Premium, but displays some errors (either numerical or type casting differences, I couldn't find them) after porting to Linux and compiling …

Member Avatar for jaskij
1
182
Member Avatar for aashishsatya

1. The problem you have is gets catches the [icode]EOL[/icode] you get after hitting return for the number of the kids. Adding something like [icode]getch()[/icode] before that [icode]gets()[/icode] should fix this. Or just use [icode]gets()[/icode] twice. 2. Use [icode]string[/icode] instead of [icode]string.h[/icode] - the second one is legacy AFAIK. 3. …

Member Avatar for jaskij
0
690
Member Avatar for Karlwakim

There are many algorithms. Unless your numbers are ridiculously large, I suggest using Eratosthenes' sieve and then checking up to the square root of the number (for every divisor of a number under it's square root there is a corresponding one above it). Or you could just hard-code a list …

Member Avatar for jaskij
0
253
Member Avatar for franmaez_0716

You are expected to post the code in the first post, but well. The algo is pretty simple here - remember those multiplication lessons back in elementary school? For a*b you just make a+a addition b times. Similar with division.

Member Avatar for franmaez_0716
0
3K
Member Avatar for stinkypete

To be honest with you, I'd say it's not a task for C++, rather a computer algebra system - they tend to cope with similar tasks really well. Anywas, there is [icode]next_permutation()[/icode] in the STL [icode]algorithm[/icode] header, this should help you using what VernonDozier wrote. Just pick a digit to …

Member Avatar for VernonDozier
0
921
Member Avatar for miturian

Didn't you get a makefile with those examples? Try looking for one and compiling with it, that should work. Also, looking at the file header, it is an example from 2002, boost might have changed since that time.

Member Avatar for miturian
0
478
Member Avatar for ztdep

I'd say inheriting after STL classes is a bad idea, but that may be just my prejudice. Consider, what would happen if I were to call [icode]Swarm::resize()[/icode] - your swarmSize member would get invalid instantly. Well, every particle in the swarm will have the same dimension, won't it? It would …

Member Avatar for jaskij
0
98
Member Avatar for txwooley

I strongly recommend using SDL_Image and ditching BMP for better formats, like PNG where you can ditch color keying. It is described a few tutos later on LazyFoo. Although the reference doesn't mention it, I wonder if [icode]SDL_Init()[/icode] shouldn't be called before a call to [icode]SDL_DisplayFormat()[/icode].

Member Avatar for jaskij
0
926
Member Avatar for xtinab

@thines01: considering how the compiler interpets it, it should work, but you are 100% correct that this way shouldn't be used. IMO, just delete line 10.

Member Avatar for thines01
0
603
Member Avatar for Despairy

I'd say some [url=http://en.wikipedia.org/wiki/Dynamic_programming]dynamic programming[/url], maybe with finding the shortest route or some such. Everything probably represented as a graph.

Member Avatar for Despairy
0
306

The End.