The Big Programming Thread - Page 956
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
Nars_
31 Posts
| ||
Silvanel
Poland4601 Posts
On April 20 2018 23:35 Excludos wrote: Or the quote my boss gave me when I told him we desperately needed to implement some unit testing in our consistently breaking system. "You should have just made it better to begin with" and "We don't have time to do testing right now, the system needs to work first". The irony of the last statement was lost on him. On a completely different topic: I'm starting in a new job next week xD GZ on the new job. In regards to "testing" this approach is only possible in small companies/projects where there might be no place for dedicated tester. In the end that means developers end up being their own testers. Which isnt very effective. The larger the project, the more people involved, the larger and more numerous dependencies the greater is need for good testing strategy. And that usually involves people dedicated only to testing. Not to mention that if Your customer is another company with at least a little bit of knowledge about SW development they might just ask "What is Your testing strategy", and they wont take "we just write good code" for an answer. | ||
bo1b
Australia12814 Posts
Yet I go online and I find a variety of moocs with what looks like fairly excellent layouts for a cs education, such as: https://github.com/P1xt/p1xt-guides/blob/master/cs-java-focus.md https://github.com/ossu/computer-science various online university courses, such as cs 50x Do you think that completing some of those pathways will ever lead to a more difficult to get to job? Completing the ossu from start to finish is no joke, that really closes in on a university level education, plus a bit. | ||
Silvanel
Poland4601 Posts
| ||
sc-darkness
856 Posts
| ||
Excludos
Norway7685 Posts
On April 21 2018 16:32 Silvanel wrote: GZ on the new job. In regards to "testing" this approach is only possible in small companies/projects where there might be no place for dedicated tester. In the end that means developers end up being their own testers. Which isnt very effective. The larger the project, the more people involved, the larger and more numerous dependencies the greater is need for good testing strategy. And that usually involves people dedicated only to testing. Not to mention that if Your customer is another company with at least a little bit of knowledge about SW development they might just ask "What is Your testing strategy", and they wont take "we just write good code" for an answer. I disagree wholeheartedly. The most effective tester is the programmer himself. He knows exactly what every piece of his code/program is suppose to do, and can quickly dive in and fix it. That doesn't mean you don't need external testers as well, but those as more to test the program from a user's point of view rather than a tech savvy programmer's point of view (As well for the fact that a dedicated tester will have a lot more time for exactly that, while a programmer also has to..program). And all programmers do test, even if it's a bare minimum: They compile the program after writing a piece of code. But you could do so much more without eating into your feature list schedule, and automated testing is excellent for that. Unit testing and front end testing tools like Cypress are golden for making sure that all your user stories works like they are suppose to. So whenever your/my boss tells you that "There's no time for testing because nothing is working", he is showing a fundamental failure to understand what testing does: Making sure that stuff works. At that point the only solution is to find another job. Because I sure as hell aren't going to push untested features which could literally end up killing people or animals (We have already done the latter and have had some damn close near misses on humans too. I won't stick around for it) | ||
Silvanel
Poland4601 Posts
| ||
ShoCkeyy
7815 Posts
Adding an extra edit: I do however believe getting a degree helps in a sense of experience building from nothing when you know nothing. It took me longer learning to build from scratch thats for sure. | ||
sc-darkness
856 Posts
On April 19 2018 02:48 sc-darkness wrote: Ok, what the fuck is the problem with std::string and std::wstring on Linux and Windows? I see that std::string is somehow magically "UTF-8 ready" on Linux. On the contrary, Windows prefers std::wstring for unicode. Yet, std::wstring is 4 bytes on Linux and only 2 bytes on Windows. How does that make std::wstring less desirable on Linux? Why? Clearly wstring is larger so it could hold more characters? And why is this fucked up on an OS level? I just don't understand all this mess. Link: https://stackoverflow.com/questions/402283/stdwstring-vs-stdstring?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa Edit: Are we meant to use these now? Fuck the hacky 8-bit ASCII (a.k.a Windows code pages) backwards compatibility support on Windows and the shit it caused to Unicode support. Code: + Show Spoiler +
Linux: + Show Spoiler + 新年快乐 / 新年快樂 Size of char: 1 Size of wchar_t: 4 Linux uses UTF-8 by default. Windows: + Show Spoiler + ???? / ???? Size of char: 1 Size of wchar_t: 2 Warnings: + Show Spoiler + warning C4566: character represented by universal-character-name '\u65B0' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u5E74' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u5FEB' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u4E50' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u6A02' cannot be represented in the current code page (1251) Windows uses UTF-16 by default but only for wstring not for string. If we replace string with wstring, it still doesn't work with wcout. More work is necessary to make Windows Command Prompt to display it for you. Thank you Microsoft for screwing Unicode support. :D | ||
Excludos
Norway7685 Posts
On April 23 2018 05:51 sc-darkness wrote: Fuck the hacky 8-bit ASCII (a.k.a Windows code pages) backwards compatibility support on Windows and the shit it caused to Unicode support. Code: + Show Spoiler +
Linux: + Show Spoiler + 新年快乐 / 新年快樂 Size of char: 1 Size of wchar_t: 4 Linux uses UTF-8 by default. Windows: + Show Spoiler + ???? / ???? Size of char: 1 Size of wchar_t: 2 Warnings: + Show Spoiler + warning C4566: character represented by universal-character-name '\u65B0' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u5E74' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u5FEB' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u4E50' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u6A02' cannot be represented in the current code page (1251) Windows uses UTF-16 by default but only for wstring not for string. If we replace string with wstring, it still doesn't work with wcout. More work is necessary to make Windows Command Prompt to display it for you. Thank you Microsoft for screwing Unicode support. :D Did I mention that I lo-o-o-ove Qt? All of these shitstained compatibility issues worked out behind my back without me having to worry about it. | ||
sc-darkness
856 Posts
| ||
Khalum
Austria831 Posts
On April 23 2018 05:51 sc-darkness wrote: Fuck the hacky 8-bit ASCII (a.k.a Windows code pages) backwards compatibility support on Windows and the shit it caused to Unicode support. Code: + Show Spoiler +
Linux: + Show Spoiler + 新年快乐 / 新年快樂 Size of char: 1 Size of wchar_t: 4 Linux uses UTF-8 by default. Windows: + Show Spoiler + ???? / ???? Size of char: 1 Size of wchar_t: 2 Warnings: + Show Spoiler + warning C4566: character represented by universal-character-name '\u65B0' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u5E74' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u5FEB' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u4E50' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u6A02' cannot be represented in the current code page (1251) Windows uses UTF-16 by default but only for wstring not for string. If we replace string with wstring, it still doesn't work with wcout. More work is necessary to make Windows Command Prompt to display it for you. Thank you Microsoft for screwing Unicode support. :D I ported a ton of code to use boost::filesystem::path for paths instead of a seemingly random combination of char*, std::string, QString, ... last year. I don't know how I retained my sanity. | ||
Excludos
Norway7685 Posts
On April 23 2018 07:49 Khalum wrote: I ported a ton of code to use boost::filesystem::path for paths instead of a seemingly random combination of char*, std::string, QString, ... last year. I don't know how I retained my sanity. Why not use QPath or QFile when you already have Qt installed? Not that boost is bad, but I don't see a reason to use both of them as, to my knowledge, Qt covers everything boost does. | ||
ddengster
Singapore129 Posts
On April 23 2018 05:51 sc-darkness wrote: Fuck the hacky 8-bit ASCII (a.k.a Windows code pages) backwards compatibility support on Windows and the shit it caused to Unicode support. Code: + Show Spoiler +
Linux: + Show Spoiler + 新年快乐 / 新年快樂 Size of char: 1 Size of wchar_t: 4 Linux uses UTF-8 by default. Windows: + Show Spoiler + ???? / ???? Size of char: 1 Size of wchar_t: 2 Warnings: + Show Spoiler + warning C4566: character represented by universal-character-name '\u65B0' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u5E74' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u5FEB' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u4E50' cannot be represented in the current code page (1251) warning C4566: character represented by universal-character-name '\u6A02' cannot be represented in the current code page (1251) Windows uses UTF-16 by default but only for wstring not for string. If we replace string with wstring, it still doesn't work with wcout. More work is necessary to make Windows Command Prompt to display it for you. Thank you Microsoft for screwing Unicode support. :D Read up utf8everywhere As a rule of thumb, you use should using utf8 (std::string or char, preferably char arrays ) instead of wchar types in your code; only convert them when the windows API demands it. UTF8 is an encoding that contains all the ascii character plus the extended ones, see #7 of the article in the link. UTF16 also has a number of disadvantages, and the article lists that down as well. There are open source code/libraries that do the conversion from utf8 to utf16 and vice versa, go find them. If you introduce another wstring type in your code, you'll have to spend a whole bunch of time writing versions of code for wstring types. Edit: Also, do note that you need to adjust accordingly if you do string manipulation or want to use string lengths with utf8 characters. | ||
nunez
Norway4003 Posts
On April 23 2018 16:34 Excludos wrote: Why not use QPath or QFile when you already have Qt installed? Not that boost is bad, but I don't see a reason to use both of them as, to my knowledge, Qt covers everything boost does. boost::filesystem was merged into standard c++ since c++17. | ||
Khalum
Austria831 Posts
On April 23 2018 19:08 nunez wrote: boost::filesystem was merged into standard c++ since c++17. Aye. We're on c++11 but once we decide to switch we can use std::filesystem functionality -> less 3rd party dependencies -> good. | ||
nunez
Norway4003 Posts
| ||
sc-darkness
856 Posts
| ||
WarSame
Canada1950 Posts
You have an object you want to inject. You Provide it with @Provides inside of an @Module. You then use it somewhere else with @Inject. Is this correct so far? If it is I'm failing to apply it to my cause and getting errors that aren't google-able. In my case I am trying to inject an instance of a javax.crypto.KeyGenerator. I created a Module AppComponent with an @Provides KeyGenerator provideKeyGenerator(String walletName). I then want to @Inject this into another Class with certain parameters but I can't get that to work. I've tried a number of things, but keep running into problems injecting it, because it runs into problems injecting into a static field. Does anyone have a good, basic guide for doing something like this? I feel like I'm running into a wall with this. I'll try to post some sample code tomorrow night to give this post an actual purpose. | ||
Danehardin
0 Posts
| ||
| ||