Show some effort please.
And whats wrong with not knowing the C++ functions, you are basically asking for C functions?
Show some effort please.
And whats wrong with not knowing the C++ functions, you are basically asking for C functions?
Sessions funnily only lasts for a session, That's how they work you can't change that.
You can't make a cookie non-deleteable. The user has control over his computer and that's it.
I usually make cookie with expiry of 10 years, and honestly I've never seen any one not reinstalling a browser or formatting their PC for 10 years anyway.
You could let the user download an authentication file and then have them upload it every time they log in, but uhm that would be annoying, having to find the file everytime.
You could store their IP and authenticate from that, but most regulars have a dynamic IP, which means they can allocate a new IP address or even be enforced to use a new IP address.
Imo just use a regular cookie with 100 years expiry.
Requires you to sign up with a phone service provider.
There are some easy ones where you pay just a few bucks and get code for integration.
Can't remember names.
I guess PHP has an option to automatically share sessions with www. domains aswell - are you using a non-default PHP.ini?
In DNS www. is just as much a subdomain as sub. would be :)
Just PCI video cards are expensive compared to their powerful PCIe x16 relatives.
And how would the driver handle two different cards btw?
Sure, what's your address? :) Or do you have a 3D printer, then I could just do a 3D scan and send it over?
Create a structure :
struct Player{ string name; int score; Player() : name(), score(){} };
Define an extraction operator, to extract into the struct :
std::istream& operator >>(std::istream& inFile, Player& p){ return inFile >> p.name >> p.score; }
now create a vector of players :
std::vector<Player> players;
now define a binary boolean function to be used with std::sort.
bool sortByScore(const Player& lhs, const Player& rhs){ return lhs.score < rhs.score; }
Now read in from the file into the vector of players :
std::vector<Player> players; ifstream inFile("filename.txt"); //error check Player tmp; while(inFile >> tmp){ players.push_back(tmp); } //read all from file std::sort(players.begin(),players.end(),sortByScore); //sort it //now do whatever with the sorted player vector
none of the above is compiled, just an idea to get you started.
Well that response was througough. Good job :)
You will have to iterate through all the values and sort them.
By googling for half a minute I found this excellent piece of code to sort numbers:
sortme should contain the numbers to sort, and size should contain the count of numbers.
const int size = 0;
int temp;
int sortme[size];
for(int j = size; j > 0; j--)
{
for(int i = 0; i < size; i++)
{
if(sortme[i] > sortme[j])
{
temp = sortme[i];
sortme[i] = sortme[j];
sortme[j] = temp;
}
}
}
Of course you will have to modify it a bit, so you can handle pairs of data (use std::map :)).
Whats up with the fuc.. uhm odd formatting?
Are you querying your results from an SQL database? Then it is easy to let MySQL return the values sorted.
After messing so much around for 20 hours total now, the code suddenly works.
I hate when it happens, but after the time I've spent helping it, I won't even consider reproducing the issue just to determine what was wrong.
- For now at least.
Thank you everyone who helped!
Guns are banned in Danmark.
We still hear, almost regularily I would say, about gunshooting in the news.
I don't really have an opinion on whether it is a good thing or not. I have neither been threatened by a gun or felt I would like to have a gun.
Please elaborate "freezes".
Infinite loop?
Segmentation fault?
It could simply be because your upload speed isn't as fast as you think.
What if you try a direct FTP transfer to him?
- This doesn't apply if you are on LAN ofcourse, then speed should never be low as 15KB/s.
What if you change chunk size?
Have you tried debugging? Write to a log file with time stamps to the microsecond, each time an important action occurs.
- Starting to read from file.
- Read from file complete.
- Starting transfer of chunk.
- Done transfering chunk.
- Received receipt from chunk.
- Starting to read from file.
etc. :) Those data could be useful to determine where the problem lies.
Yes it is a different domain - setup to show the same content though.
In DNS it is usually setup like this
my.domain.com A 000.000.000
www.my.domain.com CNAME my.domain.com
Unless you use virtual servers in Apache, theres not much more to it.
But in all correctness, it is different domains.
WWW. prefix is nothing special, just some old guy who thought the world would be better if we put www. in front of everything ;)
Smart! :)
Learnt something new today, not bad :D
Also he didn't assume tellg would get the number of bytes, but by subtracting the old tellg with the new, you get the number read.
Of course gcount() is preferable.
I started learning PHP 6 years ago and found myself perfect at PHP after just two years.
I used no books, but just gave myself tasks :)
"Would be awesome with a single line of code writing 10 lines of text huh?"
- Much time of googling and bugging around later:
for($i = 0; $i < 10; i++) echo "The baby is ", $i, " years old!<br />";
That is my preferred way of learning - gives a lot of practical experience :)
What about SDL? Never used it, but I've seen source code of fun games being just a few hundred lines using SDL :)
(that means simplicity)
Super :)
I don't know the solutions to this.
(this is a friendly and discrete bump because I think it is an interesting issue)
Oh so.
Then I'm not really sure of a good way to do that (as in non-hacky).
I believe the C way of reading returns a variable with bytes read, but that's no help in C++.
If you can't use the way I suggested (i editted the post, if you haven't noticed), then I'm not sure.
Guess you are looping until eof?
Every loop count an integer one up.
After the loop, you just multiply the count integer with the amount of bytes read per read call (probably 1? ;))
I'm not sure if it is better or worse, but I like this method much more:
std::ifstream stream;
...
stream.seekp(0, std::ios::end); // find eof
size_t size = stream.tellp(); // this actually provides the real size
stream.seekp(0); // find start
char* buffer = new char[size]; // allocate space
stream.read(buffer, size); // read it all in at once
stream.close(); // done :D
Note: seekp and tellp may be seekg and tellg.
Can't remember whether p or g version is for ifstream.
76MB? :O
Will it work in Linux?
Btw what a bad file share site you have used.
I clicked download three times, all three different ads.. -_-
Wtf is wrong with that browser game Metin2.. their ad is just a big DOWNLOAD button, nothing relating to themselves.
Lol and another ad "You have 10 seconds to click DOWNLOAD" - just tried clicking on that - BATTLEKNIGHT.dk LULZ
Back to the topic
Ahh I see why it's so huge now :D
Probably a very useful app! Guess it wont be no good in Linux.
Mind sending me the source code for that? ;)
Hello people,
I would like to add an extra monitor to my productivity box.
But back then I chose a motherboard without built-in graphics, so I only got the two ports provided by my graphics card.
I hope you could advice me how I could upgrade my PC to support an extra monitor?
I actually have a GeForce 9800GTX+ apart from my GeForce GTX 285, but I have only got a single PCI Express 2.0 x16 port.
How would the drivers like two cards even if I could put both of them in my motherboard?
Thank you for your thoughts! :)
My relevant hardware looks as follows:
Motherboard: Gigabyte GA-MA770-UD3
CPU: AMD Phenom II x4 810
RAM: Corsair DDR2 800MHz (maybe just 667MHz)
GPU: Nvidia GeForce GTX 285
Alternate GPU: Nvidia GeForce 9800GTX+
PSU: Corsair 650Watts
HDD: 2x 7200RPM's
A week ago I bought an expensive ATI HD5870 card. I started up the drivers in Linux, prepared for some bugs or whatever when using compiz - that was the issues I was aware of.
The performance was worse than with my old Nvidia card which today costs 1/6 of the ATI card! Horrible, just horrible. I tried it out for some time.
I was ready to ditch the card, but I made my way over to Windows. I got totally in love with this extreme performance. Crysis on full settings on 3840x1050 (just tested eyefinity).
I was almost ready to buy Windows just to keep the card, but when I made my way back to my Ubuntu installation, I of course chose to ditch the card. I've traded it for some cash + nVidia GTX 285.
My advice is: stay away from ATI on Linux. It is sad, really sad. I suppose that ATI will stand up and put whatever silly small amount of money into some developers and make proper support soon - now that Steam may be coming, opening gaming on Linux.
Possibly a Dell Studio 15?
Checked the Hardware Drivers menu?
If you do my high school graded writing assignment, then I will do your C++ program! Deal or no deal? ;)
Just joking, however as your first post you've made many mistakes.
You don't create a title saying "gimmeh the solution", you shortly describe your problem.
It is not considerably a problem that you for some reason have to create this program, a problem would be that the program you are making will not function.
So, you're using code tags. I almost starting complaining about that too, as most newcomers don't do that. Good job on that one.
You need to describe your problem.
Does the code compile and link properly?
No one will give you a working program, but just as a sidenote - how would we know what working program to create for you, if you haven't told what it should be capable of doing!? ;)
From what I can see, you should want to put std:: in from of cout so it reads std::cout << c;
, and #include <iostream>
instead of #include <iostream.h>
.
Good luck anyway.
Håhåh if that's his attempt to create a keylogger he will fail. I don't think he's doing that :)
This is not strange at all.
Those are two different domains, and sessions stick to one domain for security.
With cookies you can choose domains they will work on, so I'm sure you can look up in the PHP manual for sessions on how to get around having sessions for your second domain too.
Check the Apache logs..
Post them here if they don't make it clear, and you find nothing by googling the messages.
One thing is the choice, and I think you should only choose 64-bit if you need it for extra RAM, but that's my opinion - anyway, it does not really seem like he's choosing, he's more like switching FROM 64-bit, which I think is ridiculous :)
It doesn't seem hard to gain information about this on Google.
You need to download an exporter plugin for Blender, that will allow exporting to something called "Cal3D".
It seemed on me, that you would download that from the official Soya3D site or get it bundled.
Good luck.
You do not check for mysql errors, so that could be a reason you don't get errors :)
Get used to, after all mysql_query(), add as shown here:
mysql_query(...) or die(mysql_error());
If mysql_query returns false, which it will if something goes wrong, it will stop execution, clear page and print mysql_error() which contains information about the latest error.
I hope this helps you!
I tried to copy the
Vector3 Quaternion::operator *(const Vector3& v) const
{
Vector3 v2, v3;
Vector3 qvec(x, y, z);
v2 = qvec.crossProduct(v);
v3 = qvec.crossProduct(v2);
v2 *= (2.0f * w);
v3 *= 2.0f;
Vector3 pre_result = v + v2 + v3;
Vector3 result = pre_result;
return result;
}
to
void Quaternion::temp(const Vector3& in, Vector3& out) const
{
Vector3 v2, v3;
Vector3 qvec(x, y, z);
v2 = qvec.crossProduct(v);
v3 = qvec.crossProduct(v2);
v2 *= (2.0f * w);
v3 *= 2.0f;
Vector3 pre_result = v + v2 + v3;
Vector3 result = pre_result;
out = result;
}
By using the temp function the result is not corrupted, and out ends up with the correct value!
But why can't I pass the result through return? :S It buggers me so much. I could of course just use that temp method, but it makes a lot of calls to it needing several more lines of code.
Please suggest what could cause this!
Sorry for keeping you waiting so long, my test box was down.
I went ahead and creating copy constructor and assignment operators for Vector3 and Quaternion.
Vector3(const Vector3& v) : x(v.x), y(v.y), z(v.z)
{
}
inline Vector3& operator =(const Vector3& v)
{
x = v.x;
y = v.y;
z = v.z;
return *this;
}
and for Quaternion:
Quaternion(const Quaternion& q) : x(q.x), y(q.y), z(q.z), w(q.w)
{
}
inline Quaternion& operator= (const Quaternion& q)
{
x = q.x;
y = q.y;
z = q.z;
w = q.w;
return *this;
}
Did not change anything as it seems.
Do you want to create a program which takes in an english string and then outputs the same string in another language?
That can't be computed by C++, you would have to create a database of english word -> latin word.
Please specify your issue.
You mention a warning.. what warning!?
Please indent your code, it is unreadable in it's current state.
hello,
i recently joined the USACO's training gateway http://ace.delos.com/usacogate
I made the first problem(http://ace.delos.com/usacoprob2?a=n4y3olVXOJ9&S=ride) and it ran successfully in my dev-cpp compiler. but the online grader threw some runtime error. it was likeCompiling...
Compile: OKExecuting...
> Run 1: Execution error: Your program (`ride') exited with signal
#6 (abort()). The program ran for 0.000 CPU seconds before the
signal. It used 2928 KB of memory.------ Data for Run 1 ------
COMETQ
HVNGAT
----------------------------Your program printed data to stderr. Here is the data:
-------------------
terminate_called_after_throwing_an_instance_of_'std::ios_base::failure'
__what():__basic_ios::clear
-------------------
Test 1: SIGNAL 6 (0.000 secs, 2928 KB)debugging using cerr, i came to a conclusion that there is something with the "fin >>"
statement that is causing problem. my code is/* ID: nimeshg1 PROG: ride LANG: C++ */ #include<iostream> #include<fstream> #include<string> using namespace std; int main() { ofstream fout; fout.open("ride.out"); ifstream fin ("ride.in"); char comets[6], groupers[6]; int cno=1,gno=1; fin >> comets; fin >> groupers; for(int i=0;i<6;i++) { cno *= ((int)comets[i] - 64); if(comets[i]=='\0') i=6; } for(int i=0;i<6;i++) { gno *= ((int)groupers[i] - 64); if(comets[i]=='\0') i=6; } if(cno%47 == gno%47) fout<<"GO"<<endl; else fout<<"STAY"<<endl; return 0; }
Any suggestions?
After opening your streams (after ifstream fin(...)), try to add the following.
if(fin.failed() || fout.failed())
{
std::cerr << "Could not open streams! Exiting!" << std::endl;
return -1;
}
This will ensure that if the file failed to open or was read only or whatever, …
I'm using Linux daily and I am very annoyed that my games will not run and I can not use Photoshop.
GIMP is great and all, but misses speed, strength and pen tablet support.
Also, I returned my new ATI Eyefinity card worth $550 because the ATI drivers are shit and were missing out stuff that meant I couldn't even open up the game I am developing.
These things make me so angry. But I don't blame Linux at least, I blame Microsoft for "buying" the game industry and Adobe for being lazy and surely paid by Microsoft.
When people ask me: "Will Linux replace what I currently have?", I say no. It won't run your games properly, and not at all without alot of tweaking.
Then they reply to me: "Linux is shit then, why do you use it!?". I answer that Linux is the best choice for anything it is allowed to run.
I agree, that there should be no need to switch to 32 bits.
If you wanted to so anyway, you will have to obtain a 32 bits version of Windows and install it instead of your current installation.
I've seen it is possible to convert a 32 bit license to 64 bit, but I don't think it goes the other way around.
Beyond that you cannot change 64 to 32 as the motherboard is built with '64' wires around it instead of 32. (oversimplified version of the truth!)
You lost me here.
Any 64 bit computer I've come accross (including three of my own) are all fully capable of running both 32- and 64bit OS'es.
Furthermore I have never seen a motherboard specific for either x86 or x64.
It is the CPU that is either 32 bits or 64 bits, and a 64 bits OS won't install on a 32 bits CPU but the other way around shouldn't be an issue.
Yes, there.
But if you put it in your main folder, then the rewrite rule matches /testredirect.php aswell, won't it ?;)
I don't quite understand why for() would be better than while() in this case.
Anyway, here's an example:
$results = mysql_num_rows($result);
for($sloop = 0; $sloop < $results; $sloop++)
{
$row = mysql_fetch_array($result);
// do more stuff
}
.. I just thought you maybe wanted to loop x times whether theres more or less results.
Then try
for($sloop = 0; $sloop < 2; $sloop++)
{
$row = mysql_fetch_array($result);
if($row === false)
{
$doortype = "Unknown";
}else
{
$doortype = $row['DoorTyp'];
}
// echo stuff <td>$doortype</td>
}
Hope this helps you :) Let me know!
Does this .htaccess apply to the root of your domain also?
Maybe try a full URL.
What do you expect to be in place of $_POST[aspirant_photo]?
Does it just contain an URL? The mail client will not automatically parse an image url to an image.
In this case you will have to send HTML headers, and use <img> tags to show the image.
You can use the WinAPI to create a socket connection to the server and send headers to apache, requesting the file.
Use Winsocket2 for this.
I completely agree with Nick Evan.
Use Filestream and Stringstream.
(f)scanf, atoi and relatives are C, not C++.
Take a look at this code.
I'm not sure if it will work, as I never use tabs, but I suppose \t should do it:
std::string line;
// get a line from the file
std::string::size_type whitespace = line.find('\t');
if(whitespace == std::string::npos)
; // quit or something.. we expect a whitespace
std::string name = line.substr(0, whitespace); // the first part
std::string::size_type min = line.find("m", whitespace); // search for m after whitespace
if(min == std::string::npos)
; // quit or something, we expected m
std::string minutes = line.substr(whitespace+1, min-(whitespace+1)); // get content from after whitespace, till m.
I wouldn't say you would actually have to modify fraps.
Can't be too hard to make your own lite screen recorder app?
I don't know, have never tried! You should be able to read in data from the file fraps output to - that could be interesting :P
Otherwise, you don't have to do a live stream, maybe just a screenshot every 10 seconds.
I'm using dev-c++ 4.9.9.2 version and allegro 4.4.0.1 version.
I created a console project and done what DTV said in http://www.daniweb.com/forums/thread248782.html. But i cant found liballeg.a so i add liballeg.dll.a.
Then i try some example from http://www.gillius.org/allegtut/index.htm but there is problem of alleg_init undeclared error raised.
I had try other example too (http://www.cppgameprogramming.com/cgi/nav.cgi?page=pong)
But it comes out another errors which are:
[Linker error] undefined reference to `_imp__screen'
[Linker error] undefined reference to `rest'
[Linker error] undefined reference to `_imp__screen'
and etc.So anyone can helps me to use allegro?
This exact issue is discussed on the official Allegro forums (I wouldn't know until I googled your error and picked the first result).