Search Results

Search found 22204 results on 889 pages for 'input devices'.

Page 14/889 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Android Reading from an Input stream efficiently

    - by RenegadeAndy
    Hey, I am making an HTTP get request to a website for an android application I am making. I am using a DefaultHttpClient and using HttpGet to issue the request. I get the entity response and from this obtain an InputStream object for getting the html of the page. I then cycle through the reply doing as follows: BufferedReader r = new BufferedReader(new InputStreamReader(inputStream)); String x = ""; x = r.readLine(); String total = ""; while(x!= null){ total += x; x = r.readLine(); } However this is horrendously slow. Is this inefficient? I'm not loading a big web page - www.cokezone.co.uk so the file size is not big. Is there a better way to do this? Thanks Andy

    Read the article

  • Threading models when talking to hardware devices

    - by Fuzz
    When writing an interface to hardware over a communication bus, communications timing can sometimes be critical to the operation of a device. As such, it is common for developers to spin up new threads to handle communications. It can also be a terrible idea to have a whole bunch of threads in your system, an in the case that you have multiple hardware devices you may have many many threads that are out of control of the main application. Certainly it can be common to have two threads per device, one for reading and one for writing. I am trying to determine the pros and cons of the two different models I can think of, and would love the help of the Programmers community. Each device instance gets handles it's own threads (or shares a thread for a communication device). A thread may exist for writing, and one for reading. Requested writes to a device from the API are buffered and worked on by the writer thread. The read thread exists in the case of blocking communications, and uses call backs to pass read data to the application. Timing of communications can be handled by the communications thread. Devices aren't given their own threads. Instead read and write requests are queued/buffered. The application then calls a "DoWork" function on the interface and allows all read and writes to take place and fire their callbacks. Timing is handled by the application, and the driver can request to be called at a given specific frequency. Pros for Item 1 include finer grain control of timing at the communication level at the expense of having control of whats going on at the higher level application level (which for a real time system, can be terrible). Pros for Item 2 include better control over the timing of the entire system for the application, at the expense of allowing each driver to handle it's own business. If anyone has experience with these scenarios, I'd love to hear some ideas on the approaches used.

    Read the article

  • Handling Input with Zend Framework outside MVC

    - by Pekka
    In a classic Zend Framework MVC setup, there seems to be access to a generic _request object from within the model/view/controller instance as outlined here: $this->_request->getPost('variablename'); is this request object somehow available in a non-MVC setup as well? If yes: how would I initialize and access it?

    Read the article

  • Data Synchronization in mobile apps - multiple devices, multiple users

    - by ProgrammerNewbie
    I'm looking into building my first mobile app. One of the core features of the application is that multiple devices/users will have access to the same data -- and all of them will have CRUD rights. I believe the architecture should involve a central server where all the data is stored. The devices will use an API to interact with the server to perform its data operations (e.g. adding a record, editing a record, deleting a record). I imagine a scenario where synchronizing the data will become a problem. Assume the application should work when it is not connected to the Internet, and thus cannot communicate with this central server. So: User A is offline and edits record #100 User B is offline and edits record #100 User C is offline and deletes record #100 User C goes online (presumably, record #100 should get deleted on the server) User A and B goes online, but the records they edited no longer exist All sorts of scenarios similar to the above can come up. How is this generally handled? I plan to use MySQL, but am wondering if it's not appropriate for such a problem.

    Read the article

  • How to stop input in Perl?

    - by user1472747
    First time poster and part time perl noobie. I'm making a reflex game. Here's the output - __________________________________________________________________________ Reflex game initiated. Press ENTER to begin the game, and then press ENTER after the asterisks are printed to measure your reflexes!. ************************* Your result: 0.285606 seconds. logout [Process completed] __________________________________________________________________________ There's one small problem though - There's 0-10 seconds (based on a random variable) after you press enter to start the game and before the stars are printed. During that time, if the player presses ENTER, it's logged as their reflex time. So I need a way to stop my code from reading their ENTER button before the stars are printed. The code - #!/usr/bin/perl use Time::HiRes qw(sleep); use Time::HiRes qw(gettimeofday); #random delay variable $random_number = rand(); print "Reflex game initiated. Press ENTER to begin the game, and then press ENTER after the asterisks are printed to measure your reflexes!.\n"; #begin button $begin = <>; #waits x milliseconds sleep(10*$random_number); #pre-game $start = [ Time::HiRes::gettimeofday() ]; print "\n****************************\n"; #user presses enter $stop = <>; #post game $elapsed = Time::HiRes::tv_interval($start); #delay time print print "Your result: ".$elapsed." seconds.\n";

    Read the article

  • How to use Scanner to accept only valid int as input

    - by John
    I'm trying to make a small program more robust and I need some help with that. Scanner kb = new Scanner(System.in); int num1; int num2 = 0; System.out.print("Enter number 1: "); num1 = kb.nextInt(); while(num2<num1) { System.out.print("Enter number 2: "); num2 = kb.nextInt(); } Number 2 has to be greater than number 1 Also I want the program to automatically check and ignore if the user enters a character instead of a number. Because right now when a user enters for example r instead of a number the program just exits.

    Read the article

  • Struts logic:iterate input field

    - by camilos
    I currently have the following code and the data is displayed fine. <logic:iterate name="myList" id="product" indexId="iteration" type="com.mycompany.MyBean"> <tr> <td> <bean:write name="product" property="weight"/> </td> <td> <bean:write name="product" property="sku"/> </td> <td> <bean:write name="product" property="quantity"/> </td> </tr> </logic:iterate> But now I need to make the "quantity" part modifiable. The user should be able to update that field, press submit and when its sent to the server, "myList" should automatically update with the new quantities. I've tried searching for help on this but all I keep finding is examples on how to display data only, not modify it. Any help would be appreciated.

    Read the article

  • while loop / string input not working java

    - by Mikeecb
    I have looked online and all of the tutorials / questions have pointed me to this. I can't see why this isn't working. Any help would be much appreciated. Thanks import java.util.*; public class test { static Scanner userInput = new Scanner(System.in); public static void main(String[] args) { String textEntered = userInput.next(); if (textEntered == "hello") { System.out.println("Hello to you too!"); } } } I enter "hello" but nothing is printed. Also I have tried next() and nextLine();

    Read the article

  • Input Sanitation Best Practices

    - by Adam Driscoll
    Our team has recently been working on a logic and data layer for our database. We were not approved to utilize Entity or Linq to SQL for the data layer. It was primarily built by hand. A lot of the SQL is auto generated. An obvious down fall of this is the need to sanitize inputs prior to retrieval and insertion. What are the best methods for doing this? Searching for terms like insert, delete, etc seems like a poor way to accomplish this. Is there a better alternative?

    Read the article

  • jquery how to set input focus on control

    - by user516883
    Hey I am very new to jquery using asp.net, and I was wondering how to set focus on a textbox using jquery. I have my script in my HeaderContent but it is not working, no focus on load. And yes I know this can be done on the server side as well, but I am just trying to get better and more familiar with jquery. Thanks. <script type="text/javascript"> $(document).ready(function () { $("#MainContent_LoginUser_UserName").focus(); }); </script>

    Read the article

  • How can I change my language/keyboard input language system-wide temporarily?

    - by Adam Lynch
    I currently have two languages set up; English and Dutch. The only difference is in keyboard input. The Dutch one uses the French/Belgian AZERTY layout and the English one uses the Irish/English QWERTY layout (@ = Shift+'). When a Belgian colleague needs to use my computer, I switch the language to NL (Dutch) (therefore the input to AZERTY) using the language bar, but it seems to be application-specific. (I.e: After changing the input to AZERTY for my colleague, if he then clicks on another program it switches back to QWERTY for that program). Is there a way I can quickly switch between the two comprehensively yet temporarily?

    Read the article

  • Overriding disabled input and textarea with CSS

    - by igluratds
    Hi, Im trying to override the grey text of a disabled input and textarea. At the moment Im only really concerned with it working in Webkit and Mozilla. At the moment Im currently using every trick in the book that I know of: input[@disabled=true], input[@disabled], button[disabled]:active, button[disabled], input[type="reset"][disabled]:active, input[type="reset"][disabled], input[type="button"][disabled]:active, input[type="button"][disabled], select[disabled] > input[type="button"], select[disabled] > input[type="button"]:active, input[type="submit"][disabled]:active, input[type="submit"][disabled],input[disabled="disabled"], input[disabled] { color: black !important; } Sure it does change the colour if I change it to something else, however when I choose black it is still greyed out a bit. Any ideas? I am using Ext JS if I can use that to manipulate it. Thanks.

    Read the article

  • Setting up Ubuntu Server as a Router with DHCPD and 3 Ethernet devices

    - by cengbrecht
    My configuration: Ubuntu 12.04 DHCP3-server eth0, eth1, eth2 Edit: removed br0&br1 eth0 is the external connection eth1 & eth2 are the internal network eth1 and eth2 are supposed to be seperate networks of student/teachers respectivly. What I would like to have is the internet from external device bridged to device 1 and 2, with the DHCP server controlling the two internal devices. Its already working with DHCP, the part I am stuck on is bridging for internet. I have setup a script that I found here: Router With the original script he linked here: Ubuntu Router Guide echo -e "\n\nLoading simple rc.firewall-iptables version $FWVER..\n" IPTABLES=/sbin/iptables #IPTABLES=/usr/local/sbin/iptables DEPMOD=/sbin/depmod MODPROBE=/sbin/modprobe EXTIF="eth0" INTIF="eth1" INTIF2="eth2" echo " External Interface: $EXTIF" echo " Internal Interface: $INTIF" echo " Internal Interface: $INTIF2" EXTIP=`ifconfig $EXTIF | grep 'inet addr:' | sed 's#.*inet addr\:\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*#\1#g'` echo " External IP: $EXTIP" #====================================================================== #== No editing beyond this line is required for initial MASQ testing == The rest of the script below this is as is. I can get ip from the eth1 & eth2 devices, and my computer can see them, and them it, however, internet is not being passed through. If you need more information please just let me know. EDIT: So I had a 255.255.254.0 network, I believe that was causing the issue. Not sure if it will matter on the second card, I will test later. After changing the subnet to 255.255.255.0 the pings will pass through, however, I cannot get DNS requests to pass? My new Config for Firewall Rules # /etc/iptables.up.rules # Generated by iptables-save v1.4.12 on Wed Nov 28 19:43:28 2012 *mangle :PREROUTING ACCEPT [39:4283] :INPUT ACCEPT [39:4283] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [12:4884] :POSTROUTING ACCEPT [13:5145] COMMIT # Completed on Wed Nov 28 19:43:28 2012 # Generated by iptables-save v1.4.12 on Wed Nov 28 19:43:28 2012 *filter :FORWARD ACCEPT [0:0] :INPUT ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A FORWARD -j LOG -A FORWARD -m state -i eth1 -o eth0 --state NEW,ESTABLISHED,RELATED -j ACCEPT -A FORWARD -m state -i eth2 -o eth0 --state NEW,ESTABLISHED,RELATED -j ACCEPT -A FORWARD -m state -i eth0 -o eth1 --state NEW,ESTABLISHED,RELATED -j ACCEPT -A FORWARD -m state -i eth0 -o eth2 --state NEW,ESTABLISHED,RELATED -j ACCEPT COMMIT # Completed on Wed Nov 28 19:43:28 2012 # Generated by iptables-save v1.4.12 on Wed Nov 28 19:43:28 2012 *nat :INPUT ACCEPT [0:0] :PREROUTING ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] -A POSTROUTING -o eth0 -j MASQUERADE -A POSTROUTING -o eth0 -j SNAT --to-source 192.168.1.25 COMMIT # Completed on Wed Nov 28 19:43:28 2012 Not sure what else you may need, but I am using Webmin to control the server(Needed for the operators on site to know how to use it.) If you could explain it as standard CLI commands, or edits to this file directly then we should be ok. :) And thanks again Erik, I do believe your edits did help.

    Read the article

  • jQuery: how to find first visible input/select/textarea excluding buttons?

    - by Artem
    I tried $(":input:not(input[type=button],input[type=submit],button):visible:first") but it doesn't find anything. What is my mistake? UPD: I execute this on $(document).load() <script type="text/javascript"> $(window).load(function () { var aspForm = $("form#aspnetForm"); var firstInput = $(":input:not(input[type=button],input[type=submit],button):visible:first", aspForm); firstInput.focus(); }); </script> and in the debug I can see that firstInput is empty. UPD2: I'm in ASP.NET page running under Sharepoint. I've found so far that for some elements it does find them (for fixed ones) and for some don't. :(

    Read the article

  • No output devices in sound settings - therefore, no sound

    - by Kev Quirk
    I've just performed a fresh install of Ubuntu 13.10, and I've noticed that sound isn't working. When I go to sound settings, I can see that there is absolutely no sound devices detected. However, I do have my speakers installed and turned on, plus my machine has an internal speaker as well. I've seen other posts where people mention that they have "Dummy device" listed, this isn't the problem here, the output device section is completely blank. Any help is appreciated. Thanks, Kev

    Read the article

  • How To Safely Eject Your USB Devices From the Desktop Context Menu

    - by Taylor Gibb
    If you are one of those people who don’t safely remove their USB Devices just because you’re lazy, here’s a neat trick to do it from the context menu on your desktop. Even if you are not lazy and just forget, the icon will serve as a mental reminder. So let’s take a look. How to Run Android Apps on Your Desktop the Easy Way HTG Explains: Do You Really Need to Defrag Your PC? Use Amazon’s Barcode Scanner to Easily Buy Anything from Your Phone

    Read the article

  • Give write access to USB and Serial devices automatically

    - by Saeid87
    I am working with some USB and Serial micro-controllers. Everytime I plug a device I have to do the following command to give it write access, and also my password: sudo chmod 666 /dev/ttyUSB0 Can I set my Ubuntu to automatically give write access to pluged in devices? If not, how can I make a batch file that I can easily give the access to port I want for example if I run the following command it does the job: giveaccess -usb0

    Read the article

  • Icons of external devices not appearing on Desktop in 12.04

    - by harisibrahimkv
    In 10.04 and all, when a pen drive or as for that matter, when any external devices are connected, their icons are shown on the desktop and nautilus pops up automatically too. But in my 12.04 Gnome classic, when I connect an external device, nothing happens. I have to open nautilus manually and then click on the icon in the left panel to access the folder of the device. Is there any way to rectify this and restore the old trait as in 10.04?

    Read the article

  • Share USB devices between 32 bit and 64 bit systems

    - by Sreejith S
    The latest version of USBDeviceShare, the USB over IP software, supports sharing USB devices between 32 bit and 64 bit editions of Windows. A USB device plugged in to a 64 bit PC running 64 bit version of Windows can be shared and remotely accessed from a 32 bit PC and vice versa. Download USBDeviceShare USB over Network software from http://www.sysnucleus.com/usbshare/usbshare_download.html Keywords : USB over Ethernet, USB Server, Remote USB Access, Share USB

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >