[QUOTE=ZeekyHBomb;42656917]That "backward >=" is <=, not =<.
I'd format it as
[code] if( age >= 65 )
{
cout << "Your ticket wil be $5.00. ";
}
else if(age >= 13 )
{
cout << "Your ticket will be $8.00. "
}
else
{
cout << "Your ticket will be $7.00. "
}[/code][/QUOTE]
Any particular reason you choose age >= 13 instead of age <= 12? It makes more sense to me to do it like he had originally designed it, with the if's having the discounted prices and the else having the normal price.
This symlink might come from Debians Alternative thingy. You probably have both Java 6 and 7 installed and it defaults to 6. Shouldn't make any problems.
Try [url=http://askubuntu.com/questions/141791/is-there-a-way-to-update-all-java-related-alternatives/141798#141798]this[/url].
Check the output of env|grep JAVA_HOME after that. If it's not set put [url=http://serverfault.com/questions/143786/how-to-determine-java-home-on-debian-ubuntu/143838#143838]this[/url] in /etc/profile [b]*edit: and put export in front of that, so the variable becomes visible outside of the script*[/b]. I'm not sure if this is the proper way to do it in Ubuntu, but it should do for now.
You will probably need to re-login again before changes to the environment become visible. I'm not sure if there's some fancy system which can apply that change to running sessions.
Why is this not done automatically though??
[editline]27th October 2013[/editline]
[QUOTE=mobrockers;42656967]Any particular reason you choose age >= 13 instead of age <= 12? It makes more sense to me to do it like he had originally designed it, with the if's having the discounted prices and the else having the normal price.[/QUOTE]
See my edit :^)
[QUOTE=diwako;42656933][IMG]http://img585.imageshack.us/img585/4336/a4at.jpg[/IMG][/QUOTE]
Looks like you've installed the 64-bit jdk, are you running a 64-bit OS and are you installing the 64-bit Eclipse and Netbeans releases? To use the 64-bit jdk you need a 64-bit OS, jdk and IDE combo.
[QUOTE=mobrockers;42656967]Any particular reason you choose age >= 13 instead of age <= 12? It makes more sense to me to do it like he had originally designed it, with the if's having the discounted prices and the else having the normal price.[/QUOTE]
edit
I can't read.
[QUOTE=JohnStamosFan;42657144]edit
I can't read.[/QUOTE]
Are you asking me to rewrite the sentence?
[QUOTE=mobrockers;42657187]Are you asking me to rewrite the sentence?[/QUOTE]
No, i thought that was at my post initially, then realized it was to Zeeky. I just misread it all.
[QUOTE=ZeekyHBomb;42657055]Check the output of env|grep JAVA_HOME after that. If it's not set put [url=http://serverfault.com/questions/143786/how-to-determine-java-home-on-debian-ubuntu/143838#143838]this[/url] in /etc/profile [b]*edit: and put export in front of that, so the variable becomes visible outside of the script*[/b]. I'm not sure if this is the proper way to do it in Ubuntu, but it should do for now.
[/QUOTE]
Don't really get this step, the first one did not work.
"java -version" and "javac -version" does now show 1.7.0_25 tho
[QUOTE=JazZ5109AI;42656119]Are there any remotely similar IDE's for python that resemble Visual Studios
I'm having a hard time finding one, which in my general opinion is pretty weird considering python is very object oriented[/QUOTE]
Visual Studio :v:
[URL="https://pytools.codeplex.com/"]There's an extension.[/URL] I haven't tested it but it looks decent, probably better than PyDev for Eclipse.
You won't get IntelliSense as good as C#'s anywhere though, it just doesn't work because Python is too dynamic.
In the source engine, how do you know if a player is strafing left or right?
[QUOTE=JazZ5109AI;42656119]Are there any remotely similar IDE's for python that resemble Visual Studios
I'm having a hard time finding one, which in my general opinion is pretty weird considering python is very object oriented[/QUOTE]
I haven't used it, but I've heard [URL="http://www.jetbrains.com/pycharm/"]PyCharm[/URL] is really good.
[QUOTE=diwako;42657289]Don't really get this step, the first one did not work.
"java -version" and "javac -version" does now show 1.7.0_25 tho[/QUOTE]
After doing some searching ... [url=https://bugs.launchpad.net/ubuntu/+source/java-common/+bug/45348/comments/15]idiology[/url] :v:
Try [url=https://bugs.launchpad.net/ubuntu/+source/java-common/+bug/45348/comments/13]this[/url], otherwise, if you have a /etc/profile.d directory, do
[code]# echo '#!/bin/sh
export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")' > /etc/profile.d/99-javahome.sh && chmod +x /etc/profile.d/99-javahome.sh[/code]
Otherwise I'm not sure how to do this properly on Ubuntu, echo 'export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")' >> /etc/profile should work for a while, until some update might overwrite the file. Be sure to use two >'s here, which means append, while a single > would overwrite the existing contents of the file.
[editline]27th October 2013[/editline]
What the hell? Are other people getting spammed with Cloudfare Captchas too?
I had to fill one out for every post and edit made today :(
[QUOTE=ZeekyHBomb;42661425]After doing some searching ... [url=https://bugs.launchpad.net/ubuntu/+source/java-common/+bug/45348/comments/15]idiology[/url] :v:
Try [url=https://bugs.launchpad.net/ubuntu/+source/java-common/+bug/45348/comments/13]this[/url], otherwise, if you have a /etc/profile.d directory, do
[code]# echo '#!/bin/sh
export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")' > /etc/profile.d/99-javahome.sh && chmod +x /etc/profile.d/99-javahome.sh[/code]
Otherwise I'm not sure how to do this properly on Ubuntu, echo 'export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")' >> /etc/profile should work for a while, until some update might overwrite the file. Be sure to use two >'s here, which means append, while a single > would overwrite the existing contents of the file.
[editline]27th October 2013[/editline]
What the hell? Are other people getting spammed with Cloudfare Captchas too?
I had to fill one out for every post and edit made today :([/QUOTE]
After executing this I am getting this output
"bash: /etc/profile.d/99-javahome.sh: permission denied"
I put sudo then infront of it, but got the same result and 99-javahome.sh seems to to exist in that folder.
Also yeah cloudflare being a bitch
That'd be (sudo echo ...) && (chmod +x ...), so do sudo chmod +x ... again.
That #-sign indicates that the command is intended to be run from a root shell. $ is for 'normal' user shell.
Garrysmod context, but general non-garrysmod related question:
I've always stored arrays linked to players by encoding them to JSON and then have that as its own column in a table with the steamid as a identifier. I grab the weapons column and decode it to get the array. However, this defeats the purpose of databases, to store tables in tables, and thus I've always been trying to think out a better approach, and today I got an idea. The idea is to store every weapon and steamid in its own row. So if steamid steam_0:0:123 got 4 weapons, it'd be a total of 4 rows, with one weapon in each row.
Now, my question is before I start redesigning my weapons loading, is this a better and more optimised solution? Is there any way thats even better?
[QUOTE=ZeekyHBomb;42662004]That'd be (sudo echo ...) && (chmod +x ...), so do sudo chmod +x ... again.
That #-sign indicates that the command is intended to be run from a root shell. $ is for 'normal' user shell.[/QUOTE]
"# sudo echo '#!/bin/sh export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")' > /etc/profile.d/99-javahome.sh && sudo chmod +x /etc/profile.d/99-javahome.sh"
Returned nothing. 99-javahome.sh still not in /etc/profile.d but a bash_completion.sh.
Oh, it is [i]not[/i], I thought you sad it existed.
Try sudo su, this will put you in a root shell and then execute it (without sudo).
[QUOTE=ZeekyHBomb;42662174]Oh, it is [i]not[/i], I thought you sad it existed.
Try sudo su, this will put you in a root shell and then execute it (without sudo).[/QUOTE]
executing as non root "./99-javahome.sh" resulted in
"/bin/sh: 0: Can't open export JAVA_HOME=$(readlink -f /usr/bind/javac | sed "s:/bin/javac::")"
Should I try as root?
Nvm, same result.
Oh, keep that linebreak after #!/bin/sh.
It is looking like this now, as if I should input something
[IMG]http://img96.imageshack.us/img96/5422/ky9o.jpg[/IMG]
I also take it inthe .sh this should be in there
"export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")"
The "# " is not part of the command :P
The file should contain
[code]#!/bin/sh
export JAVA_HOME=...[/code]
Okay, did it, the .sh contains now this. Executed, no output. Guess it went through.
Do 'source /etc/profile' or re-login and then 'env|grep JAVA_HOME' should show the correct path. Further more Netbeans and Eclipse can hopefully not properly find the installed Java environment.
'env|grep JAVA_HOME' returned "JAVA_HOME=/usr/lib/jvm/java7-openjdk-amd64"
Eclipse: Working!
except one project, but that is probably some fuck up in the project settings.
On compile "Exception in thread "main" java.lang.UnsupportedClassVersionError: UI : Unsupported major.minor version 51.0"
Netbeans: Working!
Gotta say thanks for the help.
Why am i getting this error
Error 1 error C2061: syntax error : identifier 'CharacterObserver' : character.h
in character.h
[code]
#pragma once
#include "characterObserver.h"
//etc.[/code]
in characterObserver.h
[code]
#pragma once
#include "character.h"
// A concrete character observer class.
class CharacterObserver
{
public:
CharacterObserver(Character *obj);
void update(Character* obj);
};[/code]
the circular problem shouldn't exist due to the pragmas so wtf
#pragma once doesn't solve circular dependency problems, it limits the number of times a file is included to once per compilation unit. You need to forward declare in the header files to prevent the circular dependency.
[QUOTE=MakeR;42666404]#pragma once doesn't solve circular dependency problems, it limits the number of times a file is included to once per compilation unit. You need to forward declare in the header files to prevent the circular dependency.[/QUOTE]
Or just use header guards and avoid the problem
[QUOTE=Richy19;42666775]Or just use header guards and avoid the problem[/QUOTE]
Header guards don't fix circular dependencies either though.
[QUOTE=MakeR;42666804]Header guards don't fix circular dependencies either though.[/QUOTE]
Well, they prevent the problem of circular dependencies.
A file could include its self, however with header guesrds it would essentially be including a blank file as the code inside the ifndef wouldnt be included
[QUOTE=Richy19;42666996]Well, they prevent the problem of circular dependencies.
A file could include its self, however with header guesrds it would essentially be including a blank file as the code inside the ifndef wouldnt be included[/QUOTE]
Yes, but in order to fix twoski's problem one of the includes needs to be replaced with a forward declaration.
Whats the best way to determine if a pixel is blue and not just gray(or any other combination of rgb)?
At the moment im just doing:
[code]
long bluePixels = 0;
for(int y = 0; y < image.rows; y++)
{
for(int x = 0; x < image.cols; x++)
{
cv::Vec3b pixel = image.at<cv::Vec3b>(y,x);
int b = pixel[0], g = pixel[1], r = pixel[2];
if(b * 0.8 > r && b * 0.8 > g )
bluePixel++;
}
}
[/code]
so if 80% of the value of blue in a pixel is heigher than the amount of green and red, I determine its blue
Sorry, you need to Log In to post a reply to this thread.