Daily Archives

Articles indexed Monday October 15 2012

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

  • Reasons for Wi-Fi to be slower on Ubuntu compared to Windows?

    - by den-javamaniac
    I'm using 64-bit Ubuntu 12.04 and Windows 7 64 bit – dual boot on the same computer. Connecting to the same wireless network. And it turns out that on Windows I get a more stable and stronger signal than on Ubuntu. To my knowledge there's a router which serves as a gateway and then there's a cable connected to the router which goes further to ISP, so the results for both OS should be the same. I've tested the issue on both OSs at various times and it gave me the same result. The question is why? Why Ubuntu networking is worse than that of Windows?

    Read the article

  • How to enter Devanagari half-R character in Emacs MULE?

    - by journeyer
    I am trying the Emacs MULE ITRANS input method to enter Devanagari unicode text. I am looking to enter a key sequence for Devanagari letter "Half-R" (??) i.e. U0931 U094d (which should be mapped to R according to the ITRANS Wikipedia page). While all other keys in the map work fine, this particular one does not! I know I can use M-x ucs-insert (or CTRL-x-8 RET) to enter this sequence, but it is getting tiresome. How do I fix this problem ?

    Read the article

  • SQL Server 2012 Maintenance Plan can't modify

    - by Crazyd
    Click on any created Maintenance Plan: TITLE: Microsoft SQL Server Management Studio Value cannot be null. Parameter name: component (System.Design) BUTTONS:OK Create a new Plan I get this error: TITLE: Maintenance Plan Wizard Progress Saving maintenance plan failed. ADDITIONAL INFORMATION: The SaveToSQLServer method has encountered OLE DB error code 0x80004005 (Unspecified error). The SQL statement that was issued has failed. The SaveToSQLServer method has encountered OLE DB error code 0x80004005 (Unspecified error). The SQL statement that was issued has failed. BUTTONS:OK Edit an already created Backup Plan: Error 1 Error loading 'BackupDb' : The LoadFromSQLServer method has encountered OLE DB error code 0x80004005 (Unspecified error). The SQL statement that was issued has failed. . server=SERVER;package=Maintenance Plans\BackupLeadsDb; 1 1 Attemped Solutions: I've changed password for SA Account; I use Windows Authentication to log in; and I've registered C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\DTS.dll. Repair SQL Server 2012, Uninstall/ReInstall SQL Server 2012.

    Read the article

  • Automount of AFP shares on Lion clients from OS X Snow Leopard server - not working right

    - by Paul
    Recently upgraded Snow Leopard clients to Lion. AFP shares are set up as login items. The network shares on some of the machines now take a long time to come up (10 minutes). Several machines that were upgraded are acting normally, and three machines with clean installs of Lion (not upgraded) are also working normally. Is there a network file causing a conflict on some of these client machines? Thanks, Paul

    Read the article

  • Unable to install Android for Windows 7 because JDK is not found

    - by user1294663
    I have JDK SE7u4 installed in windows 7. I tried to install Android on Windows 7 using the installer_r18-windows.exe but no avail. The setup window showed the message saying that the Java SE JDK not found and ERROR: Failed to find Java version for C:\Windows\System32\java.exe The system cannot found the file specified. If you believe you have a JDK installed and it was not properly recognized, simply set an environment variable JAVA_HOME to point to it I right clicked on Computer Properties Advanced System Settings Environment variables. I created a NEW system variable called JAVA_HOME and set the value as C:\Program Files\Java\jdk1.7.0_04\bin or C:\Windows\System32\java.exe. I ran the installer again — the same error message still appeared.

    Read the article

  • Tuning Nvidia driver in Nvidia X Server Settings in Ubuntu to avoid tearing?

    - by c00kiemonster
    I'm running Ubuntu 10.10 on an Asus at3ion motherboard. I have installed the proprietary nvidia drivers and everything is working fine, but it's a but ragged when I move windows etc. I think the issue is called tearing. There is flickering and the window isn't refreshed smoothly. The ion acceleration works fine (I am running xbmc at 1080p completely without any issues). Please note I am not interested in any fancy effects etc, I just want the graphics to be smooth and nice. How can I tune the nvidia driver for this, i.e., what do I need to change in the Nvidia X Server Settings?

    Read the article

  • Firewall blocks FTP PASV response

    - by harper
    I have an FTP server that supports passive server mode (using PASV command). This works fine with Windows XP. When I want to access this server from Windows Vista or Windows 7 with firewall enabled I experience an immediate connection shutdown. A reset packet is sent to the server, and the socket is signaled that the server has reset the connection (which is not true). The problem disappears when the firewall is disabled. Connections to other FTP servers work correctly. The difference is that the server's response to PASV does not enclose the address field with parentheses. This is legal as documented in RFC-959 and RFC-1132. How can I configure the firewall to stop this bad behavior?

    Read the article

  • Virtual Hard Drive not booting - VMWare

    - by Chloraphil
    I have a .vmdk (VMWare hard disk) file that I cannot use as the lone disk in a new virtual machine. If I attach it to an existing virtual machine then it works fine. It has Windows Server 2003 on it. When I attempt to boot the new VM it attempts a network boot. EDIT: VMWare Workstation 6.5 I could not find a PXE option in the settings, and I did look in the VM config file for "PXE" but did not find one.

    Read the article

  • HTG Explains: What Does “Bricking” a Device Mean?

    - by Chris Hoffman
    When someone breaks a device and turns it into an expensive brick, people say they “bricked” it. We’ll cover exactly what causes bricking and why, how you can avoid it, and what to do if you have a bricked device. Bear in mind that many people use the term “bricking” incorrectly and refer to a device that isn’t working properly as “bricked.” if you can easily recover the device through a software process, it’s technically not “bricked.” Image Credit: Esparta Palma on Flickr HTG Explains: What is the Windows Page File and Should You Disable It? How To Get a Better Wireless Signal and Reduce Wireless Network Interference How To Troubleshoot Internet Connection Problems

    Read the article

  • How to Enable Click To Play Plugins in Google Chrome

    - by Taylor Gibb
    Have you ever opened a webpage only to have all sorts of multimedia on the page just start playing? Chrome has a hidden setting that was designed to prevent situations just like that. Read on to find out how to enable it. HTG Explains: What is the Windows Page File and Should You Disable It? How To Get a Better Wireless Signal and Reduce Wireless Network Interference How To Troubleshoot Internet Connection Problems

    Read the article

  • Mozilla inclut « Social API » à Firefox, le navigateur comprend désormais une barre de notification Facebook Messenger

    Intégration imminente des réseaux sociaux dans Firefox Bonne ou mauvaise idée ? Nous avons déjà parlé dans ces colonnes du navigateur RockMelt, et de la place centrale qu'il réserve aux réseaux sociaux. Aujourd'hui, c'est Mozilla qui lui emboîte le pas, et prépare une intégration native, en cours de développement, des réseaux sociaux à son célèbre navigateur Firefox. Cette intégration fonctionne de façon similaire à celle des fournisseurs de recherche intégrée dans le navigateur. Les utilisateurs peuvent installer ou activer des « fournisseurs de réseaux sociaux » dans le navigateur, afin de pouvoir interagir avec le ...

    Read the article

  • BPM 11g - Dynamic Task Assignment with Multi-level Organization Units

    - by Mark Foster
    I've seen several requirements to have a more granular level of task assignment in BPM 11g based on some value in the data passed to the process. Parametric Roles is normally the first port of call to try to satisfy this requirement, but in this blog we will show how a lot of use-cases can be satisfied by the easier to implement and flexible Organization Unit. The Use-Case Task assignment is to an approval group containing several users. At runtime, a location value in the input data determines which of the particular users the task is ultimately assigned to. In this case we use the Demo Community referenced in the SOA Admin Guide, and specifically the "LoanAnalyticGroup" which contains three users; "szweig", "mmitch" & "fkafka". In our scenario we would like to assign a task to "szweig" if the input data specifies that the location is "JapanCentral", to "fkafka" if the location is "JapanNorth" and to "mmitch" if "JapanSouth", and to all of them if the location is "Japan" i.e....   The Process Simple one human task process.... In the output data association of the "Start" activity we need to set the value of the "Organization Unit" predefined variable based on the input data (note that the  predefined variables can only be set on output data associations)....  ...and in the output data association of the human activity we will reset the "Organization Unit" to empty, always good practice to ensure that the Organization Unit will not be used for any subsequent human activities for which we do not require it.... Set Up the Organization Unit  Log in to the BPM Workspace with an administrator user (weblogic/welcome1 in our case) and choose the "Administration" option. Within "Roles" assign the "ProcessOwner" swim-lane for our process to "LoanAnalyticGroup".... Within "Organization Units" we can model our organization.... "Root Organization Unit" as "Japan" and "Child Organization Unit" as "Central", "South" & "North" as shown. As described previously, add user "szweig" to "Central", "mmitch" to "South" and "fkafka" to "North"....   Test the Process Invalid Data  First let us test with invalid data in the input to see what the consequences are, here we use "X" as input.... ...and looking at the instance we can see it has errored.... Organization Unit Root Level Assignment  Now let us see what happens if we have "Japan" in the input data.... ...looking in the "flow trace" we can see that the task has been assigned....  ... but who has the task been assigned to ? Let us look in the BPM Workspace for user "szweig"....  ...and for "mmitch"....  ... and for "fkafka"....  ...so we can see that with an Organization Unit at "Root" level we have successfully assigned the task to all users. Organization Unit Child Level Assignment  Now let us test with "Japan/North" in the input data.... ...and looking in "fkafka" workspace we see the task has been assigned, remember, he was associated with "JapanNorth"....   ... but what about the workspace of "szweig"....  ...no tasks assigned, neither has "mmitch", just as we expected. Summary  We have seen in this blog how to easily implement multi-level dynamic task routing using Organization Units, a common use-case and a simpler solution than Parametric Roles. 

    Read the article

  • ExaLogic virtual datacenter live at Qualogy

    - by JuergenKress
    Just a quick post to celebrate another siginificant milestone for Exalogic! After a few days of preparations and some hard work we succeeded in upgrading our Exalogic quarterrack to the newly released Elastic Cloud version 2.0.1.1.0. This version was just recently released on July 25th. This new version turns your Exalogic into a virtual datacenter with many very neat cloud provisioning capabilities. There are many more possibilities in this version to provide strict network and vServer group isolation where needed and it helps you manage multitenancy and delegate your cloud administration. How did we fare? Apart from some small inconveniences and minor issues I can tell you it all went remarkably well, provided you do proper homework on the prerequisite requirements and you stick to the instructions all the way through (there’s some 37 steps to cover). We as a specialized Exalogic partner had early access to this version and did some early adopter work. As a customer this is all done for you as Oracle will deliver a new Exalogic with this version from the factory if you so desire, or upgrade your current ones. O fcourse, Qualogy can do this for you as well! Interested contact the Qualogy team [email protected]! WebLogic Partner Community For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center. BlogTwitterLinkedInMixForumWiki Technorati Tags: ExaLogic,Qualogy,ExaLogic demo,Exalogic datacenter,WebLogic Community,Oracle,OPN,Jürgen Kress

    Read the article

  • Using Cloud OER to Find Fusion Applications On-Premise Service Concrete WSDL URL by Rajesh Raheja

    - by JuergenKress
    In my previous post on Fusion Applications Integration, the Fusion Applications OER white paper explains Oracle Enterprise Repository (OER) usage in the applications context, assuming a dedicated OER for your Fusion Applications instance (whether cloud/SaaS or on-premise). Having a dedicated OER instance is recommended as it can provide customized service metadata and can be used for overall SOA governance in addition to simple service discovery. One of the common queries I get is how on-premise customers without a dedicated OER can find a concrete service WSDL URL for their specific environment using the cloud hosted OER instance. Read the full article here. SOA & BPM Partner Community For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit  www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center. Blog Twitter LinkedIn Mix Forum Technorati Tags: OER,SOA Governance,SOA Community,Oracle SOA,Oracle BPM,BPM,Community,OPN,Jürgen Kress

    Read the article

  • APEX 4.2 ist da!

    - by carstenczarski
    Seit dem 12. Oktober 2012 steht APEX 4.2 zum Download bereit. Nach der Installation, die wie immer, mit dem Skript apexins durchgeführt wird, können Sie gleich mit dem Ausprobieren der neuen Features beginnen - allen voran das einfache, deklarative Erstellen von APEX-Anwendungen für mobile Endgeräte oder HTML5-Diagramme. Aber auch darüber hinaus gibt es zahlreiche neue Dinge - mit Verbesserungen beim Excel-Upload für den Endanwender oder der Möglichkeit nun 200 (anstelle von 100) Elemente auf eine Seite zu setzen, seien nur zwei genannt.

    Read the article

  • Partition Table and Exadata Hybrid Columnar Compression (EHCC)

    - by Bandari Huang
    Create EHCC table CREATE TABLE ... COMPRESS FOR [QUERY LOW|QUERY HIGH|ARCHIVE LOW|ARCHIVE HIGH]; select owner,table_name,compress_for DBA_TAB_SUBPARTITIONS where compression = ‘ENABLED'; Convert Table/Partition/Subpartition to EHCC Compress Table&Partition&Subpartition to EHCC: ALTER TABLE table_name MOVE COMPRESS FOR [QUERY LOW|QUERY HIGH|ARCHIVE LOW|ARCHIVE HIGH] [PARALLEL <dop>]; ALTER TABLE table_name MOVE PARATITION partition_name COMPRESS FOR [QUERY LOW|QUERY HIGH|ARCHIVE LOW|ARCHIVE HIGH] [PARALLEL <dop>]; ALTER TABLE table_name MOVE SUBPARATITION subpartition_name COMPRESS FOR [QUERY LOW|QUERY HIGH|ARCHIVE LOW|ARCHIVE HIGH] [PARALLEL <dop>]; select owner,table_name,compress_for DBA_TAB_SUBPARTITIONS where compression = ‘ENABLED'; select table_owner,table_name,partition_name,compress_for DBA_TAB_PARTITIONS where compression = ‘ENABLED’; select table_owner,table_name,subpartition_name,compress_for DBA_TAB_SUBPARTITIONS where compression = ‘ENABLED’; Rebuild Unusable Index: select index_name from dba_index where status = 'UNUSABLE'; select index_name,partition_name from dba_ind_partition where status = 'UNUSABLE'; select index_name,subpartition_name from dba_ind_partition where status = 'UNUSABLE'; ALTER INDEX index_name REBUILD [PARALLEL <dop>]; ALTER INDEX index_name REBUILD PARTITION partition_name [PARALLEL <dop>]; ALTER INDEX index_name REBUILD SUBPARTITION subpartition_name [PARALLEL <dop>]; Convert Table/Partition/Subpartition from EHCC to OLTP compression or uncompressed format: Uncompress EHCC Table&Partition&Subpartition: ALTER TABLE table_name MOVE [NOCOMPRESS|COMPRESS for OLTP] [PARALLEL <dop>]; ALTER TABLE table_name MOVE PARTITION partition_name [NOCOMPRESS|COMPRESS for OLTP] [PARALLEL <dop>]; ALTER TABLE table_name MOVE SUBPARTITION subpartition_name [NOCOMPRESS|COMPRESS for OLTP] [PARALLEL <dop>]; select owner,table_name,compress_for DBA_TAB_SUBPARTITIONS where compression = ''; select table_owner,table_name,partition_name,compress_for DBA_TAB_PARTITIONS where compression = ''; select table_owner,table_name,subpartition_name,compress_for DBA_TAB_SUBPARTITIONS where compression = ''; Rebuild Unusable Index: select index_name from dba_index where status = 'UNUSABLE'; select index_name,partition_name from dba_ind_partition where status = 'UNUSABLE'; select index_name,subpartition_name from dba_ind_partition where status = 'UNUSABLE'; ALTER INDEX index_name REBUILD [PARALLEL <dop>]; ALTER INDEX index_name REBUILD PARTITION partition_name [PARALLEL <dop>]; ALTER INDEX index_name REBUILD SUBPARTITION subpartition_name [PARALLEL <dop>];

    Read the article

  • Getting Started with the New Column Store Index of SQL Server 2012

    Column Store Index, a new feature in SQL Server 2012, improves performance of data warehouse queries several folds. Arshad Ali shows you how to create column store index, and how to use index query hint to include or exclude a column store index. Schedule Azure backupsRed Gate’s Cloud Services makes it simple to create and schedule backups of your SQL Azure databases to Azure blob storage or Amazon S3. Try it for free today.

    Read the article

  • Cardinality Estimation Bug with Lookups in SQL Server 2008 onward

    - by Paul White
    Cost-based optimization stands or falls on the quality of cardinality estimates (expected row counts).  If the optimizer has incorrect information to start with, it is quite unlikely to produce good quality execution plans except by chance.  There are many ways we can provide good starting information to the optimizer, and even more ways for cardinality estimation to go wrong.  Good database people know this, and work hard to write optimizer-friendly queries with a schema and metadata (e.g. statistics) that reduce the chances of poor cardinality estimation producing a sub-optimal plan.  Today, I am going to look at a case where poor cardinality estimation is Microsoft’s fault, and not yours. SQL Server 2005 SELECT th.ProductID, th.TransactionID, th.TransactionDate FROM Production.TransactionHistory AS th WHERE th.ProductID = 1 AND th.TransactionDate BETWEEN '20030901' AND '20031231'; The query plan on SQL Server 2005 is as follows (if you are using a more recent version of AdventureWorks, you will need to change the year on the date range from 2003 to 2007): There is an Index Seek on ProductID = 1, followed by a Key Lookup to find the Transaction Date for each row, and finally a Filter to restrict the results to only those rows where Transaction Date falls in the range specified.  The cardinality estimate of 45 rows at the Index Seek is exactly correct.  The table is not very large, there are up-to-date statistics associated with the index, so this is as expected. The estimate for the Key Lookup is also exactly right.  Each lookup into the Clustered Index to find the Transaction Date is guaranteed to return exactly one row.  The plan shows that the Key Lookup is expected to be executed 45 times.  The estimate for the Inner Join output is also correct – 45 rows from the seek joining to one row each time, gives 45 rows as output. The Filter estimate is also very good: the optimizer estimates 16.9951 rows will match the specified range of transaction dates.  Eleven rows are produced by this query, but that small difference is quite normal and certainly nothing to worry about here.  All good so far. SQL Server 2008 onward The same query executed against an identical copy of AdventureWorks on SQL Server 2008 produces a different execution plan: The optimizer has pushed the Filter conditions seen in the 2005 plan down to the Key Lookup.  This is a good optimization – it makes sense to filter rows out as early as possible.  Unfortunately, it has made a bit of a mess of the cardinality estimates. The post-Filter estimate of 16.9951 rows seen in the 2005 plan has moved with the predicate on Transaction Date.  Instead of estimating one row, the plan now suggests that 16.9951 rows will be produced by each clustered index lookup – clearly not right!  This misinformation also confuses SQL Sentry Plan Explorer: Plan Explorer shows 765 rows expected from the Key Lookup (it multiplies a rounded estimate of 17 rows by 45 expected executions to give 765 rows total). Workarounds One workaround is to provide a covering non-clustered index (avoiding the lookup avoids the problem of course): CREATE INDEX nc1 ON Production.TransactionHistory (ProductID) INCLUDE (TransactionDate); With the Transaction Date filter applied as a residual predicate in the same operator as the seek, the estimate is again as expected: We could also force the use of the ultimate covering index (the clustered one): SELECT th.ProductID, th.TransactionID, th.TransactionDate FROM Production.TransactionHistory AS th WITH (INDEX(1)) WHERE th.ProductID = 1 AND th.TransactionDate BETWEEN '20030901' AND '20031231'; Summary Providing a covering non-clustered index for all possible queries is not always practical, and scanning the clustered index will rarely be optimal.  Nevertheless, these are the best workarounds we have today. In the meantime, watch out for poor cardinality estimates when a predicate is applied as part of a lookup. The worst thing is that the estimate after the lookup join in the 2008+ plans is wrong.  It’s not hopelessly wrong in this particular case (45 versus 16.9951 is not the end of the world) but it easily can be much worse, and there’s not much you can do about it.  Any decisions made by the optimizer after such a lookup could be based on very wrong information – which can only be bad news. If you think this situation should be improved, please vote for this Connect item. © 2012 Paul White – All Rights Reserved twitter: @SQL_Kiwi email: [email protected]

    Read the article

  • The C++ web stack, is there one?

    - by NimChimpsky
    Java would be jsps and servlets (or a framework such as Spring) running on the JVM and tomcat (or glassfish etc). C# would be asp and C# running on dot.net framework and IIS ? (I have no experience with this please correct and improve my terminology) Is there an equivalent for C++ ? I could happily call some C++ from a java servlet/controller but was wondering if there are existing frameworks and libraries out there specifically for creating business logic in C++ with a web front end.

    Read the article

  • C# WebForms and Ninject

    - by ipohfly
    I'm re-working on the design of an existing application which is build using WebForms. Currently the plan is to work it into a MVP pattern application while using Ninject as the IoC container. The reason for Ninject to be there is that the boss had wanted a certain flexibility within the system so that we can build in different flavor of business logic in the model and let the programmer to choose which to use based on the client request, either via XML configuration or database setting. I know that Ninject have no need for XML configuration, however I'm confused on how it can help to dynamically inject the dependency into the system? Imagine I have a interface IMember and I need to bind this interface to the class decided by a xml or database configuration at the launch of the application, how can I achieve that?

    Read the article

  • Coded UI Test Method failed inconsistently

    - by Sunitha M
    The following exception failing my UI automation test. Message: Test method CodedUITestMethod1 throw exception: The playback failed to find the control with the given search properties. Additional Details: TechnologyName: 'UIA' ControlType: 'MenuItem' Name: 'MyViewModel' ---> system.runtime.interopservices.comexception error hresult e_fail has been returned from a call to a COM component please any one give me a solution for these type of exceptions.

    Read the article

  • Given a project and working with 1 other person - never worked with someone before

    - by Celeritas
    I'm taking a class where I work with a partner to implement the link layer of the OSI model. I've worked programmed with a partner once before and it went bad. Is the goal to divide the work up and decides who does what or should one person code and the other person reviews and switch roles after a while? Any tips are much appreciated. Literally I know nothing about working with a partner to program so even if it's basic please tell me.

    Read the article

  • Agile Tools For Handling Multiple Projects

    - by f1dave
    Currently I'm leading our agile team in an iteration manager role as well as doing my regular dev work. One of the difficulties I'm facing as an IM is tracking burn-down/burn-up; not because I can't produce graphs, but because there's multiple projects that this team is working on at one time. At present I have an excel workbook with sheets that contain a whole bunch of graphs, both at an overall team and by-project level. It's clunky and I spend more time tweaking formulas and double checking calculations than I'd really like. As such, I'm interested to know if anyone has used a tool that can effectively produce these sorts of reports, burn-downs, and predictions across multiple projects. I've seen http://www.pivotaltracker.com/ do some nice things, and of course there's JIRA/Greenhopper, but I'm not aware of those being used to track the progress of multiple projects within one team. If anyone's got an idea of some tools, or has faced a similar problem before, I'd love to hear from you.

    Read the article

  • Visual Basic 2010 Listbox Error [migrated]

    - by stargaze07
    what is the meaning of this error? sorry it's my first time to use Visual basic 2010, I'm not familiar with this kind of error, I use this for selecting all the files in the listbox and tried to move or copy to another listbox in other form. Error 1 'ToArray' is not a member of 'System.Windows.Forms.ListBox.ObjectCollection'. This is the code I use. Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If RadioButton1.Checked Then Dim itemsToMove = ListBox1.Items.ToArray() For Each item In itemsToMove Form2.lstP.Items.Add(item) ListBox1.Items.Remove(item) Next Form2.Show() End If End Sub Can someone help me with this?

    Read the article

  • why client can not receive message from server (java) [migrated]

    - by user1745931
    I have just started learning java. I modified the client side code for a server/client communication program, by creating two threads for the client side, main thread for receiving user's input, and inputThread for receiving server's response. I am sure that server has sent the response to client, however, no response message is obtain at client. Here is my code. Can anyone help me to figure it out? Thanks package clientnio; import java.net.*; import java.nio.*; import java.io.*; import java.nio.channels.*; import java.util.Scanner; public class ClientNIO { public static int bufferLen = 50; public static SocketChannel client; public static ByteBuffer writeBuffer; public static ByteBuffer readBuffer; public static void main(String[] args) { writeBuffer = ByteBuffer.allocate(bufferLen); readBuffer = ByteBuffer.allocate(bufferLen); try { SocketAddress address = new InetSocketAddress("localhost",5505); System.out.println("Local address: "+ address); client=SocketChannel.open(address); client.configureBlocking(false); //readBuffer.flip(); new inputThread(readBuffer); /* String a="asdasdasdasddffasfas"; writeBuffer.put(a.getBytes()); writeBuffer.clear(); int d=client.write(writeBuffer); writeBuffer.flip(); */ while (true) { InputStream inStream = System.in; Scanner scan = new Scanner(inStream); if (scan.hasNext()==true) { String inputLine = scan.nextLine(); writeBuffer.put(inputLine.getBytes()); //writeBuffer.clear(); System.out.println(writeBuffer.remaining()); client.write(writeBuffer); System.out.println("Sending data: "+new String(writeBuffer.array())); writeBuffer.flip(); Thread.sleep(300); } } } catch(Exception e) { System.out.println(e); } } } class inputThread extends Thread { private ByteBuffer readBuffer; public inputThread(ByteBuffer readBuffer1) { System.out.println("Receiving thread starts."); this.readBuffer = readBuffer1; start(); } @Override public void run() { try { while (true) { readBuffer.flip(); int i=ClientNIO.client.read(readBuffer); if(i>0) { byte[] b=readBuffer.array(); System.out.println("Receiving data: "+new String(b)); //client.close(); //System.out.println("Connection closed."); //break; } Thread.sleep(100); } } catch (Exception e) { System.out.println(e); } } }

    Read the article

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