Jump to content

DevBlox

Member
  • Posts

    251
  • Joined

  • Last visited

Everything posted by DevBlox

  1. You don't allocate combined_parts, you only declare a pointer which points to whatever. Dangerous code, you should be getting an access violation error (not sure how's it running even). You should decide whether you want concatinate to allocate memory or not (does not really matter if you're just trying things out). Then allocate a chunk of memory (malloc) long enough to fit both strings, other than that, at a glance, you should be fine. In C you don't really "return a string", you return a pointer to the start of the string, which is what char * essentially is, same when passing a string to function. When you allocate with malloc, you allocate on the heap, the memory will be immune to scope change. Just don't forget to free it afterwards
  2. As others have said, it's a character encoding thing. It's not an out of the box thing with C, and you have to be mindful about it and learn how to deal with encodings. This is just how it is really, C is quite a low level programming language in today's standards, a lot of things are done manually. Read about encodings, starting with ASCII, and understand how they're represented. You'll have a better idea of what's going on and why you get question marks. That string of characters contains UTF characters, but in C it's still represented as a bunch of bytes that the terminal cannot understand because it's not set to do that. That is what setlocale does.
  3. OEM in most laptops at least put security chips that contain the key. Windows should pick that up automatically. like it happened to @Slayer3032 . This practice was picked up after the windows stickers were phased out.
  4. Browsers have development tools that simulate different network speeds (meant for getting a feel for how the page would load on mobile, 2g 3g etc), if you can figure out how to have that enabled without being obvious, that's a possible way. Otherwise, capping network speed for youtube specifically is the only way I can think of that, or just cap everything, that would also work :D.
  5. gcc main.c -o main `pkg-config --libs --cflags gio-2.0` I've got an identical setup and worked for me. I don't recall installing any specific library in the past. Could be bundled with glib. Since you got the headers and you still get pkg-config errors, try finding the gio-2.0.pc or similar. It should be in /usr/lib(64)/pkgconfig/. If it's there, you might want to check what pkg-config search paths are. Maybe something is misconfigured somehow.
  6. Some more examples from the top of my head: Video/Image rendering, transcoding Molecular physics simulation (I once had the honour to work with synthetic biologists that used those simulations to try and predict if their models work) Bitcoin mining Big Data occasionally uses CUDA I think, depends on the workload Material science simulations Aerospace engineering simulations I bet CERN uses CUDA to churn the massive amounts of data they generate (don't quote me on this one) Accelerating CAD software
  7. GPU's are just specialised processors. Specialised in relatively simple (for a chip) but massively parallel computations. Stream processors and CUDA cores are miniature compute cores. CUDA (and OpenCL) are basically standardised API's (as in tools, separate programming languages even) to harness those cores in a useful and comfortable manner. Applications that want/need to use that ability use CUDA/OpenCL to implement their use case. That's when the "oh it's used for machine learning" come in, that's just an application of CUDA/OpenCL, they can be used for anything they are useful for, just need to code that in. There is a bunch more stuff to GPU's than just those cores, but they are most useful for general purpose computing.
  8. Self-documenting code and README's + separate high-level documentation, trying to write things that don't change much (minimises time to maintain).
  9. DevBlox

    API

    Imperial is now purely based on the metric system. That means there exists constants that will be valid "forever". Depending on your use, implementing the conversion yourself might be faster than trying to use some API. Especially when it's really straightforward like now.
  10. That's barely enough info to help. Bad gateway usually is returned when a reverse proxy fails to access where it's supposed to. Think nginx as reverse proxy to a site. It will return 502 when it cannot access the site it's supposed to proxy to. Think about where that could be happening in your case.
  11. I prefer hosting my own VPN server and using that.
  12. You're going to have to program logic, no matter how easy it will be to create a GUI with this or that tool. Time to learn programming.
  13. Well, you say you know Java - it is possible to do it in Java from start to finish. Android app, server - perfect. Not practical on desktop, as it's Java and all, might need to write the client in another language if you want a lightweight client. You won't be able to do it without some sort of server. You can use a peer-to-peer protocol, but you will still need a tracker (without big storage at least), and you still need a server for that. There's more than one way to do it, so it's really impossible to say what exactly you will need. But in any way, it's a networking centered project. You will need to learn how networks and different protocols actually work, depending on what you will be using and how you will design it. HTTP/HTTPS is a given, others may be present. You will need to learn about network security, if you want to do it properly and securely. If you're going to use HTTPS (I suggest you do), you will need to invest into a domain and a certificate (or at least use Lets Encrypt certs, they are free). You will need to learn how to deal with all of that domain/cert stuff. You will need to learn to create user interfaces on multiple platforms, since you will be covering: mobile (android), web (on server, might not need to, depends on what you want to do ), desktop. Means differ from platform to platform. Your clients will need to be able to watch their designated folders and files for changes, execute on those changes, you will also need to think about how to deal with file conflicts, and track files overall. Think about not draining your battery on android. Performance takes the last seat I guess, in your case, one teeny tiny server will do, it won't complicate things too much either. You will need a database on there probably (again, depends on what you do), just pick MySQL or smth. So you will need at least basic SQL knowledge. All in all, you're looking at 3 different projects, for 3 places your code will be running on. They will all communicate, so they will need common means to exchange data. Just use JSON over HTTP(S), for everything, except for files, JSON won't work with files properly. Since I assume you'll be doing this on your own, it will take awhile to nail everything. Good luck.
  14. DON'T DO IT (jk. it's popular to hate on Java) Since you're familiar with C#, Java will be similar structure wise, as mentioned. Now it depends on what C# language features you're accustomed to use, but Java does not really have the semantics of modern C# (I find streams in Java 8 inferior to C# LINQ for eg, or class properties in .NET 4.6), not sure what's new since the last time I used both of them though.
  15. If statement if good. But I'm wondering about hidden characters that don't appear when echo'ing. Try like this? if [[ $GIMP =~ "gimp" ]] then sudo apt-get install $GIMP else echo "did not install gimp" fi EDIT: sorry wrong operation initially
  16. I'm onboard with it. I'm really pretty much done with boilerplate init scripts, I like just getting a simple service from a simple service file that's easy to type out from memory even. I find using the basic facilities nicer too. The amount of stuff you get from just having that tiny config file is worth it to me. Unlike init, where it all depends if that status part was built comprehensive or not and differs by project all the time. Anyway, I get to mess about with those files when setting up services (I'm DevOps), occasionally have to write my own for a service that does not yet have one, I run everything I can on it. Systemd makes my life painless/scriptless. I'm not sure about if I'm okay with it having a million features, but I don't really mind if I get a standard tool that works a certain predictable way. I never had any trouble with it though, might be another story if it was otherwise. Init is also a single point of failure, it itself does not fail - it's too simple. But IMO the complexity just ends up elsewhere, beyond init's reach.
  17. Doubt it, I don't think VM is going to be able to see anything. Check your bios, if you have basic profiles, maybe that's enough?
  18. Though of it? Many times. If I were to do it I'd go with a more modern language than C/C++. Would probably pick Rust as it stands. Would probably design it in a "containerized" way and try to make that not be a major pain in the a$$. Issue is that you need to support at least common software (surprise surprise), there's no way everybody's doing everything from bottom up. There would probably be a lot to think about, as you need to support standard syscalls, POSIX and so on and so forth. Would probably end up as a "containerized" OS that has a compatibility layer for old applications with the eventuality of perfection.
  19. MSI eh... I haven't heard nice things about it's compatibility with Linux in the past. Forget about Dragon Center for sure - proprietary software, and I'm 90% sure there isn't a Linux version. If there's any RGB trickery going on, you might lose that. Other than that, check if the wireless card is supported, you might just get by. Probably all networks support Linux, I did not find one that doesn't yet, or I did not understand the statement. Quick google search found me this: https://github.com/Askannz/msi-perkeyrgb. I expect that all features will be in this kind of loose manner, if at all. Bits and pieces everywhere. I doubt anyone reimplemented the whole thing. Because, well, it's proprietary, so no documentation, no tools to build on top of. Best to simply get yourself a Live USB and test, can't get much simpler than that. You won't break anything if you test it like so.
  20. That'd be a separate domain, you'd have to buy separately. Return and re-buy would achieve that, but I'm completely unsure about any policy like that on domains, never saw one, possibly does not exist.
  21. For C++: Windows Forms for the most part, least involvement. For cross-platform I'd use GTK, it has a nice UI designer called Glade. It's way more involving on Windows, though, you'd need to be well versed with the compile process/library linking, but works out of the box on Linux and with relative ease on MacOS. Java has this thing called Swing. I remember it being more of less painless. Well, it's Java anyway, I don't really see the purpose to write anything new on it anymore, unless it's an app Python probably has it's own thing, or you can pretty much pick any comfortable lib and there will be bindings I'm sure. Definitely remember there being GTK bindings. Good luck!
  22. Well, yes, you don't need a good monitor, but that sure as hell is nice. I personally love screen real-estate and crisp text, can get around bigger IDE's without constantly pushing things around to see the widget or screen I need. When I had a small screen I just got some vi plugins and worked on that, but eventually I needed more features on bigger projects. I'll get around to a 21:9 someday, code on one side, library reference on another, perfect.
  23. You can use some regular distro, but install a lightweight desktop manager like LXDE. I think it should run fine like that, and you won't skip important updates.
  24. There isn't one thing really. CPU's are mostly made to be well rounded for a given price point. Better to look per generation. Even an i3 would stick just for development. If you have a choice between a better CPU and more RAM - get more RAM. I have 8GB and it's not enough for me. Instead of buying a new laptop I'll just upgrade to 32GB RAM, because I have (as most developers really) many resources/tabs open when developing, and when my PC starts swapping, it kills performance way more than a weaker CPU would.
  25. You could work on an older device easily, I work on a laptop with i5-6300U, don't really feel I need something faster. The biggest performance boost I've ever gotten was switching to a device that had the almighty SSD. That's pretty much it for web development. It's another question when there are giant projects, with many files that need be compiled. I've encountered this when I needed to work on OpenCV, tweaking settings and recompiling. Compilers are single threaded, but multiple processes can be started to compile in parallel. Then you need many many cores if you want that to be fast. That's why Wendell on Level1 tests Threadripper in a Linux kernel compile speed test. For hosting there are web applications that need a lot of processing power, but generally they're not basic web applications. Usually that's something completely different and custom, and you still probably don't need a beastly PC to work on those. The areas that need beastly PC's quite obvious usually, like game development, as mentioned. Machine learning could be another, but even that can be done on an old machine, with larger scale testing just being done on servers.
×