mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Easier said than done. How do you plan to get through his army in order to arrest him??

It would certainly seem easier than full out war. Just saying.

<M/> commented: Exactly! +0
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Just a crazy thought. Why not just enforce international law? Arrest Asad and his high command for war crimes, and put them on trial. Maybe I'm crazy, but I think that could be the best course of action.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

the easiest path to just get something compiled is probably to install codeblocks (with MinGW). Open your source file in CodeBlocks and hit the compile button.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Yeah, the environment is basically just your old Unix shell environment.

do I have to download the gcc separately???

Yes, kind of. Cygwin uses a package management system (similar to other Unix variants like Linux or Mac OSX). If you re-run the setup.exe (like you did when installing it), you have to "next" to the package listing. In the package listings, you have to find "GCC" (or GNU Compiler Collection), and possibly also g++. The same goes for any additional packages you might want to have, like make, cmake, etc..

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

cygwin is a bash environment for Windows. This means that you have to navigate it like you navigate a bash terminal environment (i.e., Linux/Unix). Here is some introductory material on that.

To access the hard drives like C:, D:, etc.. in cygwin, you have to go to the directories /cygdrive/c, /cygdrive/d, etc... As so:

$ cd /cygdrive/c

Once you navigate to the directory in which you have your C++ source file(s), you can compile it like this:

$ gcc -Wall my_source.cpp -o my_program.exe

where "my_source.cpp" is the source file, and "my_program.exe" is the executable's name as you want the compiler to generate it (i.e., the -o is for "output" option). The command literally means, "compile with all warnings the source file 'my_source.cpp' and produce as output the executable 'my_program.exe'".

You can also check out this instruction video.

NathanOliver commented: Always Informative +11
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

My thoughts are that this framework you are describing is probably not going to take you very far, you will quickly hit a wall (or a number of walls). For one, it is obviously much too simplistic, as a typical game engine / framework would contain quite a lot more stuff. Also, you are not considering some of the most important aspects of a game engine, such as resource management (manage all the "content" like models, textures, sounds, etc..), physical realism (getting the "physics" to look naturally), and managing the rendering pipeline, just to name a few.

In the most basic setups, a typical game framework would have five main parts: Renderer, Physics Engine, Game Logic (often as a script interpreter), Resource Management, and GUI. Each of these are usually implemented separately, and should be, because they don't really interact all that much. The important thing is, each of these parts are mammoths, i.e., they are a complete and complex programming task by themselves. And also note that most of these parts can be found on the internet either as separate things and/or combined in one "game engine". You should seriously evaluate your options in that department because doing all those things from scratch is going to be monumental.

Class - GUI - Can be customised to contain buttons and to do specific things. This can simply have an event handler function that returns the index of which button was pressed.

That sounds horrible, sorry. You should explore …

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

All
Goblins
In
Texas
Are
Totally
Enraged

Obviously, I agree with Jim too.

Competition

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Serpico

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Deliberate
Environmental,
Industrial, and
National
Sabotage with
Testomonies from
Intellectual
Twits
Utilizing
Their
Investigations
Onboard the
Navy and
Army's
Legislative
Institutions in
Saudi
Arabia to
Tout
Inhumane
Organizational
Nationalism.

Let's get back to sanity:
Software

Ketsuekiame commented: For this sir, you can have a medal :D +0
Reverend Jim commented: I bow to the master. +0
<M/> commented: here's a trophy... +0
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Down in southern Spain is Carlos, a talented, enigmatic disenador.

Purple

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Youth
Organization for
Unconstructive
Time
Usurpation and
Banal
Entertainment.

Next one:

Twitter

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Ronin

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

First thing's first, did you notice the update on the instruction website:

quote:

Update 2: the installer now requires you accept the Oracle license before the installation begins. This is only required once. If for some reason you need the installation to be automated, you can run the following command to automatically accept the Oracle license:

$ sudo echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections

end quote.

The easiest is, by far, to simply install openjdk-7 instead of the Oracle version. So, the first thing is to make sure that you absolutely need oracle-java and cannot live with openjdk instead. The two are just two different implementations of the same library (one open-source, the other not).

It is very possible that the installation succeeded, but failed to create the final links such that you can actually run java command.

The first thing to try is running this command:

$ locate javac

which might output a whole bunch of stuff (depending on if you installed openjdk before or not), and somewhere in that stuff, you should find something related to oracle-java. For example, I have the previous version (6) installed (from some time back), which was from Sun (old name), and this is part of what I find in the output of the locate command:

/usr/bin/javac
/usr/lib/jvm/java-1.5.0-gcj-4.6/bin/javac
/usr/lib/jvm/java-1.5.0-gcj-4.6/man/man1/javac.1
/usr/lib/jvm/java-1.5.0-gcj-4.7-amd64/bin/javac
/usr/lib/jvm/java-1.5.0-gcj-4.7-amd64/man/man1/javac.1
/usr/lib/jvm/java-6-openjdk-amd64/bin/javac
/usr/lib/jvm/java-6-openjdk-amd64/man/ja_JP.eucJP/man1/javac.1.gz
/usr/lib/jvm/java-6-openjdk-amd64/man/man1/javac.1.gz
/usr/lib/jvm/java-6-sun-1.6.0.26/bin/javac
/usr/lib/jvm/java-6-sun-1.6.0.26/man/ja/man1/javac.1.gz
/usr/lib/jvm/java-6-sun-1.6.0.26/man/man1/javac.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/bin/javac
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/javac.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/javac.1.gz

As you can see, there are a number of java installs on my computer, including gcj4.6, gcj4.7, openjdk-6, …

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

TortoiseGit is nothing more than a GUI front-end to Git. I would not recommend that you rely on it for any advanced work, especially if you are having some trouble with your repo. You should use Git Bash, i.e., the command-line utility, because that will give you all the info and error messages you will need to diagnose the problem. TortoiseGit is only really designed to do the easy-everything-is-normal tasks. I always prefer the command-line interface to Git because it's more informative and clear. In TortoiseGit, you are always one click away from messing up the whole repo without even knowing.

If you have problems with the repo, you need to report (here) the output that you get when you run the operations, especially git status and git pull origin master.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Maybe you should try the follow the official instructions first.

Stuugie commented: Thanks for this, I really appreciate it! +4
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Just a thought. Wouldn't the time stamping have more to do with the server's time service, and not with any of Dani's code. Maybe the server had a glitch of some kind in its time service (a reset, or something).

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

What I'm mainly curious about is how the things you listed above that generate C code have that compiled?

They would generally rely on the system's C compiler (if there is one). For instance, matlab's real-time workshop (RTW) just generates a bunch of C source files and a bunch of makefiles (and I think some TCL scripts), and then it just "makes" that project, which automatically detects whatever C compiler is installed on the system and uses that.

This is pretty much the same as what you would do to create any library. You need build scripts that are capable of detecting the installed compiler (and dependencies) and use that to compile all the source. You just do exactly the same, but for your generated code.

I have been looking into this, is that something I should be using for compiling C?

I don't see the point. If someone is going to install your special "New Language" compiler, wouldn't he be able to install any of the standard C compilers (GCC, Clang, MSVC, etc.)? In fact, he most probably would already have it installed.

Another possibility is to distribute your compiler as an add-on to GCC or LLVM (which already has many).

But, to be honest, I would worry about distribution later.

Thanks for the info, I have researched these things, I have found limited resources on LLVM and none on GCC.

In GCC, the intermediate language is called the Register Transfer …

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

There are two common options for the code generation. Most compilers have an "intermediate language" that is kind of like C but less human-readable (i.e., a basic procedural language, but more compact). Other compilers simply generate C code and then compile it (for example, the Comeau C++ compiler just generates C code, and another example is Matlab which can also "compile" matlab code into C code and then compile it).

Writing a good back-end is super difficult (i.e., that's where all the crazy optimizations and static analysis goes on). So, you would probably be much better off using an existing back-end, like GCC, LLVM, or any C compiler. Generating C code is probably the easiest thing, but if you want tighter integration with existing back-ends, you might want to use their intermediate languages (and I believe LLVM and GCC have the same intermediate language).

phorce commented: Good advice. +7
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

My signature-spam detectors are going off the charts here, or is it just me?

Rahul and Izhar, you are walking a fine line. If you keep going, you might get infracted and banned, again. The rule states:

Keep It Spam-Free

Do ensure that all posts contain relevant content and substance and are not simply vehicles for external links (including links in the signature).

There are too ways to comply to that rule: have substantial posts (the ones on this thread are dubious); or, do not put (commercial) links in your signature.

hello guys i love someone but i scared becsause if i propose and she say no so that time what should i do that time we are best friend and we are sharing everything that's why i scared so tell me i propose her ya not?

My two cents on the subject. Getting a "no" is not the end of the world, it might just mean you get to keep a good friend and starting looking elsewhere for a mate, or it might mean she's not ready for that yet but at least it'll be clear that you are and that she should start looking at your relationship in that light to figure out if it might work or not. If you don't ask, you'll never know either way, and she won't know either. I say give it a shot, but if it is a "no", try to be understanding and figure out what kind of "no" …

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

oh i thought that the x-- was the bit processing speed but its the architecture i guess. thanks!

These are names for the instruction set (also called the architecture), they are technically not supposed to be named after the 32 vs. 64 bit thing.

I don't know what you mean by "bit processing speed". The 32bit versus 64bit refers to the native size of the registers on the CPU. The registers are a small number of memory slots that are directly on the CPU chip and from which every operation takes its input values and puts its output value.

So, a 64bit CPU means that the preferred size for numbers that the CPU will operate on is 64bit (8 bytes), which includes integers, pointers, and floating-point numbers. Conversely, a 32bit CPU prefers 32bit numbers.

In earlier times, Intel was just putting out CPU series with an assigned model number and a certain instruction set that it supported. Then, they needed to fix it in time and standardize it as PCs became more of an important market. The main result of that is the 80386 instruction set, usually referred to as either i386 or IA-32. That is an instruction set that requires 32bit registers (and thus, supports operations on 32bit numbers), but also supports 16bit operations for backward compatibility. Except for some isoteric platforms, this instruction set is supported by every CPU model since the mid 90s.

Generally, the term x86 refers to the family of instruction sets from …

Assembly Guy commented: Bravo, great detailed explanation +3
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

My politically correct answer:
The best tool depends on the type of tasks and the requirements. Bla bla bla, the right programming language is the one best suited for the job at hand. Bla bla bla, mention a bunch of programming languages and their advantages to please each person's sensibilities.

My honest answer:
Even with all its drawbacks, C++ is the best programming language, period. (sorry to those who don't like that fact)

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

I just installed it on my old laptop (which had Fedora 19 on it, which has sort of died due to bugs and other issues). I like it so far. That laptop is old (6 years) and I don't use it for any heavy work (I use it as kind of "house laptop", kinda like you would use a tablet), so this OS seems like a perfect fit for that. So far, it's nice, it's like a stripped down version of Ubuntu. Most of the software is the same, but the desktop environment is simpler, more Mac-like, and much faster (on that old laptop, I tried Ubuntu before, but Unity was just way too heavy to run on it).

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Undeserving Noobs Investing Vast Energy and Resources Solving Insignificant Technical Yawningly-boring-problems

Yellowfish

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Ketsuekiame:
Kentucky's Etiquette and Traditions Specialist Unit for Emigrants of Kazakhstan with Insufficient American Manner's Education

Here's the next challenge:

Abracadabra

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

What about the CPU's heat sink? If you removed it and didn't glue it back on with proper heat conducting glue, the CPU will overheat in a matter of seconds and shut down. Just a thought.

Stuugie commented: True but note the screwdriver post! +4
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Windows 8 is full of security holes and backdoors, everyone knows that. Accessible to NSA and anyone else. What's the news here?

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

What have you tried? We do not simply provide ready-made answers to homework questions. You need to show some efforts to try to do it yourself, and point to the specific coding errors that you have trouble resolving. We can help you from there, but not before.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Congrats and welcome Jorge!

JorgeM commented: I appreciate it Mike. +0
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Poppler works on both Android and Mac OSX. LaTeX compilers do too. I'm not sure about Mac iOS (iPhone / iPad). And I really don't know much about mobile app development, so I can't really help you much there. I just know that iOS is intentionally very restrictive, it's not really made to program anything serious, unless you work for Apple. The other option is to use cloud-based services.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

The main library that is used for manipulating PDF files is the Poppler library (home-page, wiki).

This is the library that is used for virtually every tool in the Unix/Linux world that deals with PDFs.

However, you should consider using an existing tool. The set of command-line tools that come with poppler on Linux can do an amazing amount of things. And as far as a basic PDF generator from raw text, assuming you want to apply some standard font and formatting (margins, etc..), you should really consider using LaTeX, and use the provided PDFLatex program to generate the PDF. If you do that, all you'll need is to create a LaTeX file (with the fonts and formatting you prefer), and insert your "paragraphs" of text into it, and then send that generated file to the PDFLatex program. This would be very easy to do in C++, in fact, you could even do it with Bash/Batch script (with standard find-and-replace commands).

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

What people don't get is that the rich do not spend much money at all. Your typical 1% guy will spend or invest on average 5 to 10 percent of his revenue, most of which is in the "risky" part of his investment portfolio. In other words, if you give 1 dollar to a 6-7-figures-salary person (through tax-cut, loop-hole, or subsidy), you are likely to find that about 90 to 95 cents of it will go into a safe investment (e.g., gold, bonds, stable currencies, safe company stocks, real estate, etc.), then most of the rest will go into slightly more risky investments (e.g., "promising" new company, venture capital, etc.), and then a remaining insignificant portion will go to spending (buying stuff). This is why giving money to the rich is considered a depressant for the economy because it takes money out of circulation in the economy and puts it into dormant deposits. It does not create jobs. That's an empirical and logical fact.

By contrast, the poorest people generally spend every dime they can get. This means that every dollar you give to the poor is automatically spent right back on buying stuff (e.g., food). And generally, the people making and selling those things are often fairly poor themselves, meaning their salary is also entirely spent again to buy other stuff, and so it goes. It is only when wealthy business owners take their cut that the money stops circulating (because of what I just explained). This is why …

Reverend Jim commented: Excellent points +0
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

I would like that too, but Dani didn't seem very receptive to it in the chat.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

After having composed a few substantial posts, I have to say that I'm not very happy with the size of the editor. It's just way too narrow. On my typical browser size, it's about 50 characters across, which is insufficient for even the most stringent "code line size" practices (typically 80 to 100 characters across). And you said the size is designed with a 1024 / 768 resolution in mind, well, that is almost exactly the size of my browser window (i.e., about half of my actual screen size).

Would it be possible to somehow expand the editor to the full width? Like terminating the side-bar at where the editor starts, and expand the editor from there. Or maybe trigger the expansion when you focus on the editor.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

At line 211, you cannot have public: within a function body. This is only allowed (and meaningful) at the class scope. Remove it and it should solve the errors.

Also, you should learn to indent and space out your code better, it will be really helpful in the future to find bugs and for general clarity of the code. Consider this:

#include <iostream>
#include <fstream>
#include <sstream>

using namespace std;

template <class A>
class Array
{
    private:
        int siz;

    public:
        A *a;

        void create_array(int cap)
        {
           if( cap > 0 )
           {
               a = new A[cap];
               siz = cap;
           }
           else
           {
               cout << "the size is wrong";
           }
        }

        void store(A values,int index)
        {
            if( index < siz && index >= 0 )
                a[index] = values;
            else
                cout << "invalid index";
        }

        A retrieve(int index)
        {
            if( index < siz && index >= 0 )
                return a[index];
            else
                cout << "invalid index";
        }

};


template <class S>
class stacks
{
    private:
        Array <S>obj;
        int top;
        int capacity;

    public:

        stacks()
        {
            top = 0;
            capacity = 0;
        }

       void create_stack(int s)
       {
            capacity = s;
            top = 0;
            obj.create_array(s);
       }

       void push(S value)
       {
           if( !isFull() )
           {
               obj.store(value,top);
               top += 1;
           }
           else
               cout << "stack overflow";
       }

       S pop()
       {
           if( top != 0 )
           {
               top -= 1;
               return obj.retrieve(top);
           }
           else
               cout << "stack underflow";
       }

       bool isFull()
       {
           if( top == capacity )
               return true;
           else
               return false;
       }

       bool isEmpty()
       {
           if(top==0)
               return …
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

What is the question? What have you tried so far? And what is the specific problem you are facing with your code?

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Yeah, I'm also a big fan of Keynesian economic theory, which I think is the only sound economic theory.

All those "trickle-down" economists have been doing in the last 50 years is try to make excuses for why their "theory" keeps failing and falling apart. In reality of course, their "theory" is based on nothing more than an obvious interest to funnel more money up top, and absolutely pathetic refutations of Keynesian theory.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

What it does is provide yet another way to take money from the 99% and pass it on to the 1%.

I totally agree, the motto of current economics is: "Nationalize the costs and the risks; privatize the profits".

It's like those bridges built on public-private partnerships, i.e., the public covers the cost of building it and the risk associated to the investment, and the private "partner" collects the toll payments for the next 50 years.
The current banking system is based on the assumption that governments assume all the risks (by promising bail outs and such).
Wars are also the same, the government and the countries people pay the cost in money and lives, and the risk of more wars, while profits are funneled to the private sector under the guise of creating jobs (or some other BS rhetoric, as if the government could not employ the same people to do the same job).
So many sectors of the economy just exist as a middle-man between government spending and people doing the job. These are the lazy people receiving hand-outs, and constitute most of that 1%, and they get rewarded with tax cuts and more hand-outs (subsidies), again, under the guise of some BS rhetoric about "trickle-down" economics.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

I often joke that I can read and write C++ code faster than English. It's probably true in sheer number of lines. But this is definitely just something you acquire with time. And yes, for a long time, I would always have to refer back to previous code for lots of stuff from basic file layout to specific programming tricks (or how to use a particular class or something). But over time, it is just that more and more things can be done without reference to previous stuff or online examples. And it just transitions like that.

Also, you might get the impression that "we" can put together a lot of code quickly by seeing us write examples when answering questions on Daniweb, or maybe when a teacher or tutor writes a demo program in two minutes. But remember that for most seasoned programmers, these kinds of exercises or small snippets of code present a very low level of difficulty. For example, I took a compulsory introductory Java course not too long ago, I solved all of the class' assignments for the term (about a dozen assignments) in little more than an hour, it's just that it's really really easy to do those things when you've programmed for so many years before. Because most of this stuff are things you've done hundreds of times before, so, you read the "problem description" and you instantly have all the code in your head, and then it's just a matter of typing it …

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

A mere 31,385 people – less than 0.01 percent of the nation’s population – contributed 28 percent of the country’s total political contributions.

Is that in the US, or in Lesterland?

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

There are many ways to solve this problem, including just basic OOP-style polymorphism (make A and B be derived from some base-class with the necessary virtual functions you need, and create a new object of type A or B in the constructor).

The most obvious way to solve this is using boost::variant. As so:

class A { /*...*/ };
class B { /*...*/ };

class Foo {
  private:
    boost::variant< A, B > data;

  public:

    enum dataType {
      A_type = 0,
      B_type = 1
    };


    Foo();
    Foo(dataType member_type)
    {
      switch(member_type) 
      {
        case Foo::A_type:
          data = A();
          break;
        case Foo::B_type:
          data = B();
          break;
      };
    };  

    void ProcessCall(Object& obj) {
      switch(data.which()) 
      {
        case Foo::A_type:
          A& a = get<A>(data);
          /*...*/
          break;
        case Foo::B_type:
          B& a = get<B>(data);
          /*...*/
          break;
      };
    };
};
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

I'm sorry, but I am not able to make heads or tails of what you are trying to do. Can you show a minimal "toy" example that shows what you want to do?

Use this as the starting point:

class Foo {
  public:
    enum FooType {
      A = 0,
      B = 1
    };

    Foo(FooType flag) {
      // ??
    };

  private:
    // ?? (data members?) 

};

int main() {
  Foo f( (Foo::A) );
};

Just write the "complete" code that you would like to have working (not just comments saying "here is where I'd like do something", but actual (invalid) code, and pointing out what doesn't work).

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

I'm not sure this is really what you should expect a beginner to produce... seems a bit too advanced. Anyways, here are a few nit-picking remarks.

1) They are not called "template functions", they are called "function templates". This is an easy slip of the tongue, but the latter (and grammatically correct) terminology is useful in stressing the character of templates as being instructions to the compiler on how to generate some code for a given set of compile-time parameters (template arguments: types, etc.). In this case, it is a template to instruct the compiler on how to generate a function for a specific type T, it is not a special kind of function.

2) toupper and tolower are in the std namespace (like all other standard functions and classes, even those coming from C libraries). You forgot to put the full qualification or using-clause.

3) There is no need to flush std::cout just before taking an input from std::cin. Taking an input from std::cin is guaranteed to trigger a flush of the standard output.

4) I suspect that you used the "min" parameter in your takeIn function template just so that you wouldn't have to specify the type T explicitly at the call-site. Although I see the convenience in that, I don't really agree we this kind of practice in general. One reason for that objection is that you end up compromising your interface for a rather trivial reason. And your takeIn function is a good example of that. …

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

I have a bug to report. When I click on the "XX hours ago" to jump to the last post on a thread, it gets me there but the top of the last post comes flush with the top of the browser window, and then, the floating "<DANIWEB>" purple bar appears on top of that, which means I can't actually see the last post without scrolling back up.

Here is a screenshot of one thread where I just clicked to get to the last post and didn't do anything else:
37a09c18318ecc56707f1e7502567400

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

One thing I don't like/agree with is this:

Funny, cause the two things that I don't agree with in that picture are that:

(1) C++ is not an OOP language!! (it's a multi-paradigm language)
(2) I have 29 C++ endorsements, not 27, and I should be in front of AD, cause he has 28.

1) It seems like a popularity constest.

It is.

2) What's to stop someone looking at a particular forum, seeing who is the most active / experienced and then them annoying them via PM's in a hope their question would get a reply sooner.

The last time I checked, the PM inbox has a "delete" button.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Yeah, "read" is in the past tense. Stupid English language. I was also even more confused with the "read" and "me" put together, for obvious reasons.

I agree that the new layout is a little bit cluttered. And as far as style harmony goes, it seems the main thing that detones from the rest is the header (the top purple bar). I could simply be squashed a bit (i.e., reduce the thickness of it to take up less room).

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

Talladega Nights: The Ballad of Ricky Bobby

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

I encountered a nice programming example of Schrödinger's cat. If you have this code:

int main() {
  int a, b, c;
  a = 1;
  b = 2;
  c = a + b;
  cout << "value of c is " << c << endl;
};

Then, the compiler is allowed to re-order the operations in any way such that the result is the same. So, technically, you don't know (without looking at the assembly code) for sure in what order the operations will be performed (because the value-assignment of a and b could be reversed without any difference in the outcome). But, if you wanted to check that the order was indeed the way it was written in the code, you'd have to add some print-outs:

int main() {
  int a, b, c;
  a = 1;
  cout << "value of a is " << a << endl;
  b = 2;
  cout << "value of b is " << b << endl;
  c = a + b;
  cout << "value of c is " << c << endl;
};

But the problem now is that because you have added those print-outs, the compiler is now obligated to perform the value assignment of a before the first print-out, and then do the assignment of b before the second print-out. Which means that you won't be able to answer the question about the order of operations from the first program, because you've now modified the thing you were trying to observe.

So, …

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

I don't know how to feel about this. On the one side, I'm happy that the companies speak plainly and honestly about the crimes of the US government, and refuse to be complicit with them. On the other hand, I would like to see them refuse to comply (and not shutdown), and take the government to court to defend the rights of all Americans. I guess it might be a bit too much to ask.

We really need a more viable solution for encrypted messaging, one that does not rely on a central company that can be subpoena'd, nor on the SMTP / POP3 protocols. Or at least, Silent Circle could just move out of the US, maybe to places like Iceland, where people's rights are protected.

mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

@AD: Let me clear that cloud of confusion. Clang is the C / C++ / Objective-C / Objective-C++ front-end for the LLVM compiler back-end. It is a GCC-compatible compiler suite (i.e., you can usually replace any clang-llvm tool with a GCC one, like the linker or standard libraries). Clang is purely a compiler suite, exactly like GCC. It can generally be used as a drop-in replacement for GCC (only the very advanced options differ). It has been mainly supported by Apple and Google, and it is the main official compiler for Mac platforms (for all languages mentioned).

@triumphost:
The Windows support by Clang is only experimental at this point. This means no binary distributions (have to compile from source), no guarantees, no help.

One option is, of course, to use Cygwin. Cygwin is basically a unix system running inside a command-line interface in Windows, which means it is a unix system, and clang is supported, and is even distributed as a standard package (but not the last version) in cygwin's package manager. If you want the newer version, you'll have to compile it from source, which will require either GCC or an older Clang version installed in Cygwin. For doing this, you should just follow the Unix/Linux instructions, because Cygwin is no different. But this also means that you are not really in Windows, and the programs you compile will be compiling for Cygwin, not Windows (Cygwin does have a run-time distribution that allows you to distribute cygwin-compiled programs …

ddanbe commented: Is there anything you don't know? +14
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster

If you consider the loop that I posted last. The index version would, without any optimization, turn into this:

int i = 0;
while( i < 100 ) {
  int* temp_ptr = number_seq + i;    // | equivalent to:
  *temp_ptr = i;                     // | number_seq[i] = i;
  i += 1;      // or ++i
};

While the pointer version turns into:

int* p = number_seq;
while( p != number_seq + 100 ) {
  *p = (p - number_seq);
  p += 1;    // or ++p
};

Essentially, the index version adds one line of code, which is to compute the pointer to the element you are accessing before dereferencing that pointer. But most compilers will be able to see that the two lines (increment index, and add index to start-pointer) can be replace by just incrementing the pointer, which is why it ends up performing the same.