[QUOTE=Cold;46689263]This is like debugging computer problems with my mom "There where errors and it said something about some kind of "linker" but then i pressed X before reading the rest"
- Give us the full Error
- What is your linker input/settings.
Tip, binaries are not compatible between vs versions, and debug applications should link against debug libraries, release applications againt release libraries.
Also if something crashes there is this cool thing called a debugger to help you find out what causes it.
If it crashes before the debugger attaches, check the return code in the output window (its showed as signed decimal, convert it to hex you get an NTSTATUS code)
You should use Google to figure out how to create a 64 bit binary.[/QUOTE]
Fuck it, visual studio isn't worth the effort. I'll just stick to code::blocks
[QUOTE=IliekBoxes;46688746]this is ruby
[code]gWords= File.foreach('german.txt').first(18)
eWords= File.foreach('english.txt').first(18)
cppFile= IO.readlines('germanVersion.cpp')
for i in 0..cppFile.length-1
for j in 0..17
cppFile[i].gsub! gWords[j], eWords[j]
end
end
puts cppFile [/code]
For whatever reason, this isn't working. I just get back the orginal cppFile. I think it has something to do with the array of words i'm using with gsub. Any ideas?[/QUOTE]
[del]File does not have a "foreach" method. You're thinking of IO.foreach.
Also, t[/del]That does not strip line endings, so if you have a German word, "solange", you're actually trying to replace "solange\n"
Anyway, why are you splitting the file into lines, requiring you to iterate over every line, and using ranges?
[code]
german = File.read("german.txt").lines.map {|x| x.strip}
english = File.read("english.txt").lines.map {|x| x.strip}
cppFile = File.read("germanVersion.cpp")
german.each_index do |i|
cppFile.gsub! german[i], english[i]
end
puts cppFile
[/code]
[QUOTE=proboardslol;46691114]Fuck it, visual studio isn't worth the effort. I'll just stick to code::blocks[/QUOTE]
I guess you would be the last person to know if that's true or not.
[QUOTE=Tommyx50;46680951]You realise that C++ has libraries too, right? Not only the C++ libraries, but all of the C ones, too?
And you also realise that these libs won't be like the Java ones which leak memory everywhere and completely thrash your program, because Java fails to allow them to manually deallocate memory?
EDIT:
I mean, you can pretty easily program in high-level in C++ nowadays, when you think about it. Can't be bothered with manual memory management? Well, you can either get one of the many libs which implement a garbage collector and use one of those, or use smart pointers. Really miss all those useful data structures like resizeable arrays? No problem, std::vector has got your back, as well as the many, many other features in the standard library! Hell, let's assume that manually writing out your for loops is too much for you - even then, no worries! C++11 has range-based for loops![/QUOTE]
1) The languages ship with those libraries (well, C# on windows only but C# is MS's anyways). "Use a third party" is generally a shitty solution.
2) C++ developers don't seem to like high level stuff when they ship their own libraries. Libpng still takes way too many lines to open 1 image.
I wasn't talking about memory management, just general ease of use. Maybe libpng has specifically left a bad taste in my mouth with_its_terrible_naming_scheme and the fact that it isn't terribly easy to use.
And managed code is perfectly fine if you know what you're doing to not make the garbage collector go shoot itself.
what do i need help with? with this :(
[url]http://facepunch.com/showthread.php?t=1441469[/url]
[QUOTE=thrawn2787;46693674]2) C++ developers don't seem to like high level stuff when they ship their own libraries. Libpng still takes way too many lines to open 1 image.[/QUOTE]
Libpng is C.
Moreover, there's literally a C++ wrapper for it that lets you open an image in one line:
[code]png::image< png::rgb_pixel > image("input.png");[/code]
The sample is [url=http://www.nongnu.org/pngpp/]straight from the website[/url].
[QUOTE=Darwin226;46693472]I guess you would be the last person to know if that's true or not.[/QUOTE]
1. You don't have to be a dick to people who do things differently
2. I'm not big on IDEs. I prefer just a regular Text editor, and command line compilation. but IDEs are better for managing files in OOP. I thought I'd try it out since I got it for free with dreamspark, but from what I've otherwise seen about it, it doesn't seem to offer much more than code::blocks offers me, and it's a lot... bulkier.
[QUOTE=proboardslol;46694623]1. You don't have to be a dick to people who do things differently
2. I'm not big on IDEs. I prefer just a regular Text editor, and command line compilation. but IDEs are better for managing files in OOP. I thought I'd try it out since I got it for free with dreamspark, but from what I've otherwise seen about it, it doesn't seem to offer much more than code::blocks offers me, and it's a lot... bulkier.[/QUOTE]
You asked for help and then after the first reply where like "lol nevermind i gave up".
You are the dick here.
[QUOTE=DrTaxi;46691535]File does not have a "foreach" method. You're thinking of IO.foreach.[/QUOTE]
File does have #foreach because File is a subclass of IO. Also, IliekBoxes, substituting words in a .cpp file like that is a bit risky because if your search term is very short, [url=http://www.telegraph.co.uk/news/newstopics/howaboutthat/2667634/The-Clbuttic-Mistake-When-obscenity-filters-go-wrong.html]you may end translating stuff that's not meant to be translated[/url].
[QUOTE=proboardslol;46694623]1. You don't have to be a dick to people who do things differently
2. I'm not big on IDEs. I prefer just a regular Text editor, and command line compilation. but IDEs are better for managing files in OOP. I thought I'd try it out since I got it for free with dreamspark, but from what I've otherwise seen about it, it doesn't seem to offer much more than code::blocks offers me, and it's a lot... bulkier.[/QUOTE]
VS is leagues ahead of codeblocks
and like fuck a bunch of people are willing to help you with linking in vs, all you were asked to do was to list the error and your linker input but apparently that is too much work (??)
[QUOTE=Cold;46694919]You asked for help and then after the first reply where like "lol nevermind i gave up".
You are the dick here.[/QUOTE]
That's my prerogative. You don't have to be rude about it
[editline]11th December 2014[/editline]
[QUOTE=Bumrang;46695009]VS is leagues ahead of codeblocks
and like fuck a bunch of people are willing to help you with linking in vs, all you were asked to do was to list the error and your linker input but apparently that is too much work (??)[/QUOTE]
No, it's just that I'd much rather stick with an editor I know how to use. If VS takes any more effort than code::Blocks does, then fuck it I don't feel like putting any effort into it.
I wouldn't even use all the shit it offers anyways. I barely use any of the stuff on code blocks, it's just faster to compile C++ through an IDE than it is to link everything manually through g++. I really don't like IDEs.
[QUOTE=proboardslol;46694623]1. You don't have to be a dick to people who do things differently
2. I'm not big on IDEs. I prefer just a regular Text editor, and command line compilation. but IDEs are better for managing files in OOP. I thought I'd try it out since I got it for free with dreamspark, but from what I've otherwise seen about it, it doesn't seem to offer much more than code::blocks offers me, and it's a lot... bulkier.[/QUOTE]
I'm very rarely rude to people and my post definitely wasn't rude.
I'm not sure how long you've been programming for but your attitude definitely matches mine when I was starting. You should definitely try to be more open to things. It helps.
Also, feel free to NOT have an opinion once in a while.
[QUOTE=proboardslol;46695087]I wouldn't even use all the shit it offers anyways. I barely use any of the stuff on code blocks, it's just faster to compile C++ through an IDE than it is to link everything manually through g++. I really don't like IDEs.[/QUOTE]
You say that now...
[QUOTE=Darwin226;46696290]I'm very rarely rude to people and my post definitely wasn't rude[/QUOTE]
[quote]
I guess you would be the last person to know if that's true or not.[/quote]
Maybe it's a language barrier thing, but that was kind of a sarcastic, dickish thing to say. I get that I'm new to OOP, but just because I CHOOSE to not use a piece of software doesn't say anything about me. It just means I don't like VS. It doesn't appear to offer anything that I would need more than the average IDE. A few things (like code completion) kind of annoy me when they trip me up when I'm typing.
I don't see why this is a contentious issue. I don't wanna use VS. So what? It doesn't work on linux so I can't even see the opportunity I would have to use it anyways, since I only really use Windows as a last resort when Wine won't run something.
[QUOTE=proboardslol;46697712]
I don't see why this is a contentious issue. I don't wanna use VS. So what? It doesn't work on linux so I can't even see the opportunity I would have to use it anyways, since I only really use Windows as a last resort when Wine won't run something.[/QUOTE]
if os is the problem then check out clion
[QUOTE=proboardslol;46697712]Maybe it's a language barrier thing, but that was kind of a sarcastic, dickish thing to say. I get that I'm new to OOP, but just because I CHOOSE to not use a piece of software doesn't say anything about me. It just means I don't like VS. It doesn't appear to offer anything that I would need more than the average IDE. A few things (like code completion) kind of annoy me when they trip me up when I'm typing.
I don't see why this is a contentious issue. I don't wanna use VS. So what? It doesn't work on linux so I can't even see the opportunity I would have to use it anyways, since I only really use Windows as a last resort when Wine won't run something.[/QUOTE]
I don't care whether or not you eventually decide to actually try the thing you don't like. Hopefully you will.
Unfortunately, you can't really claim that something is worth it or not unless, you know, you have an actual clue about what you're talking about.
I've tried to use VIM many times and never having the patience to learn it properly, but there are people.. smart, respectable people ..that have mastered it and swear it's magical. So I might say "It isn't worth it to force myself to learn at this time" but you can be damn sure I'll never say "It isn't worth the effort". How the hell would I know? Or in other words "I guess you would be the last person to know if that's true or not".
There are such things as preferences in the programming world, but they come from experience. Lots and lots of experience. I know for a fact that you'll change your mind about things you feel extremely adamant about at the moment, so it really might be worth it to try and not have an opinion about everything.
vim is my go-to text editor for editing text files over SSH or when I only have a terminal at my disposal. It's also nice for locally editing files, but nothing beats code completion¹, quick-jumping and refactoring tools in proper IDEs like those from JetBrains. If I got a good IDE for what I want to do, and I'm not just editing a single-file project, I tend to go with the IDE.
¹ Vim does have code completion plugins which I use. They're pretty awesome, but feature limited.
how to fix this
[img]http://i.imgur.com/4XTuAPM.jpg[/img]
(it's the gender)
The gender string is not initialized, so the print function runs until it finds a string terminator (NULL), so it reads memory until it happened to run into the other string.
This MATLAB code doesn't seem to compile for me, what's wrong?
[url]http://gyazo.com/f4c6eb612912d7da322fb7420b89eba0[/url]
[QUOTE]Error in ode45 (line 114)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0,
f0, odeArgs, odeFcn, ...[/QUOTE]
[QUOTE=Alternative Account;46698100]vim is my go-to text editor for editing text files over SSH or when I only have a terminal at my disposal. It's also nice for locally editing files, but nothing beats code completion¹, quick-jumping and refactoring tools in proper IDEs like those from JetBrains. If I got a good IDE for what I want to do, and I'm not just editing a single-file project, I tend to go with the IDE.
¹ Vim does have code completion plugins which I use. They're pretty awesome, but feature limited.[/QUOTE]
While I'm not sure what plugins you do use for vim, and what languages they support, I know that the code completion for C seems to support every single fucking thing there is, including system includes, locally included files, and more. That, and "quick-jumping" (I mean j98741 is pretty neat tbh). Not sure about refactoring tools, since I never really make great blobs of code but instead refactor as I go.
[QUOTE=mastersrp;46699770]While I'm not sure what plugins you do use for vim, and what languages they support, I know that the code completion for C seems to support every single fucking thing there is, including system includes, locally included files, and more. That, and "quick-jumping" (I mean j98741 is pretty neat tbh). Not sure about refactoring tools, since I never really make great blobs of code but instead refactor as I go.[/QUOTE]
Yep, I got that one. It's pretty swanky, but I don't write C much, so...
[QUOTE=Darwin226;46698043]. So I might say "It isn't worth it to force myself to learn at this time" but you can be damn sure I'll never say "It isn't worth the effort". .[/QUOTE]
fyi, this might be another language barrier but those two statements are pretty much the same thing
[QUOTE=proboardslol;46702009]fyi, this might be another language barrier but those two statements are pretty much the same thing[/QUOTE]
No, not really. One of them implies he might still do it at some point, the other implies he'll never consider it.
[QUOTE=Cold;46698689]The gender string is not initialized, so the print function runs until it finds a string terminator (NULL), so it reads memory until it happened to run into the other string.[/QUOTE]
I'm currently using another function for user-input and I think gender don't pass right if I use scanf, changed to gets and it now works. Thanks!
[QUOTE=frdrckk;46702461]I'm currently using another function for user-input and I think gender don't pass right if I use scanf, changed to gets and it now works. Thanks![/QUOTE]
But [url=http://stackoverflow.com/questions/1694036/why-is-the-gets-function-dangerous-why-should-it-not-be-used]gets isn't kosher[/url] because you can easily get buffer overflows when the arbitrarily long input happens to be longer than the size of the buffer you're storing the string in. This may lead to hard to trace program crashes and/or security issues. Use fgets() or gets_s() instead.
[QUOTE=Alternative Account;46704164]But [url=http://stackoverflow.com/questions/1694036/why-is-the-gets-function-dangerous-why-should-it-not-be-used]gets isn't kosher[/url] because you can easily get buffer overflows when the arbitrarily long input happens to be longer than the size of the buffer you're storing the string in. This may lead to hard to trace program crashes and/or security issues. Use fgets() or gets_s() instead.[/QUOTE]
Thanks for the tip, changed it to fgets and I feel a lot kosher now.
Pretty basic Java question here
[code]
if (condition1 && condition2)
{
return 1000000;
}
if (condition3 && condition4)
{
return 1000000;
}
if (condition5 && condition6)
{
return 1000000;
}
[/code]
So as you can see, I have all these different if-statements that all return the exact same value
is there any way I can shorten this or, uhh, "put them under the same roof"?
[QUOTE=NotMeh;46706743]Pretty basic Java question here
[code]
if (condition1 && condition2)
{
return 1000000;
}
if (condition3 && condition4)
{
return 1000000;
}
if (condition5 && condition6)
{
return 1000000;
}
[/code]
So as you can see, I have all these different if-statements that all return the exact same value
is there any way I can shorten this or, uhh, "put them under the same roof"?[/QUOTE]
[code] if( ( condition1 && condition2 ) || ( condition3 && condition4 ) || ( condition5 && condition6 ) )[/code]
How do I pass-by-reference/pointer a character array so that I can modify it's contents on another function? It's been doing my head in.
Sorry, you need to Log In to post a reply to this thread.