Search Results

Search found 19928 results on 798 pages for 'multiple constructors'.

Page 9/798 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Connecting Android device to multiple Bluetooth serial embedded peers

    - by TacB0sS
    I'm trying to find a solution for this setup: I have a single Android device, which I would like to connect to multiple serial embedded devices... And here is the thing, using the "Normal" way to retrieve the Bluetooth socket, doesn't work on all devices, and while it does, I can connect to multiple devices, and send and receive data to and from multiple devices. public final synchronized void connect() throws ConnectionException { if (socket != null) throw new IllegalStateException("Error socket is not null!!"); connecting = true; lastException = null; lastPacket = null; lastHeartBeatReceivedAt = 0; log.setLength(0); try { socket = fetchBT_Socket_Normal(); connectToSocket(socket); listenForIncomingSPP_Packets(); connecting = false; return; } catch (Exception e) { socket = null; logError(e); } try { socket = fetchBT_Socket_Workaround(); connectToSocket(socket); listenForIncomingSPP_Packets(); connecting = false; return; } catch (Exception e) { socket = null; logError(e); } connecting = false; if (socket == null) throw new ConnectionException("Error creating RFcomm socket for" + this); } private BluetoothSocket fetchBT_Socket_Normal() throws Exception { /* The getType() is a hex 0xXXXX value agreed between peers --- this is the key (in my case) to multiple connections in the "Normal" way */ String uuid = getType() + "1101-0000-1000-8000-00805F9B34FB"; try { logDebug("Fetching BT RFcomm Socket standard for UUID: " + uuid + "..."); socket = btDevice.createRfcommSocketToServiceRecord(UUID.fromString(uuid)); return socket; } catch (Exception e) { logError(e); throw e; } } private BluetoothSocket fetchBT_Socket_Workaround() throws Exception { Method m; int connectionIndex = 1; try { logDebug("Fetching BT RFcomm Socket workaround index " + connectionIndex + "..."); m = btDevice.getClass().getMethod("createRfcommSocket", new Class[]{int.class}); socket = (BluetoothSocket) m.invoke(btDevice, connectionIndex); return socket; } catch (Exception e1) { logError(e1); throw e1; } } private void connectToSocket(BluetoothSocket socket) throws ConnectionException { try { socket.connect(); } catch (IOException e) { try { socket.close(); } catch (IOException e1) { logError("Error while closing socket", e1); } finally { socket = null; } throw new ConnectionException("Error connecting to socket with" + this, e); } } And here is the thing, while on phones which the "Normal" way doesn't work, the "Workaround" way provides a solution for a single connection. I've searched far and wide, but came up with zip. The problem with the workaround is mentioned in the last link, both connection uses the same port, which in my case, causes a block, where both of the embedded devices can actually send data, that is not been processed on the Android, while both embedded devices can receive data sent from the Android. Did anyone handle this before? There is a bit more reference here, UPDATE: Following this (that I posted earlier) I wanted to give the mPort a chance, and perhaps to see other port indices, and how other devices manage them, and I found out the the fields in the BluetoothSocket object are different while it is the same class FQN in both cases: Detils from an HTC Vivid 2.3.4, uses the "workaround" Technic: The Socket class type is: [android.bluetooth.BluetoothSocket] mSocket BluetoothSocket (id=830008629928) EADDRINUSE 98 EBADFD 77 MAX_RFCOMM_CHANNEL 30 TAG "BluetoothSocket" (id=830002722432) TYPE_L2CAP 3 TYPE_RFCOMM 1 TYPE_SCO 2 mAddress "64:9C:8E:DC:56:9A" (id=830008516328) mAuth true mClosed false mClosing AtomicBoolean (id=830007851600) mDevice BluetoothDevice (id=830007854256) mEncrypt true mInputStream BluetoothInputStream (id=830008688856) mLock ReentrantReadWriteLock (id=830008629992) mOutputStream BluetoothOutputStream (id=830008430536) **mPort 1** mSdp null mSocketData 3923880 mType 1 Detils from an LG-P925 2.2.2, uses the "normal" Technic: The Socket class type is: [android.bluetooth.BluetoothSocket] mSocket BluetoothSocket (id=830105532880) EADDRINUSE 98 EBADFD 77 MAX_RFCOMM_CHANNEL 30 TAG "BluetoothSocket" (id=830002668088) TYPE_L2CAP 3 TYPE_RFCOMM 1 TYPE_SCO 2 mAccepted false mAddress "64:9C:8E:B9:3F:77" (id=830105544600) mAuth true mClosed false mConnected ConditionVariable (id=830105533144) mDevice BluetoothDevice (id=830105349488) mEncrypt true mInputStream BluetoothInputStream (id=830105532952) mLock ReentrantReadWriteLock (id=830105532984) mOutputStream BluetoothOutputStream (id=830105532968) mPortName "" (id=830002606256) mSocketData 0 mSppPort BluetoothSppPort (id=830105533160) mType 1 mUuid ParcelUuid (id=830105714176) Anyone have some insight...

    Read the article

  • Multiple Tables or Multiple Schema

    - by Yan Cheng CHEOK
    http://stackoverflow.com/questions/1152405/postgresql-is-better-using-multiple-databases-with-1-schema-each-or-1-database I am new in schema concept for PostgreSQL. For the above mentioned scenario, I was wondering Why don't we use a single database (with default schema named public) Why don't we have a single table, to store multiple users row? Other tables which hold users related information, with foreign key point to the user table. Can anyone provide me a real case scenario, which single database, multiple schema will be extremely useful, and can't solve by conventional single database, single schema.

    Read the article

  • How to Select Multiple Records from Multiple Tables at Once - SQL Server/C#/.NET/T-SQL

    - by peace
    I have two tables Customer and CustomerPhone. Customer usually has multiple phone numbers, so when i run select statement on customer 101, i will get multiple records due to the multiple phone numbers. As you see below all the "Phone" and "Fax" field belongs to CustomerPhone table. These are considered as two records in the CustomerPhone table whereas the rest of fields relate to Customer table which is a single record. What should i do to fill Phone and Fax field in this case? Should i run select statement on CustomerPhone first and then run select statement on Customer?

    Read the article

  • What's the Benefit of Multiple Monitors

    - by DaveDev
    It's become apparent to me that in Software Development it's not uncommon to have more than 1 monitor. We've been pushing for multiple monitors here (currently I have 1 19") but it's difficult to get the point across to the 'deciders' that there would be a benefit. They're only concerned with saving cents. So I thought I'd ask around and see what software developers with multiple monitors thought? What are the benefits? What are the costs? What is the ideal number of monitors for a software developer? Thanks

    Read the article

  • Rails multiple select box issue for search

    - by Reido
    First off here is my model, controller, view: My model, this is where I have my search code:--------------------------- def self.find_by_lcc(params) where = [] where << "category = 'Land'" unless params[:mls].blank? where << "mls = :mls" end unless params[:county].blank? where << "county = :county" end unless params[:acreage_range].blank? where << "acreage_range = :acreage_range" end unless params[:landtype].blank? where << "landtype = :landtype" end unless params[:price_range].blank? where << "price_range = :price_range" end if where.empty? [] else find(:all, :conditions => [where.join(" AND "), params], :order => "county, price desc") end end My controller:---------------- def land @counties = ['Adams', 'Alcorn', 'Amite', 'Attala'] @title = "Browse" return if params[:commit].nil? @properties = Property.find_by_lcc(params) else 'No properties were found' render :action = 'land_table' end My View: ---------------------- <table width="900"> <tr> <td> <% form_tag({ :action => "land" }, :method => "get") do %> <fieldset> <legend>Search our Land Properties</legend> <div class="form_row"><p>&nbsp;</p></div> <div class="form_row"> <label for="mls">MLS Number:</label>&nbsp; <%= text_field_tag 'mls', params[:mls] %> </div> <div class="form_row"> <label for "county"><font color="#ff0000">*County:</font></label>&nbsp; <%= select_tag "county", options_for_select(@counties), :multiple => true, :size => 6 %> </div> <div class="form_row"> <label for "acreage_range">Acreage:</label>&nbsp; <%= select_tag "acreage_range", options_for_select([['All',''],['1-10','1-10'],['11-25','11-25'],['26-50','26-50'],['51-100','51-100']]) %> </div> <div class="form_row"> <label for "landtype">Type:</label>&nbsp; <%= select_tag "landtype", options_for_select([['All',''],['Waterfront','Waterfront'],['Wooded','Wooded'],['Pasture','Pasture'],['Woods/Pasture','Woods/Pasture'],['Lot','Lot']]) %> </div> <div class="form_row"> <label for="price_range"><font color="#ff0000">*Price:</font></label>&nbsp; <%= select_tag "price_range", options_for_select([['All',''],['0-1,000','0-1,000'],['1,001-10,000','1,001-10,000'],['10,001-50,000','10,001-50,000'],['50,001-100,000','50,001-100,000'],['100,001-150,000']])%> </div> <input type="text" style="display: none;" disabled="disabled" size="1" /> <%= submit_tag "Search", :class => "submit" %> </fieldset> <% end%> </td> </tr> </table> The search works fine until I add ", :multiple = true, :size = 6" to make the county field multiple select. Then I get the error: Processing PublicController#land (for 65.0.81.83 at 2010-04-01 13:11:30) [GET] Parameters: {"acreage_range"=>"", "commit"=>"Search", "county"=>["Adams", "Amite"], "landtype"=>"", "price_range"=>"", "mls"=>""} ActiveRecord::StatementInvalid (Mysql::Error: Operand should contain 1 column(s): SELECT * FROM `properties` WHERE (category = 'Land' AND county = 'Adams','Amite') ORDER BY county, price desc): app/models/property.rb:93:in `find_by_lcc' app/controllers/public_controller.rb:84:in `land' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' fcgi (0.8.7) lib/fcgi.rb:117:in `session' fcgi (0.8.7) lib/fcgi.rb:104:in `each_request' fcgi (0.8.7) lib/fcgi.rb:36:in `each' dispatch.fcgi:24 I've tried to make the county, acreage_range, and price_range fields into multiple select boxes numerous ways, but can not get any method to work correctly. Any help would be greatly appreciated. Thanks,

    Read the article

  • Supporting multiple versions without separate builds in JavaME

    - by Casebash
    I want to be able to support multiple versions of Java ME without having to have multiple builds. I already know how to detect the profile/configuration/supported JSRs. My problem is that knowing whether the JSR is supported at run time doesn't allow me to use all the features. For if I call a function added in a later version anywhere in the code - even a location that will never be run, then this will be a compilation error due to static typing. Is there any way round this?

    Read the article

  • php multiple select drop down

    - by Chocho
    here is my mysql and php code layout: -i have 3 tables -tableA stores unique "person" information -tableB stores unique "places" information -tableC stores not unique information about a person and places they have "beenTo". here is how i layed out my form: -one big form to insert into "person" tableA; "beenTo" tableC in the form, a person mulitple selects "places" which get inserted into "beenTo" my question is, when i am editing a "person" how do i display what the user has already selected to appear on my multiple select options drop down menu? my drop down menu at the moment query "places" table and displays it in a multiple select drop down menu. its easier when a person have beenTo one place, the problem arrises when there is more than one "beenTo" places? any ideas. thanks

    Read the article

  • How to use Vendor Properties in Multiple Backgrounds?

    - by barraponto
    I want to use multiple backgrounds in css, which are currently supported by Firefox 3.61, Chrome/Safari, supposedly Opera10.5 (doesn't run on gnu/linux). It is working fine, however i would like to use linear-gradients as a background. it works ok for Firefox, doesn't work at all with Chrome, yet i can't figure out how to make it work for both at the same time. any clues? http://snook.ca/archives/html_and_css/multiple-bg-css-gradients came the closest to match what i need, but i couldn't get it to work with chrome yet.

    Read the article

  • Uploading multiple files simultaneously with Flex

    - by David
    I have been working on a flex uploader, where the user can select multiple files. It works fine when the files are uploaded in a queue (one at a time), however as soon as I try to have it upload 2 files at once I run into issues. It seems that files will often lock up, and either stay at 1% until every other file is uploaded, or just not complete at all. There is never more than one file uploading at a time. Is there some issue with calling .upload on multiple files at once in Flex?

    Read the article

  • PHP email form multiple select

    - by Justin Goodman
    I'm trying to set up a simple PHP contact form for a website and I need some help modifying the PHP to list multiple items from a select menu and would appreciate the help. I'm a graphic designer, not a developer, so a lot of this is way over my head. This is the problem area here: <label for="Events[]">Which Event(s) Will You Be Attending?</label> <div class="input-bg"> <select name="Events[]" size="6" multiple="MULTIPLE" class="required" id="Events[]"> <option value="Wednesday">Portfolio Show June 16</option> <option value="Thursday">Portfolio Show June 17</option> <option value="Saturday">Graduation Ceremony</option> <option value="Saturday Eve">Graduation Party</option> <option value="Not Sure">Not Sure</option> <option value="Not Coming">Not Coming</option> </select> </div> And here's the PHP: <?php // CHANGE THE VARIABLES BELOW $EmailFrom = "[email protected]"; $EmailTo = "[email protected]"; $Subject = "Graduation RSVP"; $Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $Guests = Trim(stripslashes($_POST['Guests'])); $Events = Trim(stripslashes($_POST['Events'])); // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Guests: "; $Body .= $Guests; $Body .= "\n"; $Body .= "Events: "; $Body .= $Events; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page // CHANGE THE URL BELOW TO YOUR "THANK YOU" PAGE if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=http://justgooddesign.net/graduation\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=http://justgooddesign.net/graduation/error.html\">"; } ?> Any help really is appreciated!

    Read the article

  • C#: How to inherit constructors?

    - by Ian Boyd
    Imagine a base class with many constructors and a virtual method public class Foo { ... public Foo() {...} public Foo(int i) {...} ... public virtual void SomethingElse() {...} ... } and now I want to create a descendant class that overrides the virtual method: public class Bar : Foo { public override void SomethingElse() {...} } And another descendant that does some more stuff: public class Bah : Bar { public void DoMoreStuff() {...} } Do I really have to copy all constructors from Foo into Bar and Bah? And then if I change a constructor signature in Foo, do I have to update it in Bar and Bah? Is there no way to inherit constructors? Is there no way to encourage code reuse?

    Read the article

  • Multiple Questions per page using Drupal Quiz

    - by Andrew
    I'm using the Drupal Quiz module, and have setup some basic quizzes and stuff like that. However some further customization is required, involving more than 1 question per page, and a multi-type answer in this type of format: Question 1: Describe 4 things you did last summer a) [ short answer space - text field ] b) "I wept" c) "My whole family died so I learned self reliance" d) "I got another xbox" Question 2: Describe 2 things you hate about yourself a) "My arms are way shorter than my legs" b) "I was born without human emotion" So I guess in two parts, how to show multiple questions per page, and then how to allow multiple text fields for answers. Oh and this quiz is not graded, it's like a self assessment. Thanks!

    Read the article

  • Maximizing Adobe Air windows on multiple monitors

    - by Andrew
    In an Adobe Air AJAX application with multiple windows running on a system with multiple (three or more) monitors, can you maximize the windows in each monitor? I've seen posts by others trying to do this, but I've not seen anyone saying how it worked out. I basically need to build a 'status monitor' system (similar to, say, an airport departures monitor) in which there are public-facing displays that need to look and feel like single-purpose, embedded applications -- no window chrome and no visible desktop. I don't think this should be any different from any other windows application, but I don't know about Air. I have a dual-monitor Mac setup right now, but I can't easily test Windows and I likely will never be able to test three monitors at once. This application will be run as an AJAX Air application written in Aptana (or DW if it makes a difference).

    Read the article

  • Single database with multiple instances of Django

    - by jwesonga
    I have a Django project where the company will have a main site like www.ourcompany.org and a bunch of sub-domains like project.ourcompany.org. Content appearing in the sub-domains like case studies should also appear in the main site. I've decided to use multiple instances of Django BUT one database for each sub-domain so that I can have some flexibility and take advantage of the Sites framework. What I'm not sure of is how to access the models across the multiple instances. If I have a model: class CaseStudy(models.Model): title=models.CharField(max_length=100) site=models.ManyToMany(Site) Do I need to create this model in every instance so that I can have access to the object?

    Read the article

  • C++ multiple definition error

    - by user231536
    Starting with sth's answer to this question: http://stackoverflow.com/questions/3023760/c-template-specialization I was wondering how to resolve multiple definition errors if the following code is put in a header file included multiple times by different .cc files and linked together: template <typename T> class C { static const int K; static ostream& print(ostream& os, const T& t) { return os << t;} }; // general case template <typename T> const int C<T>::K = 1; // specialization template <> const int C<int>::K = 2;

    Read the article

  • Django - User account with multiple identities

    - by Scott Willman
    Synopsis: Each User account has a UserProfile to hold extended info like phone numbers, addresses, etc. Then, a User account can have multiple Identities. There are multiple types of identities that hold different types of information. The structure would be like so: User |<-FK- UserProfile | |<-FK- IdentityType1 |<-FK- IdentityType1 |<-FK- IdentityType2 |<-FK- IdentityType3 (current) |<-FK- IdentityType3 |<-FK- IdentityType3 The User account can be connected to n number of Identities of different types but can only use one Identity at a time. Seemingly, the Django way would be to collect all of the connected identities (user.IdentityType1_set.select_related()) into a QuerySet and then check each one for some kind of 'current' field. Question: Can anyone think of a better way to select the 'current' marked Identity than doing three DB queries (one for each IdentityType)?

    Read the article

  • Inheriting from multiple classes in Java (and possibly not using interface)

    - by sheidaei
    So, let's say we have classes A, B and C and I want to inherit from all those classes and have another class called D, it can be done using implements and interfaces in Java. But let's say we don't want to use this simple solution, would you be able to inherit class D from classes A, B and C in any other way in Java? (This question might be related to design patterns, it has been brought up after challenging my colleague at lunch discussing design patterns) I don't think there is any other way to have multiple inheritance in Java other than using multiple interfaces.

    Read the article

  • How to launch new Firefox window with multiple tabs using Python

    - by newbie py
    Hi, I want to create a MSWindows Python program that would launch a new Firefox window with multiple tabs each time it is run. For example if I want to search "hello", a new window pops out (even if a Firefox window is already open) and then launches a Google and Bing tabs searching for "hello". If I change the keyword to "world", a new browser pops out again with Google and Bing tabs searching for "world". I've looked at the webbrowser module but couldn't get it to: 1. Launch a new browser when a browser is already open: e.g. webbrowser.open('http://www.google.com',new=1) will instead open a new tab 2. Launch multiple tabs simultaneously in the same window Appreciate the help. Thanks.

    Read the article

  • Tip 16 : Open Multiple Documents within Single Application Instance Using C#

    - by StanleyGu
    1.       Using Microsoft Word 2007 as an example, you can open test1.docx and test2.docx at same time. The two documents are opened within single instance of the word application. World application supports command line argument of passing multiple documents. 2.       Again, Using Microsoft Word 2007 as an example, you can open test1.docx first and then test2.docx. The two documents are opened within single instance of the Word application. Word application supports Multiple Document Interface (MDI). 3.       Using Notepad as an example, you receive error message of “The filename, directory name, or volume label syntax is incorrect” if you want to open two documents at the same time. Notepad does not support command line argument of passing multiple documents 4.       Again, using Notepad as an example, you can open test1.txt first and then test2.txt. The two documents are opened to two different instances of Notepad application. Notepad does not support Multiple Document Interface (MDI). 5.       In conclusion, there is nothing you can do trying to rely on System.Diagnostics.Process class to open multiple documents within a single instance of an application because it is controlled by the application itself. The best approach is to read any developer or user guide of the application and make sure: 1. The application supports Multiple Document Interface (MDI) 2. The application provides command line argument of passing multiple documents. Then, you can use Process class and the command line argument syntax to open multiple documents for the application.  

    Read the article

  • How do I configure multiple domain names on my IIS server? [closed]

    - by Dillie-O
    We have a few websites that we are running on one instance of IIS that need to be mapped for each of their domain names. For example. Site A has the domain name coolness.com Site B has the domain name 6to8Weeks.com Site C has the domain name PhatTech.com When I look at the "Web Site Identification" section of the IIS configuration window, I notice that I can specify an IP address and port, but if I click the Advanced button, I can also configure the site based on host header values as well. How do I configure each site in IIS? Ideally I would like them to all be able to listen to port 80, so I don't have weird URLs, but I'm not sure if I do this using headers, IP addresses, both, or something else.

    Read the article

  • Is it better to have multiple domains for cities or one single TLD?

    - by Brett
    I make websites for small businesses, and for some reason business owners love to have several domains with the same website but the TLD containing the city name. For example: 1. smallbizname.com 2. clevelandsmallbizname.com 3. columbussmallbizname.com 4. cincinnatismallbizname.com ... and so on. I've seen questions about localization per country aspects, but this is a much smaller scale, so I don't think the same rules apply. The problem I have is the companies never want to write separate content per domain, just have the same website hosted several times at each domain. I feel this probably hurts SEO for two reasons: 1. Traffic gets scattered throughout domains, could be boosting just one domain. 2. Duplicate content penalty because the content is identical. My question boils down to this... Should I redirect all the city domains to the main business name domain, or does having these separate sites help to rank better per city? And if they are redirected, how does google rank the redirects? Thanks for any input on this issue!!

    Read the article

  • best way to receive email for multiple domains with multiple user accouts into rails app

    - by rick moss
    hi all I have a cms that runs on multiple domains and therefore needs to pull emails into the app for multiple email addresses. I have setup rackspace email for a hosted email solution and am trying to find the best way to pull the emails into my app from all the mailboxes. Should i be using pop3 or imap ? should i be pulling into a que system then into rails app ? Is there a gem / plugin for this ? thanks alot for help in advance Rick

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >