Jump to content

manon_gfx

Member
  • Posts

    185
  • Joined

  • Last visited

Reputation Activity

  1. Informative
    manon_gfx got a reaction from AverageLeo in Do I need all of this?   
    You most probably do need these. These are the redistributable packages that software publishers ship with their code. They contain shared libraries (DLLs) with the C standard library and STL (C++ standard library) for each particular version of MSVC. They are not super big and you never know which programs actually use them.
  2. Agree
    manon_gfx got a reaction from PDifolco in Do I need all of this?   
    You most probably do need these. These are the redistributable packages that software publishers ship with their code. They contain shared libraries (DLLs) with the C standard library and STL (C++ standard library) for each particular version of MSVC. They are not super big and you never know which programs actually use them.
  3. Like
    manon_gfx got a reaction from Deadpool2onBlu-Ray in I have no clue what phone to buy   
    The iPhone 13 mini looks quiet appealing with the smaller display, but feels very expensive (Almost €1000 for the 256GB model). I don't know how well it compares in terms of specs/perf to something like a nothing phone or pixel. I would much rather spend a bit too much money now, than have to deal with buying a new phone again in a couple of years.

    I think the main things keeping me away from Apple phones are that I really dislike the company, I need to buy my apps again, and that they are pretty pricey.

    I'll also take a look at the pixel 7, although I heard the pixel phones are not great unless you are looking for a really good camera.
  4. Like
    manon_gfx reacted to Commodus in I have no clue what phone to buy   
    I'll be frank: if I had to buy a phone that would last for five years with strong performance, it'd be an iPhone. Apple had a rough start, but it's good at making phones that still feel reasonably quick over the years. I only upgraded from an iPhone XS to a 13 Pro because of the features I wanted, not because the XS was unacceptably slow. I wouldn't get more than the base iPhone 13 or 14 in your case, but that will be plenty.
     
    Living with lots of Google services isn't too hard in iPhone land. Obviously you won't have always-available Assistant or the option of setting all your Google apps as default (you can for some), but all the apps are covered. Hell, Google even has iOS lock screen widgets that put its own phones' functionality to shame.
     
    In the mid-range Android world, I'd agree on the Nothing Phone 1 so long as the company is consistent about updates and improves its after-sale support (which is limited in these early days). Google obviously has more of a track record, but the jury's still out on how well Tensor holds up for several years. Consider buying a Pixel 7 if you want better future-proofing.
     
    Fairphone 4 is well-intentioned, but unfortunately strikes me as the victim of Linux-style optimism — that is, the absolute commitment to an ideal means it'll always be a step behind the competition. And like you pointed out, the irony is that the lackluster specs will increase the chances of getting rid of the phone sooner than you'd want.
  5. Like
    manon_gfx got a reaction from Beskamir in Python or C for Raspberry PI 3?   
    That all depends on what you want to program.
    If you care about really tight performance and low level programming, C is the clear winner.
    If you just wanna get cool stuff to work, python is a great language to use.

    Also, you mentioned you know C++ and C#, why not just use those languages instead? Since the raspberry pi runs Linux, you can use whatever language you want (well maybe not visual basic, but you get the point).
  6. Like
    manon_gfx got a reaction from Merkey in Python or C for Raspberry PI 3?   
    That all depends on what you want to program.
    If you care about really tight performance and low level programming, C is the clear winner.
    If you just wanna get cool stuff to work, python is a great language to use.

    Also, you mentioned you know C++ and C#, why not just use those languages instead? Since the raspberry pi runs Linux, you can use whatever language you want (well maybe not visual basic, but you get the point).
  7. Agree
    manon_gfx got a reaction from fiberzs is dad in Coding Help   
    If you want us to help it would be useful to post the code that you currently have so we can see what is going on. If you just say that it doesn't work, we can't really do anything for you.
  8. Like
    manon_gfx got a reaction from alex_read in How are games ported?   
    Game (engine) programming student here!
     
    Games are usually written in programming languages that can be compiled into machine code for various machines. Most games are written using C++, which you can compile for Windows, OSX, linux, Xbox, Playstation, raspberry pi, etc.
    There is however an exception, which is when you communicate with the Operating System(OS). If you want to get the position for the mouse, for example, you'll have to ask the OS to get it. The function to get the position of the mouse will be different for every operating system. So what programmers do is create a new function that, if it's compiled on windows asks windows for the mouse position, if it's on OSX will ask OSX for the mouse position etc. We call this an interface, which is going to be the same for every OS, and an implementation which is going to be different for every other OS.
    When you port a game, you will have to do this for every single interaction with the OS.
     
    This is also the case with graphics libraries that are OS specific, like DirectX. If you write a rendering engine using DirectsX, you will have to create an interface to it and rewrite it to OpenGL (or soon Vulkan) if you want to support other operating systems.

    In the case of these old games for SNES and NES, you can't really do this. That is because those were written in assembly, which is completely system specific. Nintendo probably rewrote those games from the ground up (or created an emulator which emulates that system).

    I hope this gives you some insight in how games are ported.
  9. Like
    manon_gfx got a reaction from EmmaMay in How are games ported?   
    Game (engine) programming student here!
     
    Games are usually written in programming languages that can be compiled into machine code for various machines. Most games are written using C++, which you can compile for Windows, OSX, linux, Xbox, Playstation, raspberry pi, etc.
    There is however an exception, which is when you communicate with the Operating System(OS). If you want to get the position for the mouse, for example, you'll have to ask the OS to get it. The function to get the position of the mouse will be different for every operating system. So what programmers do is create a new function that, if it's compiled on windows asks windows for the mouse position, if it's on OSX will ask OSX for the mouse position etc. We call this an interface, which is going to be the same for every OS, and an implementation which is going to be different for every other OS.
    When you port a game, you will have to do this for every single interaction with the OS.
     
    This is also the case with graphics libraries that are OS specific, like DirectX. If you write a rendering engine using DirectsX, you will have to create an interface to it and rewrite it to OpenGL (or soon Vulkan) if you want to support other operating systems.

    In the case of these old games for SNES and NES, you can't really do this. That is because those were written in assembly, which is completely system specific. Nintendo probably rewrote those games from the ground up (or created an emulator which emulates that system).

    I hope this gives you some insight in how games are ported.
  10. Like
    manon_gfx got a reaction from DigitalHermit in Convert char array to int (c++)   
    What exactly do you mean by convert?
    Like turn the string "125     " into a number?
    Or reinterpret the data as integers?
     
    Converting to a number can simply be done using atoi: 
    int value = atoi(cString); To reinterpret cast you can do one of the following:
    const int* array = (int*)cString; It would be nice if you could explain what your question is a bit more!
  11. Like
    manon_gfx got a reaction from GoodBytes in Dx11 or Dx12?   
    Like what mathijs727 said, DirectX 12 is aimed at AAA developers. DX12 has a lot of abstraction stripped away to give you more access to the hardware. However this comes with a cost, it is much more difficult to develop games using DX12. DX12 requires you to do all CPU and GPU synchronization yourself. Only use DX12 if are an experienced graphics programmer and really know what you are doing.
    Learning DX11 is very doable. Personally I like the tutorials on 3dgep.com.
  12. Like
    manon_gfx got a reaction from Dobbsjr in Differences between C++ random number genertators   
    Acutally (almost) all random number generators are what we call pseudo-random. They work by setting a seed. Then do some calculations on that and return a number, the next time to generate a number, is will use the last generated number as a seed.
     
    rand() is usually considered bad, since the distribution is not what we call 'uniform'. A uniform distribution is where all numbers have an equal chance to get generated.
     
    C++ offers the <random> header file, containing better random number generators, like std::default_random_engine.

    If you want to be able to recreate the same values with the same seed everytime, it is recommended that you don't use the std::default_random_engine, but a different one, or that you write your own.

    If you need to generate a truly random number (not pseudo), there are ways to do that. x86 offers and extension that allows you to read a truly random number generated on the CPU (it had something to with crystals and stuff iirc). To use this include <immintrin.h> and call _rdrand16_step, _rdrand32_step, or _rdrand64_step. Note that these functions are very slow. The intel intrinsics guide says that it takes about 200 cycles on Ivy Bridge, and doesn't specify a cycle count on Haswell.

    This video has a great explanation on how pseudo random number generators work: 
  13. Like
    manon_gfx got a reaction from Sithhy in Experiences with non-techies   
    My grandma wanted me to uninstall facebook. It was set as the homepage, so I set google as the homepage and then she was happy.
  14. Like
    manon_gfx got a reaction from Ciccioo in What experience made you a better programmer?   
    A course in optimization at school. Never thought there were so many possible things to do optimizations. From high level optimizations, to SIMD, to precalculating bilinear filtering of palatalized textures.
  15. Like
    manon_gfx got a reaction from Ciccioo in C++ Error, Visual Studio 2013 Bug?   
    What is happening is that reserve allocates enough memory for the data you are putting in, but doesn't change the size of the vector. When you access the vector, it should give an error (visual studio is giving you correct behavior), but if there is no error checking, it will go out of bounds for you. Which is no problem since you are only really accessing already allocated memory.
    If you run compile your program with debug settings in G++ or Clang++, it should give you those errors.

    The correct way is to reserve, and then push_back all the elements, or call resize, and set them like you are doing right now.
    Calling reserve is faster, since resize initializes everything to it's default values.


    EDIT: I looked up the exception safety of std::vector on cplusplus.com, and this is what it says:
     
    "Exception safety
    If the container size is greater than n, the function never throws exceptions (no-throw guarantee).
    Otherwise, the behavior is undefined."

    This means that not crashing is also correct behavior, since the compiler is allowed to do whatever it likes.
  16. Like
    manon_gfx reacted to vorticalbox in Projects that are easy for beginners?   
    You pick the language, just what ever you like.
    Don't do a calculator like everyone says do something useful or fun.
    I would make a little betting game, rolls a number if it's higher than the number you picked you lose if it is lower you win.
  17. Like
    manon_gfx reacted to SSL in Java Project Ideas   
    Implement the A* algorithm and use it in a simple 2D game.
  18. Like
    manon_gfx reacted to gsuberland in Can't figure why I am getting "unhandled exception"   
    Just so you're aware of why this fails, the MSVC++ compiler implements buffer overflow checks when you use the /GS flag. The runtime generates a random "cookie" value and places it on the end of the buffer. This is usually done for the stack (where they're also known as stack canaries), but cookies can be (and are) implemented on the heap too. In this case it's a stack cookie, though. When a runtime call "taints" a checked buffer by writing to it, the compiler injects a call to verify that the expected cookie value remains in memory, before the runtime call returns.
     
    The reason this is used is that, in the case of the stack, you can cause the buffer overflow to overwrite the return address of the scanf call, allowing for arbitrary code execution. In the heap this is a bit more complicated, but typically the trick is to overwrite another object's vtable so that method calls point to an attacker-controlled address.
     
    If you look at the ___security_cookie_init function in a compiled application, you can reverse engineer how it creates the cookies. Here's an example:
    FILETIME systemTime;LARGE_INTEGER perfCount;systemTime.dwLowDateTime = 0;systemTime.dwHighDateTime = 0;int perfValue = 0;int newSecurityCookie = 0; // is the current security cookie set to the default security cookie?if (___security_cookie == DEFAULT_COOKIE || ___security_cookie == 0xFFFF0000){ // make new cookie! GetSystemTimeAsFileTime(&systemTime); newSecurityCookie = systemTime.dwLowDateTime ^ systemTime.dwHighDateTime; newSecurityCookie ^= GetCurrentThreadId(); newSecurityCookie ^= GetCurrentProcessId(); QueryPerformanceCounter(&perfCount); perfValue = (perfCount & 0xFFFFFFFF) ^ (perfCount >> 32); newSecurityCookie ^= perfValue; // ensure a valid cookie was set ___security_cookie = newSecurityCookie ? cookie : DEFAULT_COOKIE; ___security_cookie_complement = !__security_cookie;} The DEFAULT_COOKIE value is a random value baked in at compile time.
  19. Like
    manon_gfx reacted to Nuluvius in Getting into robotics   
    I work with robotics
     
    A few things to think about (right off the top of my head):
    C++/C/Python Interop to higher level languages Architecture, design patterns & principals in both OO and functional/procedural paradigms Understanding of protocols - specifically implementing them Understanding of serial communications Understanding of network stacks and networking in general Understanding of control loops Mathematics Physics Electronics Mechanics Understanding of mobile platforms How do you feel about those and have you had any experience of any so far?
  20. Like
    manon_gfx got a reaction from Enderman in What is your favourite text editor?   
    For C++ and C# I use Visual Studio 2013 professional (will be 2015 once it's fully released)
    For GLSL and HLSL shaders I use Notepad++
  21. Like
    manon_gfx got a reaction from Dobbsjr in What are static variables?   
    First of all what language are we talking about? In C++ static has 3 meanings. In C# there is one meaning.

    C# meaning: In class, a variable that is shared between all objects. Unlike normal variables, which are unique to the object, a static variable is the same for all objects. 
    For example:
    class C
    {
      public int foo = 0;
      public static int bar = 0;
      public void Baz()
      {
        foo += 1;
        bar += 1;
      }
    }
     
    //somewhere else
    C c0 = new C();
    C c1 = new C();
    c0.Baz(); //foo == 1, bar == 1
    c1.Baz(); //foo = 1, bar == 2. (bar is now also 2 for c0).
     
    There are also static functions/methods. A static method doesn't require an object to be created to be called. So let's say we add a static method called 'Banana' to class C.
    class C
    {
      //...
      public static void Banana() { bar += 5; }
    }
    The static method can be called like this: C.Banana(). The static method can access all static variables, but not normal variables.
     
     

    In C++ there are 3 contexts where you can use it.
     
    The first one is in a class. This will work the exact same as in C#.
     
    The second one is as a global variable. Here it means that the variable is private to that specific file (no linker visibility). This is so that when you have to files with and int called global, the linker won't be confused about 2 variables with the same name.
    This also works for function. You can declare a function static, so that it is private to that file.
    The third context is in a function.
    Let's say I have this function

    static void Foo()
    {
      static int i = 0;
      i++;
      printf("%d\n", i);
    }
     
    There is quite a lot to this little bit of code. First of all the function is declared static, meaning it is private to this file. Then there is a static int i, i get's incremented and printed. What's gonna happen is the first time this function is ran, the variable i will be initialized to 0. The every time we call it, it will skip the initialization and use the last value.
    So if I were to call the function 5 times, this would be the output:
    Foo(); //1
    Foo(); //2
    Foo(); //3
    Foo(); //4
    Foo(); //5
     
    I hope this answers your question. static is kind of a weird keyword in C and C++.
  22. Like
    manon_gfx got a reaction from Dobbsjr in How to change default build output directory in Visual Studio 2013   
    You always want to set relative paths for your project. If you do not do this you can't move your project around. If you use relative paths only, you can copy your whole project onto any computer, and it should just work.
    In a visual studio project, you bascially want to use the following file structure:

    Solution folder
        .sln file
        extern folder   //libraries go in here
        Project folder
            bin  //compiled files go in here
            doc //documentation goes in here
            inc  //when writing a library, all public header files go in here
            src  //source code goes here
            .vcxproj file

    For your project you can set the output directory to bin/
    The intermediate directory to bin/$(Configuration)
    You also want to set your working directory (which is under Debugging) to %(OutDir)

    When including libraries, you put them into the extern folder. When then in the additional include directories and additional library directories, you can use a relative path that would look like this: ../extern/YOUR_LIBRARY_NAME/

    I hope this helps. I you need more help, let me know.
  23. Like
    manon_gfx got a reaction from Nineshadow in Brainfuck & Ook!   
    My personal favorite joke languages are chef: http://esolangs.org/wiki/chef, and BS-Lang: https://skillsmatter.com/skillscasts/6088-the-worst-programming-language-ever
  24. Like
    manon_gfx reacted to 12355616511651 in The under 100 line challenge!   
    I can make the most useful program in 1 line. Remove all white spaces ^-^. 
  25. Like
    manon_gfx reacted to SSL in Program Design   
    Questions to ask yourself:
    Can I test each component of the application independently? If I change the internal implementation of a component (but not the interface) does it necessitate changing tests or other parts of the application? Does my code contain large branched/nested if statements or switches? These are indications that you should take another look at your design. The last point in particular suggests that you are not taking proper advantage of OOP principles.
×