Forum Replies Created

Amit Member

I don’t know what requests you have or dreams. But my personal advice would be the following:

Learn HTML and CSS as you know your native language.
Learn Javascript / jquery (atleast get a knowledge of how it works)
And finally, learn C#. I know many people advice the usage of PHP but personally, I’d say C#.

Amit Member

Assuming each number is on it’s own line, read each line, parse it as an integer, and add to the sum.

sum = 0
for line in numbers:
sum += int(line)
print(sum)
Amit Member

Change below should work

to

and the main.js to

angular.module('myAppName', [])
    .controller('FirstCtrl', function($scope) {
     $scope.data = {message: "Hello"};
});
Amit Member
var reader = new XMLHttpRequest();

function loadFile() {
    reader.open('get', 'http://127.0.0.1/data/test.txt', true);
    reader.onreadystatechange = displayContents;
    reader.send(null);
}

function displayContents() {
    if(reader.readyState==4) {
        var el = document.getElementById('main');
        el.innerHTML = reader.responseText;
    }
}
Amit Member

I’m not sure what do you mean by ‘game class holds the button class.’, let’s suppose this means: ‘game class holds instance of a button class’ (not declaration of this class). In this case simple-sample can look like this (tested in vs2010):

class Button;
class Game
{   
   Button button;
   public:   //Function must be public, otherwise it will be impossible do something like this: "Game::Add" outside class Game!
      float Add(float x, float y) { return x + y; }
};

class Button
{
   public:
   float (Game::*pt2mfn)(float x, float y);
   Button()
   {
      pt2mfn = &Game::Add;
   }
};

int _tmain(int argc, _TCHAR* argv[])
{
   Button btn;
   Game game;
   
   //Naturally we will need instance of Game class to call nonstatic, member method!
   std::cout<< (game.*btn.pt2mfn)(1.0f, 1.0f) << std::endl;
   system("pause");
   return 0;
}
Amit Member

You can use SVN or GIT

Amit Member

The file types you mention sound like big binary blobs to me.
Sorry, I am not aware of any revision control system that can handle them well.

Usually revision control systems work on text files, where they can analyse and store line-based differences.
They can store binary files like that, but the repository will grow big and ugly fast.

Which one to choose is a question of personal taste: for me Git is the king.

Amit Member

Like they said, you can’t just trick your system. Well, you probably could trick the installer into it and actually get your games installed (if the installer itself doesn’t use .NET 4.5) – but little would it do, since the game would just plain crash on you and wouldn’t work even though you had it installed.

It’s like lying at a job interview about a crucial skill, you can probably get the job with a lie clever enough – but when you actually need to use that crucial skill you’ll fail hard, because you just don’t have it.

Amit Member

It’s quite easy to set up your Windows 8 and make it C/C++ Development ready. You can go with one of these three methods:

1. Download and install the Microsoft Visual Studio Express 2013. It will include a full programming environment for more than just C++. It also includes support for: C# and VB.NET. Well, you can choose if you want to use those additional programming languages or not or simply focus on C++.

http://www.visualstudio.com/en-US/products/visual-studio-express-vs

2. Not a fan of this free tool and it lacks options? Well, then you can go all the way to enterprise software. The best commercial IDE for C++ would be Microsoft Visual Studio Ultimate 2013. It’s fully enhanced, supports a ton of programming languages and much more.

3. If you’re not a fan of Microsoft tools, then you should go for Eclipse. It’s an IDE targeted for Java primarily, but it also has an advanced plugin that lets you create and compile C++ applications. Personally, this is my favorite tool to program in any programming language. There are tons of tutorials that teach you how to get most of Eclipse; Its keyboard shortcuts are simply amazing. If you want to go for Eclipse, then you need to install the compiler manually for better C++11 support – The compiler we’re talking about is GCC (It might not be actually needed anymore, but I’m not sure, just keep this compiler in mind).

Eclipse: http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/keplersr2
GCC: http://www.equation.com/servlet/equation.cmd?fa=fortran

Good luck and enjoy your programming journey!

Amit Member

Yes and no. If there is enough memory space at the end of the allocated space it can just extend the allocation. See for instance the example I linked you above – after the “reallocation” the start of the array (aka the pointer) points again to the same memory address. If however there is not enough memory at the end, it will have to allocate a new memory, copy the old values to the new place and free the old memory.

in reply to: Programmer vs DBA
Amit Member

I think that being a programmer is better than being a DBA in terms of thinking and career. Software Developing is ranked as the best job in the US currently.

http://money.usnews.com/careers/best-jobs/rankings/the-100-best-jobs

Being a Software Developer could mean that you know several programming languages and DBAs cannot shift their attention to learning multiple programming languages, as they have to be up to date with their own technology. Having this said, Software Developers are open to getting to know multiple paradigms, types etc. of Programming languages, enabling them to be brighter.

Amit Member

I’m actually an Android developer and my main work at University has been Android development. I mad the decision to only target Android devises running 4.1+. You still get 60% of every single Android device which is estimated to around 600 million devices running 4.1+. It also makes development 10x easy as every single API is exactly the same for 4.1, 4.2, 4.3 and 4.4 with a few new ones being introduced into 4.4.

Probably the best tutorials I’ve seen are the Vogella ones. Nearly all the tutorials are based on Android 4.0 or above. I don’t know how in depth they are as I only used them for some minor things I was having problems with but what I did see was pretty good.

Just do a google search for “Vogella Android” and you should get a pretty nice starting point. If you have any problems you can PM me as well.

Amit Member

MySQL(i) isn’t a language. SQL is a language used by a lot of database server software.

PHP can connect to MySQL using the extensions to PHP (You probably won’t have to worry as normally enabled by default).

Using the manual for PHP and MySQL integration at

http://php.net/mysqli

Amit Member

You can easily find this information.
Here is a full example:

https://gist.github.com/blueimp/5075976

Amit Member
program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
  po2: array[0..7] of byte = (1,2,4,8,16,32,64,128); {powers of 2}
  bin: array[false..true] of char = '01';

{Decimal to binary}
function dec2bin(b:byte):string;
var
  s: string;
  i: byte;
begin

  s:='';

    for i := 7 downto 0 do
      s := s+bin[(po2[i] and b=po2[i])];

  dec2bin:=s;

end;

var
  n: byte;

begin

  write(#13#10,'Enter a decimal :');
  readln(n);
  writeln(n, ' in binary :', dec2bin(n));

  readln;

end.
Viewing 15 posts - 46 through 60 (of 108 total)
en_USEnglish