Search Results

Search found 7 results on 1 pages for 'dygi'.

Page 1/1 | 1 

  • input type text and onKeyDown not working under IE

    - by dygi
    Hi there. I am writing a WWW application, it has to run under IE. I have the problem with the code that runs under FF, but i can't get it running under IE. // JS code function test() { if (window.event.keyCpde == 13) window.location.href.ssign("myPage.php"); } I've tried some similar ways around window.location and location.href, also document.location. I've read that IE has problems with that, so i ask for a solution. The goal is, that page reloads after typing in some text into <input type='text' name='item_code' onKeyDown='test()'> and click enter. So the result is similar to pressing submit type button below the text input. Within IE it reloads the same page and nothing happens. In FF it correctly works.

    Read the article

  • How to print a number with a space as thousand separator?

    - by dygi
    I've got a simple class Currency with overloaded operator<<. I don't know how can i separate the number with spaces every 3 digits, so it looks like: "1 234 567 ISK". #include <cstdlib> #include <iostream> using namespace std; class Currency { int val; char curr[4]; public: Currency(int _val, const char * _curr) { val = _val; strcpy(curr, _curr); } friend ostream & operator<< (ostream & out, const Currency & c); }; ostream & operator<< (ostream & out, const Currency & c) { out << c.val<< " " << c.curr; return out; } int main(int argc, char *argv[]) { Currency c(2354123, "ISK"); cout << c; } What interests me, is somehow the easiest solution for this particular situation.

    Read the article

  • Creating an URL without global variables

    - by dygi
    I have a code like this below, which gives me a $link that equals to: http://mydomain.com/image/photo.JPG if (!empty($_SESSION['item'][$i])) { $path = dirname(__FILE__).'/image/'.basename($_SESSION['item'][$i]); if (move_uploaded_file($_SESSION['item'][$i], $path)) global $url; if ( $url ) { $link = $url.'/image/'.basename($_SESSION['item'][$i]); echo "<td><img src='" . $link . "' width='50' height='50' /></td>"; } } I wonder, how should I properly ommit using global variable here to achieve the same result.

    Read the article

  • compiling a program to run in DOS mode

    - by dygi
    I write a simple program, to run in DOS mode. Everything works under emulated console in Win XP / Vista / Seven, but not in DOS. The error says: this program caonnot be run in DOS mode. I wonder is that a problem with compiler flags or something bigger. For programming i use Code::Blocks v 8.02 with such settings for compilation: -Wall -W -pedantic -pedantic-errors in Project \ Build options \ Compiler settings I've tried a clean DOS mode, booting from cd, and also setting up DOS in Virtual Machine. The same error appears. Should i turn on some more compiler flags ? Some specific 386 / 486 optimizations ? UPDATE Ok, i've downloaded, installed and configured DJGPP. Even resolved some problems with libs and includes. Still have two questions. 1) i can't compile a code, which calls _strdate and _strtime, i've double checked the includes, as MSDN says it needs time.h, but still error says: _strdate was not declared in this scope, i even tried to add std::_strdate, but then i have 4, not 2 errors sazing the same 2) the 2nd code is about gotoxy, it looks like that: #include <windows.h> void gotoxy(int x, int y) { COORD position; position.X = x; position.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), position); } error says there is no windows.h, so i've put it in place, but then there are many more errors saying some is missing from windows.h, I SUPPOSE it won't work because this functions is strictly for windows right ? is there any way to write similar gotoxy for DOS ? UPDATE2 1) solved using time(); instead of _strdate(); and _strtime(); here's the code time_t rawtime; struct tm * timeinfo; char buffer [20]; time ( &rawtime ); timeinfo = localtime ( &rawtime ); strftime (buffer,80,"%Y.%m.%d %H:%M:%S\0",timeinfo); string myTime(buffer); It now compiles under DJGPP. UPDATE3 Still need to solve a code using gotoxy - replaced it with some other code that compiles (under DJGPP). Thank You all for help. Just learnt some new things about compiling (flags, old IDE's like DJGPP, OpenWatcom) and refreshed memories setting DOS to work :--)

    Read the article

  • Store database, good pattern for simultaneous access

    - by dygi
    I am kinda new to database designing so i ask for some advices or some kind of a good pattern. The situation is that, there is one database, few tables and many users. How should i design the database, or / and which types of queries should i use, to make it work, if users can interact with the database simultaneously? I mean, they have access to and can change the same set of data. I was thinking about transactions, but I am not sure, if that is the right / good / the only solution. I will appreciate some google keywords too.

    Read the article

  • how properly remove item from list

    - by dygi
    // tmpClientList is List<Client> type if (txtboxClientName.Text != "") foreach (Client cli in tmpClientList) if (cli.Name != txtboxClientName.Text) tmpClientList.Remove(cli); Error: "Collection was modified; enumeration operation may not execute." How can i remove items from the list, in some simple way, without saving indexes of these items in another list or array, and removing them in another place in the code. Tried also RemoveAt(index) but it's exactly the same situation, modifying when loop runs.

    Read the article

1