Search Results

Search found 17209 results on 689 pages for 'input sanitization'.

Page 2/689 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • A quiz with results

    - by Keon Davies
    I'm currently working on programming a quiz withe results. I've tried this: <html> <body> <h1></h1> <form> <ol> <li> How much are you willing to spend on a phone per month?</li> <ul> <li><input type = "radio" name = "q1" id="q1_1"> £5-£10.</input></li> <li><input type = "radio" name = "q1" id="q1_2"> £10-£15.</input></li> <li><input type = "radio" name = "q1" id="q1_3"> £15-£20.</input></li> <li><input type = "radio" name = "q1" id="q1_4"> £20-£25.</input></li> <li><input type = "radio" name = "q1" id="q1_5"> £25-£30.</input></li> <li><input type = "radio" name = "q1" id="q1_6"> £30-£35.</input></li> <li><input type = "radio" name = "q1" id="q1_7"> £35-£40.</input></li> </ul> <li> Are you good with technology</li> <ul> <li><input type = "radio" name = "q2" id="q2_1"> Yes.</input></li> <li><input type = "radio" name = "q2" id="q2_2"> No.</input></li> </ul> <li> Are you looking for an easy to use phone</li> <ul> <li><input type = "radio" name = "q3" id="q3_1"> Yes.</input></li> <li><input type = "radio" name = "q3" id="q3_2"> No.</input></li> </ul> <li> Are you looking for a modern type of phone?</li> <ul> <li><input type = "radio" name = "q4" id="q4_1"> Yes.</input></li> <li><input type = "radio" name = "q4" id="q4_2"> No.</input></li> </ul> <li> How big do you want the phone to be?</li> <ul> <li><input type = "radio" name = "q5" id="q5_1"> Big.</input></li> <li><input type = "radio" name = "q5" id="q5_2"> Medium.</input></li> <li><input type = "radio" name = "q5" id="q5_3"> Small.</input></li> <li><input type = "radio" name = "q5" id="q5_4"> I don't really mind.</input></li> </ul> <li> Do you care about the colour of the phone?</li> <ul> <li><input type = "radio" name = "q6" id="q6_1"> Yes.</input></li> <li><input type = "radio" name = "q6" id="q6_2"> No.</input></li> </ul> <li> Have you ever owned a phone before?</li> <ul> <li><input type = "radio" name = "q7" id="q7_1"> Yes.</input></li> <li><input type = "radio" name = "q7" id="q7_2"> No.</input></li> </ul> <li> Do you want to be able to use the phone to get out of awkward social situations?</li> <ul> <li><input type = "radio" name = "q8" id="q8_1"> Yes.</input></li> <li><input type = "radio" name = "q8" id="q8_2"> No.</input></li> </ul> <li> Do you want to be able to access the app store and download apps using your phone?</li> <ul> <li><input type = "radio" name = "q9" id="q9_1"> Yes.</input></li> <li><input type = "radio" name = "q9" id="q9_2"> No.</input></li> </ul> <li> What happened to the last phone you owned?</li> <ul> <li><input type = "radio" name = "q10" id="q10_1"> I got bored of it.</input></li> <li><input type = "radio" name = "q10" id="q10_2"> It broke.</input></li> <li><input type = "radio" name = "q10" id="q10_3"> The contract ran out.</input></li> <li><input type = "radio" name = "q10" id="q10_4"> Other.</input></li> </ul> </ol> <input type = "button" value = "Submit" onclick="getResults()"> <input type = "reset" value = "Clear"></input> <textarea id="result">The right phone for you will be displayed here.</textarea> </html> <script> function getResults() { if (document.getElementById('q1_1').checked && document.getElementById('q2_1').checked && document.getElementById('q3_1').checked && document.getElementById('q4_1').checked && document.getElementById('q5_1').checked && document.getElementById('q6_1').checked && document.getElementById('q7_1').checked && document.getElementById('q8_1').checked && document.getElementById('q9_1').checked && document.getElementById('q10_1').checked ) { document.getElementById('result').innerHTML = 'Unfortunately, the iPhone is the right phone for you.'; } } </script> </body> But it's just too long winded. Is there any other ways I can design a quiz like this but without having to write a block of code for each radio button?

    Read the article

  • Getting input from keyboard

    - by SAMIR BHOGAYTA
    When you type on the keyboard the keystrokes go to a particular application, the active application. The active application receives the input from the keyboard. This means the application has input focus. There are two events for a key on a keyboard, when the key is pressed and when it is released. No it's not a single event as you might expect if you have no prior programming experience, in shooter games for example when you keep the forward key pressed (KeyDown) the player goes forward, and when it isn't pressed (KeyUp) the player stays put. The event that occurs when the key is pressed is called KeyPress. It occurs between KeyDown and KeyUp, and therefore acts similar to KeyDown. Similar to the way we handle OnPaint and other events we also handle the OnKeyDown event (because we want the event to occur when the key is pressed and not when it is released) by overriding it. Try the code below and test it. You will understand the role of each property. protected override void OnKeyDown(KeyEventArgs keyEvent) { // Gets the key code lblKeyCode.Text = "KeyCode: " + keyEvent.KeyCode.ToString(); // Gets the key data; recognizes combination of keys lblKeyData.Text = "KeyData: " + keyEvent.KeyData.ToString(); // Integer representation of KeyData lblKeyValue.Text = "KeyValue: " + keyEvent.KeyValue.ToString(); // Returns true if Alt is pressed lblAlt.Text = "Alt: " + keyEvent.Alt.ToString(); // Returns true if Ctrl is pressed lblCtrl.Text = "Ctrl: " + keyEvent.Control.ToString(); // Returns true if Shift is pressed lblShift.Text = "Shift: " + keyEvent.Shift.ToString(); } How do I find out when the user presses a specific key? As you probably imagine, this will be easily accomplished using 'if'. if (keyEvent.KeyCode == Keys.A) { MessageBox.Show("'A' was pressed."); } Probably most beginners would be tempted to do this: if (keyEvent.KeyCode == "A") .... which is definitely incorrect because we can't compare System.Windows.Forms.Keys to a string. Also note that in the example we are using 'keyEvent.KeyCode', that means that even if we have other shift keys pressed (Alt, Ctrl, Shift, Windows...) simultaneous with A, the if condition returns true because it doesn't recognize key combinations. If we want to ignore key combinations (Alt+A, Ctrl+Shift+A), etc. we need to use 'keyEvent.KeyData' of course: if (keyEvent.KeyData == Keys.A) { MessageBox.Show("'A', and only A, was pressed."); } When you right click on a file in Windows Explorer and you have the Shift key pressed you get the additional 'Open with...' item in the menu. This and many others are cases when you need to use the mouse button together with the keyboard. The following code will change the background color of the form only if the form is clicked while the Ctrl key on the keyboard is pressed. If the Ctrl key is unpressed and the form is clicked nothing happens. private void Form1_Click(object sender, System.EventArgs e) { Keys modKey = Control.ModifierKeys; if(modKey == Keys.Control) { this.BackColor = Color.Yellow; } } If you have further questions feel free to ask them and also check the following pages at MSDN: KeyUp Event KeyPress Event KeyDown Event

    Read the article

  • Handling keyboard and mouse input (Win API)

    - by Deluxe
    There is a number of ways to catch mouse or keyboard under Windows. So I tried some of them, but every of them has some advantages and drawbacks. I want to ask you: Which method do use? I've tried these: WM_KEYDOWN/WM_KEYUP - Main disadvantage is that, I can't distinguish between left and right-handed keys like ALT, CONTROL or SHIFT. GetKeyboardState - This solves problem of first method, but there is new one. When I get that the Right-ALT key is pressed, I also get that the Left-Control key is down. This behaviour happens only when using localized keyboard layout (Czech - CS). WM_INPUT (Raw Input) - This method also doesn't distinguish left and right-handed keys (if I can remember) and for mouse movement sometimes generates message with zero delta values of mouse position.

    Read the article

  • Input Signal Out of Range 1920x1080

    - by Zach
    I've recently installed Ubuntu 12.04 on my computer. Now, every time I boot and when I shut down, my monitor goes blank and says "Input Signal Out of Range - Change Setting to 1920x1080 60Hz." Once the computer gets to the login screen, it's okay again. This problem also happens when I try to open any 3d app. My graphics card is NVIDIA GEforce 6150 SE. I tried updating the drivers, but it broke everything and I had to reinstall Ubuntu. Any help?

    Read the article

  • Inputting cheat codes - hidden keyboard input

    - by Fibericon
    Okay, here's what I want to do - when the player is at the main menu, I want them to be able to type in cheat codes. That's the only place I want it to work. I don't want to give them a text box to type into. Rather, I want them to simply type in a word (let's say "cheat", just for simplicity sake) that activates the cheat code. I only need to capture keyboard input when the window is in focus. What can I do to accomplish this?

    Read the article

  • Input Handling and Game loop

    - by Bob Coder
    So, I intercept the WM_KEYDOWN and other messages. Thing is, my game can't/shouldn't react to these messages just yet, since my game might be currently drawing to the screen or in the middle of updating my game entities. So the idea is to keep a keyboardstate and mousestate, which is updated by the part of my code that intercepts the windows messages. These states just keep track of which keys/buttons are currently pressed. Then, at the start of my game's update function, I access these keyboard and mouse states and my game reacts to the user input. Now, which is the best way to access these states? I assume that windows messages can be sent whenever, so the keyboard/mouse states are constantly being edited. Accessing say a list of currently pressed keys in the keyboard state the same time another part of the code is editing the list would cause problems. Should I make a deep copy of a state and act on that? How would I deal with the garbage generated though, this would take place every frame.

    Read the article

  • Java keyboard input [on hold]

    - by dØd
    I'm trying to implement a input system that can detect whether a certain key was held or was only pressed briefly. So far I have this: KEY_INTERACTION_TRESHOLD = 400ms //inside a constructor shouldMeasure = true; @Override public void keyPressed(KeyEvent e) { if (shouldMeasure) { startTime = System.currentTimeMillis(); shouldMeasure = false; return; } System.out.println("Button is held down"); e.consume(); } @Override public void keyReleased(KeyEvent e) { if (System.currentTimeMillis() - startTime < KEY_INTERACTION_TRESHOLD) { System.out.println("Button was only pressed briefly"); } startTime = 0; shouldMeasure = true; e.consume(); } Now this works, but the problem is that there is this delay between when I press a key to hold and when the message 'Button is held down' gets displayed. I understand why this delay occurs (for example when you press and hold a letter there will be a similar delay between the first and the second letter printed out), but I would like to somehow avoid it. I'm using only the Java API.

    Read the article

  • Input/Output console window in XNA

    - by Will Bagley
    I am currently making a simple game in XNA but am at a point where testing various aspect gets a bit tricky, especially when you have to wait till you have 1000 score to see if your animation is playing correctly etc. Of course i could just edit the starting variable in the code before I launched but I have recently been interested in trying to implement a console style window which can print out values and take input to alter public variables during run-time. I am aware that VS has the immediate window which achieves a similar thing but i would prefer mine is an actual part of the game with the intention that the user may have limited access to it in the future. Some of the key things i have yet to find an answer to after looking around for a while are: how i would support free text entry how i would access variables during runtime how i would edit these variable I have also read about using a property grid from windows form aps (and partially reflection) which looked like it could simplify a lot of things but i am not sure how I would get that running inside my XNA game window or how i would get it to not look out of place (as the visual aspect of is seems to be aimed just for development time viewing). All in all I'm quite open to any suggestions on how to approach this task as currently I'm not sure where to start. Thanks in advance.

    Read the article

  • How to change SMP affinity of an IRQ on Ubuntu domU inside Xen XCP?

    - by Alexander Gladysh
    I'd like to change IRQ SMP affinity for reasons, outlined in this question: CPU0 is swamped with eth1 interrupts But I can't — I see Input/output error when I try to write to /proc/irq/*/smp_affinity. Please point me to the HOWTO on the matter. (A formal reference on /proc/irq/*/ would be cool as well.) Gory details: Note that this is a VM inside an Ubuntu-based Xen XCP host. $ uname -a Linux MYHOST 2.6.38-15-virtual #59-Ubuntu SMP Fri Apr 27 16:40:18 UTC 2012 i686 i686 i386 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 11.04 Release: 11.04 Codename: natty $ sudo cat /proc/irq/*/smp_affinity 01 01 01 01 01 80 80 80 80 80 80 40 40 40 40 40 40 20 20 20 20 20 20 10 10 10 10 10 10 08 08 08 08 08 08 04 04 04 04 04 04 02 02 02 02 02 02 01 01 01 01 01 01 Update. The error details: $ N=$(grep -c processor /proc/cpuinfo) $ echo $N 8 $ printf %x $((2**N-1)) ff $ printf %x $((2**N-1)) | sudo tee /proc/irq/*/smp_affinity fftee: /proc/irq/288/smp_affinity: Input/output error tee: /proc/irq/289/smp_affinity: Input/output error tee: /proc/irq/290/smp_affinity: Input/output error tee: /proc/irq/291/smp_affinity: Input/output error tee: /proc/irq/292/smp_affinity: Input/output error tee: /proc/irq/293/smp_affinity: Input/output error tee: /proc/irq/294/smp_affinity: Input/output error tee: /proc/irq/295/smp_affinity: Input/output error tee: /proc/irq/296/smp_affinity: Input/output error tee: /proc/irq/297/smp_affinity: Input/output error tee: /proc/irq/298/smp_affinity: Input/output error tee: /proc/irq/299/smp_affinity: Input/output error tee: /proc/irq/300/smp_affinity: Input/output error tee: /proc/irq/301/smp_affinity: Input/output error tee: /proc/irq/302/smp_affinity: Input/output error tee: /proc/irq/303/smp_affinity: Input/output error tee: /proc/irq/304/smp_affinity: Input/output error tee: /proc/irq/305/smp_affinity: Input/output error tee: /proc/irq/306/smp_affinity: Input/output error tee: /proc/irq/307/smp_affinity: Input/output error tee: /proc/irq/308/smp_affinity: Input/output error tee: /proc/irq/309/smp_affinity: Input/output error tee: /proc/irq/310/smp_affinity: Input/output error tee: /proc/irq/311/smp_affinity: Input/output error tee: /proc/irq/312/smp_affinity: Input/output error tee: /proc/irq/313/smp_affinity: Input/output error tee: /proc/irq/314/smp_affinity: Input/output error tee: /proc/irq/315/smp_affinity: Input/output error tee: /proc/irq/316/smp_affinity: Input/output error tee: /proc/irq/317/smp_affinity: Input/output error tee: /proc/irq/318/smp_affinity: Input/output error tee: /proc/irq/319/smp_affinity: Input/output error tee: /proc/irq/320/smp_affinity: Input/output error tee: /proc/irq/321/smp_affinity: Input/output error tee: /proc/irq/322/smp_affinity: Input/output error tee: /proc/irq/323/smp_affinity: Input/output error tee: /proc/irq/324/smp_affinity: Input/output error tee: /proc/irq/325/smp_affinity: Input/output error tee: /proc/irq/326/smp_affinity: Input/output error tee: /proc/irq/327/smp_affinity: Input/output error tee: /proc/irq/328/smp_affinity: Input/output error tee: /proc/irq/329/smp_affinity: Input/output error tee: /proc/irq/330/smp_affinity: Input/output error tee: /proc/irq/331/smp_affinity: Input/output error tee: /proc/irq/332/smp_affinity: Input/output error tee: /proc/irq/333/smp_affinity: Input/output error tee: /proc/irq/334/smp_affinity: Input/output error tee: /proc/irq/335/smp_affinity: Input/output error Update. irqbalance is running: $ sudo service irqbalance status irqbalance start/running, process 560

    Read the article

  • input / output error, drives randomly refusing to read / write

    - by ILMV
    I have an issue with one of our servers running Ubuntu 10.04, it is running BackupPC and collects backups from various machines / servers around the building. On the 8th minute (12:08, 12:18, 12:28 etc) the backups are transferred to an external hard drive, we have three and rotate one drive for another everyday. The problem we are having is we are randomly experiencing input / output errors, when this happens you cannot read / write to the drive, it hasn't unmounted so I can cd to the mount point /media/backup1. The drives are not faulty as it's happening on all of them, so I'm at a loss as to what the problem could be, here is an example of the many errors we get: gzip: stdout: Input/output error /var/lib/backuppc/backuppc_offline: line 47: /media/backup1/Tue/offline.log: Input/output error ls: cannot access /media/backup1/Tue/incr_1083_host1.something.co.uk.tar.gz: Input/output error ls: cannot access /media/backup1/Tue/incr_1088_host1.something.co.uk.tar.gz: Input/output error ls: cannot access /media/backup1/Tue/incr_1089_host1.something.co.uk.tar.gz: Input/output error ls: cannot access /media/backup1/Tue/incr_1090_host1.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 39: /media/backup1/Tue/offline.log: Input/output error /var/lib/backuppc/backuppc_offline: line 44: /media/backup1/Tue/offline.log: Input/output error /var/lib/backuppc/backuppc_offline: line 45: /media/backup1/Tue/incr_1090_host1.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 47: /media/backup1/Tue/offline.log: Input/output error ls: cannot access /media/backup1/Tue/incr_591_tech2.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 44: /media/backup1/Tue/offline.log: Input/output error /var/lib/backuppc/backuppc_offline: line 45: /media/backup1/Tue/incr_591_tech2.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 47: /media/backup1/Tue/offline.log: Input/output error ls: cannot access /media/backup1/Tue/incr_592_tech3.something.co.uk.tar.gz: Input/output error ls: cannot access /media/backup1/Tue/incr_593_tech3.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 44: /media/backup1/Tue/offline.log: Input/output error /var/lib/backuppc/backuppc_offline: line 45: /media/backup1/Tue/incr_593_tech3.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 47: /media/backup1/Tue/offline.log: Input/output error EDIT » Resolved So it turns out Quamis was right, even though I didn't think it was possible it was actually a problem with the drive. You see we have three drives all formatted to ext2, on two of them we were getting I/O errors frequently, I cam back to Quamis' answer and discovered the fsck command, so ran it against the problems drives: fsck /dev/sdb1 This found and fixed a load of problems on the drive, most probably caused by power outages / unsafe removal of drives etc, as the drives are in the xt2 format they aren't journalled and thus aren't protected against such issues. Drives are now working beautifully, thanks all! :D

    Read the article

  • No USB 04b4:0307 mike input after 10.04

    - by Papou
    I am using an USB phone that is in fact a so-called "sound card" based on the 04b4:0307 chip. In fact, I have two different phones using 04b4:0307 and in fact I have a sound USB key too. This, I believe, is the start of why they call 04b4:0307 "ubiquitous" (instead of oh four bee...). But not "eternal". The mike worked in Ubuntu 9.10 and 10.04 but not later ([email protected]). "not working" means that 04b4:0307 shows in Sound Preference but that its vu-meter is mute. I have posted the full lsusb and the result of tests in various systems here: http://www.papou.byethost9.com/tmp/1043601.html Note: Tests done on VirtualBox (thankfully). But UbuntUnity no longer works on VB, so I used the LinuxMint equivalent. ?hat's fate. I could not find any problem report close enough. What should be my next step? I believe the problem occurs in module snd-usb-audio. One thing I might try if I knew how is hacking a DEB with its 10.04's source. I can hack DEBs. Any hint welcome on how to make a DEB overriding a kernel packed module. I mean that the newly installed module should have precedence, be loaded instead, the module installed with the kernel. TIA !

    Read the article

  • Best ways to collect location-based user input

    - by user359650
    I'm working on a website where users will be able to register and provide information about their location. In order to prevent users from inputting incorrect data, we don't want users to provide free-text information but instead choose from predefined values as much as possible. We believe there are 2 ways of providing those values: use an API to an external service provider or create your own local database. APIs Some resources: - https://developers.facebook.com/docs/reference/ads-api/get-autocomplete-data/ - http://developer.yahoo.com/geo/geoplanet/ Pros: -accuracy and completeness of data. -no maintenance related to update of data as this it taken care of by API provider. -easier/faster to get started (no need to create local database, just implement API). Cons: -degradation of performance when availability issues with external API. -outage due to changes to the external API (until your code is updated to reflect those changes). -lock-in with external provider. Local database Some resources: - http://developer.yahoo.com/geo/geoplanet/data/ - http://www.maxmind.com/app/geolitecity - http://download.geonames.org/export/dump/ Pros: -no external dependency: improved stability and performance. Cons: -more work to get started (you need to create the database and code to interact with it). -risks of inaccurate/incomplete data, either initially or over time. -more maintenance work to keep database up to date. Assuming the depth information requested from users is as follows: -country: interested in value. also used to narrow down list of regions. -region (state in the US, county in the UK...): not interested in value itself, only used to narrow down list of cities. -city: interested in value (which can be used to work out related region should we need regional statistics). -address: interested in value although OPTIONAL. Which option (whether API or local database) would you choose? What tips you would give for the implementation? What other resources can you share?

    Read the article

  • Configuring keyboard input to eliminate unused diacritics

    - by David Cesarino
    I'd like to change the way diacritics work under Xubuntu. My problem My native language is pt-BR and my notebook has an american keyboard. Thus, I use ' and " followed by keys like u and c to achieve things like ú, ç and ü. It all works well. However, in the case of apostrophes and quotes, that creates a problem when I use ' followed by: letters that won't accept the acute accent ( ´ , ACUTE ACCENT -- 0x00B4) at all, like t; and letters that won't accept the acute in pt-BR, like r. In 1, ' with t does absolutely nothing. In 2, ' with r creates r (LATIN SMALL LETTER R WITH ACUTE -- 0x0155), which is used, afaik, for some eastern european languages like slovak. It isn't used in portuguese, just like ?, s, z, ?, ?, ?, n and all consonants (portuguese do not take diacritics in consonants). Question That said, is there a way to better support the portuguese-brazilian language using an american keyboard? It is very common here --- I actually prefer the american keyboard to our own, known as “ABNT”. Desired solution I'd like to deactivate unused diacritics, so case 2 would behave just like case 1. Additionally, if possible, I'd like case 1 to behave like it does under Windows. As an example, typing ' followed by t should write 't (acute followed by T) instead of doing nothing. About 2, in my humble opinion, doing nothing is counterproductive. I realize the behavior is reasonable according to logic ("there isn't t-acute, so please tell the computer to typeset apostrophe --- ', SPACE --- instead of acute). But from a human, practical point of view, I think it makes more sense (to me, at least). Additional comments I believe this also applies to spanish, french, italian and other western european latin languages. On the console (Ctrl+Alt+F?), case 1 is not a problem. I don't need to press space as apostrophes are automatically added. However, there, I'm unable to access cedilla (ç). Two completely different behaviors. If it's just a matter of customizing text config files (possibly creating a custom layout or whatever), I'd be glad to share my efforts. I just need guide on the "howto" part. Somehow Google only points me to the "enough" people (those who cope with the situation and think that it works "well enough"). And since I have definitely migrated to Linux/Xubuntu after years, I'd like to leave just as I like it (and I'm sure others as well). For example, if there is some kind of scripting or definition to tell the computer to do what I described, so be it.

    Read the article

  • Game Input mouse filtering

    - by aaron
    I'm having a problem with filtering mouse inputs, the method I am doing right know moves the cursor back to the center of the screen each frame. But I cant do this because it messes with other things. Does anyone know how to implement this with delta mouse movement. Here is the relevant code. void update() { static float oldX = 0; static float oldY = 0; static float walkSpeed = .05f; static float sensitivity = 0.002f;//mouse sensitivity static float smooth = 0.7f;//mouse smoothing (0.0 - 0.99) float w = ScreenResolution.x/2.0f; float h = ScreenResolution.y/2.0f; Vec2f scrc(w,h); Vec2f mpos(getMouseX(),getMouseY()); float x = scrc.x-mpos.x; float y = scrc.y-mpos.y; oldX = (oldX*smooth + x*(1.0-smooth)); oldY = (oldY*smooth + y*(1.0-smooth)); x = oldX * sensitivity; y = oldY * sensitivity; camera->rotate(Vec3f(y,0,0)); transform->setRotation(transform->getRotation()*Quaternionf::fromAxisAngle(0.0f,1.0f,0.0f,-x)); setMousePosition((int)scrc.x,(int)scrc.y);//THIS IS THE PROBLEM LINE HOW CAN I AVOID THIS .... }

    Read the article

  • Input of mouseclick not always registered in XNA Update method

    - by LordrAider
    I have a problem that not all inputs of my mouse events seem to be registered. The update logic is checking a 2 dimensional array of 10x10 . It's logic for a jewel matching game. So when i switch my jewel I can't click on another jewel for like half a second. I tested it with a click counter variable and it doesn't hit the debugger when i click the second time after the jewel switch. Only if I do the second click after waiting half a second longer. Could it be that the update logic is too heavy that while he is executing update logic my click is happening and he doesn't register it? What am I not seeing here :)? Or doing wrong. It is my first game. My function of the update methode looks like this. public void UpdateBoard() { MouseState currentMouseState; currentMouseState = Mouse.GetState(); if (currentMouseState.LeftButton == ButtonState.Pressed && prevMouseState.LeftButton != ButtonState.Pressed) { UpdatingLogic = true; // this.CheckDropJewels(currentMouseState); //this.CheckMatches(3); //this.RemoveMatches(); this.CheckForSwitch(currentMouseState); this.MarkJewel(currentMouseState); UpdatingLogic = false; //reIndexMissingJewels = true; reIndexSwitchedJewels = true; } prevMouseState = currentMouseState; this.ReIndex(); this.UpdateJewels(); }

    Read the article

  • Problems with input and suspend(separately)

    - by VaultPrisoner
    I'm still very new at Ubuntu/any other linux OS, so this might be an easy fix for most. I installed Ubuntu 14.04 a few days ago, it's dual-booted with Windows 8.1 and I'm using a Toshiba laptop. Whenever I suspend/close my computer, and then open it again, the front LEDs will light up telling me that it's running, but the screen will not do anything. I can hear the fan spinning, but it's almost like the screen doesn't power on like it should. Also, another problem I'm having, is that ~60% of the time, my trackpad and keyboard do not work at all, this starts as soon as Ubuntu boots up. To fix it, I just turn it off and back on until it works. My USB mouse does work no matter what though. Both problems are only present in Ubuntu and not windows 8.1.

    Read the article

  • User input and Automated input seperation

    - by tpaksu
    I have a mysql db and I have an automation script which modifies the data inside once a day. And, these columns may have changed by an user manually. What is the best approach to make the system only update the automated data, not the manually edited ones? I mean yes, flagging the cell which is manually edited is one way to do it, but I want to know if there's another way to accomplish this? Just curiosity.

    Read the article

  • User input and automated input separation

    - by tpaksu
    I have a MySQL database and an automation script which modifies the data inside once a day. And these columns may have changed by an user manually. What is the best approach to make the system only update the automated data, not the manually edited ones? I mean yes, flagging the cell which is manually edited is one way to do it, but I want to know if there's another way to accomplish this? Just curiosity. BTW, the question is about cell values, not rows.

    Read the article

  • how to bind input fields to a modal input fields AngularJS

    - by user3919120
    I have a form with a Customer and its properties populating input fields. If the user needs to change the Customer they click on the CustomerName input. A modal opens with a Customer List for them to choose from. There selection populates the input fields in that modal. I need to have that new information put in the already populated input fields. plunkr <div class="form-group"> <div class="input-group"> <span class="input-group-addon">C. Name</span> <input style="width:400px" ng-model="currentItem.CustomerName" class="form-control btn btn-default" ng-click="editJobCustomerModal()" /> </div> </div> <div class="form-group"> <div class="input-group"> <span class="input-group-addon">C. Address</span> <input style="width:390px" ng-model="currentItem.CustomerAddress" class="form-control" type="text"> </div> </div> Modal <div ng-controller="JobCtrl" data-backdrop="static" data-keyboard="false" class="modal fade" id="editJobCustomerModal" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true"> <div class=" modal-dialog modal-editJobCustomer"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title custom_align" id="Heading">Change Job Customer</h4> </div> <div class="modal-body"> <div class="container"> <form ng-submit="submitJob()" enctype="multipart/form-data"> <fieldset> <div class="col-md-8"> <!-- Prepended text--> <div class="form-group"> <div class="input-group"> <span class="input-group-addon">C. Name</span> <input style="width:400px" ng-model="selectedCustomer.CustomerName" class="form-control" type="text" /> </div> </div> <div class="form-group"> <div class="input-group"> <span class="input-group-addon">C. Address</span> <input style="width:390px" ng-model="selectedCustomer.CustomerAddress" class="form-control" type="text"> </div> </div> </fieldset><br /> <input style="float:right" class="btn btn-danger" ng-click="" type="button" value="Update"/> <input style="float:right; margin-right:20px" type="button" class="btn btn-primary" data-dismiss="modal" value="Cancel" /> </form> </div> </div> </div> </div> </div>

    Read the article

  • does php mysql_fetch_array works with html input box?

    - by dexter
    this is my entire PHP code: <?php if(empty($_POST['selid'])) {echo "no value selected"; } else { $con = mysql_connect("localhost","root",""); if(mysql_select_db("cdcol", $con)) { $sql= "SELECT * FROM products where Id = '$_POST[selid]'"; if($result=mysql_query($sql)) { echo "<form name=\"updaterow\" method=\"post\" action=\"dbtest.php\">"; while($row = mysql_fetch_array($result)) { echo "Id :<input type=\"text\" name=\"ppId\" value=".$row['Id']." READONLY></input></br>"; echo "Name :<input type=\"text\" name=\"pName\" value=".$row['Name']."></input></br>"; echo "Description :<input type=\"text\" name=\"pDesc\" value=".$row['Description']."></input></br>"; echo "Unit Price :<input type=\"text\" name=\"pUP\" value=".$row['UnitPrice']."></input></br>"; echo "<input type=\"hidden\" name=\"mode\" value=\"Update\"/>"; } echo "<input type=\"submit\" value=\"Update\">"; echo "</form>"; } else {echo "Query ERROR";} } } ?> PROBLEM here is, ....if the value i am getting from database using mysql_fetch_array($result) is like:(say Description is:) "my product" then; in input box it shows only "my" the word(or digit) after "SPACE"(ie blank space) doesn't get displayed? can input box like above can display the data with two or more words(separated by blank spaces)?

    Read the article

  • How to use wget with an input file and filenames

    - by Matt
    i have a text file that contains 10,000 url's with a unique number i want to save the file as. Each line has a 10 character code, then the URL of the image to retrieve. How can I make the input file use the first 10 characters as the wget filename? this is an example of the input file: input.txt x100083590http://image.allmusic.com/13/adg/cov200/drt200/t291/t29123q8m19.jpg b200149548http://ecx.images-amazon.com/images/I/41DoH%2BAWKEL.jpg z100151855http://image.allmusic.com/13/amg/cov200/dri400/i450/i45035hxdrb.jpg p400171646http://ecx.images-amazon.com/images/I/61cH4n34IhL.jpg wget -i input.txt would get the file but not with the preceding unique number. I want t29123q8m19.jpg (the first line) to be saved as x100083590.jpg If there is a better way to write out the input file, say with the URL first, then I can do that too, but I will never know the length of the first field. Right now the first 10 characters will always be what I want to save the wget image as. Edit This is being done in a windows environment.

    Read the article

  • How to use different input language for different active (application) windows?

    - by anvo
    I'm working under 12.04 and suppose I have a Firefox windows active (or in foreground) with English as input language and I need to type a document in other language using some text editor. With the text editor in foreground (or active) and the input language set to a non-English one, when I bring Firefox in foreground (or making it active) the input language remains set to the non-English and the language flag does not switch to English (as it would be expected, since I do not alter the language during the whole Firefox session). Because of this, I have to make extra moves and change the input language manually every time I switch from the text editor to Firefox and back to text editor. This was not happening with 10.04, and each application windows had the corresponding input language set to its default or previous session every time I was bringing it to the foreground! How will I make 12.04 to behave the same way?

    Read the article

  • The input doesn't recognize that I release the key?

    - by joapet99
    I'm creating a window (JOptionPane), in response to a collision. However, if the player is holding a key down when the window pops up, the input doesn't trigger a key release when the key is released. I don't think you can just check it with a isRelease function in the input, since the input is kind of corrupt. Can you help me? The way I check if the key is down: if(input.isKeyDown(Input.KEY_A)&& TestLevel.isFighting == false){ if(owner.canMoveLeft){ position.x -= speed * delta; } } I am not handling the key release by myself, but if I check if the key is down it should work. But it doesn't.

    Read the article

  • radio input replacement using jquery

    - by altvali
    It may seem a bit odd to ask this since there are several solutions out there but the fact is that all of them look pretty and none of what i've seem save the input value for form submission the right way. I'm looking for something that will replace all radio inputs with divs that get special classes when they are hovered or clicked, and an input type hidden for every group of radio inputs with the same name, hidden input that will be updated with the value corresponding to the div the user clicks on. Long sentence, i know. Here's what i've come up with: $('input:radio').each(function(){ if (this.style.display!='none') { var inputName = $(this).attr('name'); var inputValue = $(this).attr('value'); var isChecked = $(this).attr('checked'); if (!$('input:hidden[name='+inputName+']').length) // if the hidden input wasn't already created $(this).replaceWith('<div class="inputRadioButton" id="'+inputName+'X'+inputValue+'"></div><input type="hidden" name="'+inputName+'" value="'+inputValue+'" />'); else{ $(this).replaceWith('<div class="inputRadioButton" id="'+inputName+'X'+inputValue+'"></div>'); if (isChecked) $('input:hidden[name='+inputName+']').attr({'value':inputValue}); } //this bind doesn't work $("#"+inputName+"X"+inputValue).click(function(){ if($('input:hidden[name='+inputName+']').val()!=inputValue){ $('input:hidden[name='+inputName+']').attr({'value':inputValue}); $('div[id*='+inputName+'].inputRadioButton').removeClass('inputRadioButtonSelected'); } if (!$("#"+inputName+"X"+inputValue).hasClass('inputRadioButtonSelected')) $("#"+inputName+"X"+inputValue).addClass('inputRadioButtonSelected'); }); } }); Please tell me how to fix it. Thank you. Edit I've found the reason. It should normally work but some of my radio inputs generated by an e-commerce software had brackets in them (e.g. id[12] ) and jQuery was parsing that. The fix is adding var inputButton = document.getElementById(inputName+"X"+inputValue); before the bind and replacing $("#"+inputName+"X"+inputValue) with $(inputButton).

    Read the article

  • Android Webkit Input elements buggy with CSS3 translate3D

    - by Dansl
    I'm having a couple issues with the Input element in a Webkit Android App i'm developing. Testing on 2.X, but 3.x doesn't seem to have these issues... The app works by having separate Div's for each "page", and I'm using CSS3 translate3D to animate between the pages. Some of those pages include Input elements. When I tap on the input to gain focus, any of my "position:fixed" Div's will shift about 5px from the top, and 5px left. Now the kicker... it will eventually fix itself, and then never happen again when you tap on an input, its only that first time... My other problem, the Input elements are screwy with keyboards, for instance, spell corrections/autocomplete will not input text, and when using Swype Keyboard, you can't "swipe" the word, ONLY individual taps for each letter will input text into the Input element. I've read that a lot of these might be caused by CSS3 Translate3D. But, I've tried just about everything to fix these issues, and I've searched just about every site for a solution, but havent been able to find a fix, or find anyone else with this issue... Does anyone else have these issues, or know of a fix? (Possible solution??) Anyone know of a way to override the default behavior of Input elements in the webkit? I wonder if I can generate my own TextView and position it over these input fields...? Any help is greatly appreciated :)

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >