Search Results

Search found 604 results on 25 pages for 'bruno lee'.

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

  • Parser, send an argument/receive xml (receive already done/ send not)

    - by bruno
    public List<Afood> getFoodFromCat(String cat) { String resultado = ""; List<Afood> list = new ArrayList<Afood>(); try { URL xpto = new URL("http://10.0.2.2/webservice/nutrituga/get_food_by_cat.php"); HttpURLConnection conn; conn = (HttpURLConnection) xpto.openConnection(); conn.setDoInput(true); conn.connect(); InputStream is = conn.getInputStream(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(is); NodeList nl = doc.getElementsByTagName("item"); // resultado = String.valueOf(nl.getLength()); for (int i = 0; i < nl.getLength(); i++) { Node n = nl.item(i); Node childNode = n.getFirstChild(); while (childNode != null) { if (childNode.getNodeType() == Node.ELEMENT_NODE) { if (childNode.getNodeName().equalsIgnoreCase( "NAME_FOOD")) { Node valor = childNode.getFirstChild(); // resultado = resultado + valor.getNodeValue(); list.add(new Afood(valor.getNodeValue(), "", (int) Math.round(Math.random()), 1, 1, 1, 1, 1, 1)); } } childNode = childNode.getNextSibling(); } } return list; } catch (ParserConfigurationException e1) { e1.printStackTrace(); } catch (SAXException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return list; } I have this function that receives a xml and copy it to the list. This is well implemented. What i want do to know, is to send a category (that i receive like an argument of the function) and receive only the food from that category. The server is ready to receive the category and to send the food from that category. What do i have to do to send the category and receive the correct xml?

    Read the article

  • Execute remote Lua Script

    - by Bruno Lee
    Hi, I want to make an application that executes a remote script. The user can create a script (probabily a LUA script) then stores it in the server. Then he can uses an API for execute the script. I was thinking that API could be a webservice. So my questions are: I need high performance to execute the script. So my first choice was LUA script. Someone has another sugestion? Cause I need high perfomance, I was thinking if the webservice is the best solution. Maybe I could create a TCP/IP Windows Service that hold the users request. It is important to say that I will have many user executing scripts at the same time. So I will have a concurrency problem. My scripts will query in a database. I will use Tokyo Cabinet or Tokio Tyrant. I think Tokio Tyrant is the only solution cause I will have many requests. For perfomance, Do I need to make a connection pooling? Is there anyway to share variables between webservices requests? To make the webservice or the Windows service i was thinking to use C++. Can someone help with these questions? thanks

    Read the article

  • Prevent Windows Explorer from interfering with Directory operations.

    - by Bruno Martinez
    Sometimes, no "foo" directory is left after running this code: string folder = Path.Combine(Path.GetTempPath(), "foo"); if (!Directory.Exists(folder)) Directory.CreateDirectory(folder); Process.Start(@"c:\windows\explorer.exe", folder); Thread.Sleep(TimeSpan.FromSeconds(5)); Directory.Delete(folder, false); Directory.CreateDirectory(folder); It seems Windows Explorer keeps a reference to the folder, so the last CreateDirectory has nothing to do, but then the original folder is deleted. How can I fix the code?

    Read the article

  • How can I write query to output this format in SQLite?

    - by GivenPie
    I would like to output in this format: e.EE_id e.FNAME e.LNAME SUPer_id s.FNAME s.LNAME --- --------- -------------- --- ------------- ------------------- 1 Ziqiao Li 2 Charlie Li 1 Ziqiao Li 3 George Pee 2 Charlie Li 4 Jason Dee 2 Charlie Li 5 Petey Wee 2 Charlie Li From this table created : I need to display the Primary key and foreign key in the same results while displaying the foreign key name values for the primary key names. Create table Employees( ee_id integer, fname varchar(20), lname varchar(20), super_id integer, Constraint emp_Pk Primary Key (ee_id), Constraint emp_Fk Foreign Key (super_id) references employees (ee_id) ); INSERT INTO Employees VALUES(1,'Charlie','Li',null); INSERT INTO Employees VALUES(2,'Ziqiao','Lee',1); INSERT INTO Employees VALUES(3,'George','Pee',2); INSERT INTO Employees VALUES(4,'Jason','Dee',2); INSERT INTO Employees VALUES(5,'Petey','Wee',2); Select ee_id, fname, lname, super_id from employees; ee_id fname lname super_id ---------- ---------- ---------- ---------- 1 Charlie Li 2 Ziqiao Lee 1 3 George Pee 2 4 Jason Dee 2 5 Petey Wee 2 Do I need to create a view?

    Read the article

  • Tomcat stops responding to JK requests

    - by Bruno Reis
    Hello. I have a nasty issue with load-balanced Tomcat servers that are hanging up. Any help would be greatly appreciated. The system I'm running Tomcat 6.0.26 on HotSpot Server 14.3-b01 (Java 1.6.0_17-b04) on three servers sitting behind another server that acts as load balancer. The load balancer runs Apache (2.2.8-1) + MOD_JK (1.2.25). All of the servers are running Ubuntu 8.04. The Tomcat's have 2 connectors configured: an AJP one, and a HTTP one. The AJP is to be used with the load balancer, while the HTTP is used by the dev team to directly connect to a chosen server (if we have a reason to do so). I have Lambda Probe 1.7b installed on the Tomcat servers to help me diagnose and fix the problem soon to be described. The problem Here's the problem: after about 1 day the application servers are up, JK Status Manager starts reporting status ERR for, say, Tomcat2. It will simply get stuck on this state, and the only fix I've found so far is to ssh the box and restart Tomcat. I must also mention that JK Status Manager takes a lot longer to refresh when there's a Tomcat server in this state. Finally, the "Busy" count of the stuck Tomcat on JK Status Manager is always high, and won't go down per se -- I must restart the Tomcat server, wait, then reset the worker on JK. Analysis Since I have 2 connectors on each Tomcat (AJP and HTTP), I still can connect to the application through the HTTP one. The application works just fine like this, very, very fast. That is perfectly normal, since I'm the only one using this server (as JK stopped delegating requests to this Tomcat). To try to better understand the problem, I've taken a thread dump from a Tomcat which is not responding anymore, and from another one that has been restarted recently (say, 1 hour before). The instance that is responding normally to JK shows most of the TP-ProcessorXXX threads in "Runnable" state, with the following stack trace: java.net.SocketInputStream.socketRead0 ( native code ) java.net.SocketInputStream.read ( SocketInputStream.java:129 ) java.io.BufferedInputStream.fill ( BufferedInputStream.java:218 ) java.io.BufferedInputStream.read1 ( BufferedInputStream.java:258 ) java.io.BufferedInputStream.read ( BufferedInputStream.java:317 ) org.apache.jk.common.ChannelSocket.read ( ChannelSocket.java:621 ) org.apache.jk.common.ChannelSocket.receive ( ChannelSocket.java:559 ) org.apache.jk.common.ChannelSocket.processConnection ( ChannelSocket.java:686 ) org.apache.jk.common.ChannelSocket$SocketConnection.runIt ( ChannelSocket.java:891 ) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run ( ThreadPool.java:690 ) java.lang.Thread.run ( Thread.java:619 ) The instance that is stuck show most (all?) of the TP-ProcessorXXX threads in "Waiting" state. These have the following stack trace: java.lang.Object.wait ( native code ) java.lang.Object.wait ( Object.java:485 ) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run ( ThreadPool.java:662 ) java.lang.Thread.run ( Thread.java:619 ) I don't know of the internals of Tomcat, but I would infer that the "Waiting" threads are simply threads sitting on a thread pool. So, if they are threads waiting inside of a thread pool, why wouldn't Tomcat put them to work on processing requests from JK? Solution? So, as I've stated before, the only fix I've found is to stop the Tomcat instance, stop the JK worker, wait the latter's busy count slowly go down, start Tomcat again, and enable the JK worker once again. What is causing this problem? How should I further investigate it? What can I do to solve it? Thanks in advance.

    Read the article

  • Generating equals / hashcode / toString using annotation

    - by Bruno Bieth
    I believe I read somewhere people generating equals / hashcode / toString methods during compile time (using APT) by identifying which fields should be part of the hash / equality test. I couldn't find anything like that on the web (I might have dreamed it ?) ... That could be done like that : public class Person { @Id @GeneratedValue private Integer id; @Identity private String firstName, lastName; @Identity private Date dateOfBirth; //... } For an entity (so we want to exlude some fields, like the id). Or like a scala case class i.e a value object : @ValueObject public class Color { private int red, green, blue; } Not only the file becomes more readable and easier to write, but it also helps ensuring that all the attributes are part of the equals / hashcode (in case you add another attribute later on, without updating the methods accordingly). I heard APT isn't very well supported in IDE but I wouldn't see that as a major issue. After all, tests are mainly run by continuous integration servers. Any idea if this has been done already and if not why ? Thanks

    Read the article

  • How to use bll, dal and model?

    - by bruno
    Dear all, In my company I must use a Bll, Dal and model layer for creating applications with a database. I've learned at school that every databasetable should be an object in my model. so I create the whole model of my database. Also I've learned that for every table (or model object) there should be a DAO created into the DAL. So I do this to. Now i'm stuck with the BLL classes. I can write a BLLclass for each DAO/ModelObject or I can write a BLLclass that combine some (logic) DAO's... Or i can write just one Bllclass that will manage everything. (this last one I'm sure it aint the best way..) What is the best practice to handle this Bll 'problem'? And a second question. If a bll is in need of tablecontent from an other table where it aint responsible for, whats the best way to get the content? Go ask on the responsible BLL or go directly to the DAO? I'm struggling with these questions the last 2 months, and i don't know what is the best way to handle it.

    Read the article

  • Strategies to use Database Sequences?

    - by Bruno Brant
    Hello all, I have a high-end architecture which receives many requests every second (in fact, it can receive many requests every millisecond). The architecture is designed so that some controls rely on a certain unique id assigned to each request. To create such UID we use a DB2 Sequence. Right now I already understand that this approach is flawed, since using the database is costly, but it makes sense to do so because this value will also be used to log information on the database. My team has just found out an increase of almost 1000% in elapsed time for each transaction, which we are assuming happened because of the sequence. Now I wonder, using sequences will serialize access to my application? Since they have to guarantee that increments works the way they should, they have to, right? So, are there better strategies when using sequences? Please assume that I have no other way of obtaining a unique id other than relying on the database.

    Read the article

  • Executing remote script - Architecture

    - by Bruno Lee
    Hi, I want to make an application that executes a remote script. The user can create a script (probabily a LUA script) then stores it in the server. Then he can uses an API for execute the script. I was thinking that API could be a webservice. So my questions are: I need high performance to execute the script. So my first choice was LUA script. Someone has another sugestion? Cause I need high perfomance, I was thinking if the webservice is the best solution. Maybe I could create a TCP/IP Windows Service that hold the users request. It is important to say that I will have many user executing scripts at the same time. So I will have a concurrency problem. My scripts will query in a database. I will use Tokyo Cabinet or Tokio Tyrant. I think Tokio Tyrant is the only solution cause I will have many requests. For perfomance, Do I need to make a connection pooling? Is there anyway to share variables between webservices requests? To make the webservice or the Windows service i was thinking to use C++. Can someone help with these questions? thanks

    Read the article

  • Rails Scaffold problem # undefined method `edit_pais_path'

    - by Bruno Cordeiro
    I created a scaffold of named pais (This is a word in Portuguese of Brazil and is the same that country), i created using the follow command: ruby script\generate scaffold pais name:string abreviattion:string First I changed the inflections to my local idiom, like that: inflect.plural /^([a-zA-z]*)s$/i, '\1ses' #The plural of Pais is Paises And when I tryied to open the page on http://localhost:3000/paises I'm receiving the follow error: undefined method `edit_pais_path' for #<ActionView::Base:0x387fdf4> Thanks in advance.

    Read the article

  • Java: Local Enums

    - by bruno conde
    Today, I found myself coding something like this ... public class LocalEnums { public LocalEnums() { } public void foo() { enum LocalEnum { A,B,C }; // .... // class LocalClass { } } } and I was kind of surprised when the compiler reported an error on the local enum: The member enum LocalEnum cannot be local Why can't enums be declared local like classes? I found this very useful in certain situations. In the case I was working, the rest of the code didn't need to know anything about the enum. Is there any structural/design conflict that explains why this is not possible or could this be a future feature of Java?

    Read the article

  • ADO.NET Commands and SQL query plans

    - by ingredient_15939
    I've been reading up on query plans and how to minimise duplicate plans being created by SQL Server for the same basic query. For example, if I understand correctly, sending both these query strings will result in 2 different query plans: "SELECT FirstName FROM Members WHERE LastName = 'Lee'" "SELECT FirstName FROM Members WHERE LastName = 'MacGhilleseatheanaich'" Using a stored procedure avoids this, as the query plan is the same, and "LastName" is passed as a variable, eg: CREATE PROCEDURE sp_myStoredProcedure @LastName varchar(100) AS SELECT FirstName FROM Members WHERE LastName = @LastName Go Now, my question is whether the same applies to the Command object (eg. SQLClient.SQLCommand in ADO.NET). The reason I ask is that string parameters don't have a defined max length, as in the code above. Take the following code: MyCmd.CommandText = "SELECT FirstName FROM Members WHERE LastName = @LastName" MyCmd.Parameters.AddWithValue("@LastName", "Lee") Then later: MyCmd.Parameters.Clear() MyCmd.Parameters.AddWithValue("@LastName", "MacGhilleseatheanaich") Since @LastName hasn't been declared to SQL Server as having a defined maximum length, will SQL Server create a new query plan for every different value when I execute the command this way?

    Read the article

  • Multiple or single index in Lucene?

    - by Bruno Reis
    I have to index different kinds of data (text documents, forum messages, user profile data, etc) that should be searched together (ie, a single search would return results of the different kinds of data). What are the advantages and disadvantages of having multiple indexes, one for each type of data? And the advantages and disadvantages of having a single index for all kinds of data? Thank you.

    Read the article

  • JQuery: combine two jq selectors

    - by Bruno
    Hi there. Im sure the solution is simple but I cant figure it out :( I need to combine two jquery selectors in one selector: $(this) + $('input[type=text]:first') $(this) is e.g div#selected so the result should be: $('div#selected input[type=text]:first').focus(); How to do?

    Read the article

  • Keeping a database structure up to date in a project where code is on subversion?

    - by Bruno De Barros
    I have been working with Subversion for a while now, and it's been incredible for the management of my projects, and even to help managing the deployment to several different servers, but there is just the one thing that still annoys me. Whenever I make any changes to the database structure, I need to update every server manually, I have to keep track of any changes I made, and because some of my servers run branches of the project (modifications that are still being worked on, or were made for different purposes), it's a bit awkward. Until now, I've been using a "database.sql" file, which is a dump of the database structure for a specific revision. But it just seems like such a bad way to manage this. And I was wondering, how does everyone else manage their MySQL databases when they're working on a project and using Subversion?

    Read the article

  • Bluetooth server application accepting connections from mobile devices

    - by Bruno Reis
    Hello, I'd like to develop a desktop application (on Windows, and preferably on .NET) that accepts bluetooth connections from mobile devices, that would then send commands to this application. I've never worked with bluetooth before. I've looked for open-source examples of such applications, but I had no luck. I've actually found on Microsoft a managed (.NET) wrapper for the bluetooth stack on Windows CE, but wasn't able to use it on my Windows 7. Do you know of any good texts discussing this topic? Any other source of information on the subject? Where should I start? Thanks.

    Read the article

  • jQuery Cookie Help

    - by Bruno
    Hi there.. So I have never attempted to use a cookie and was wondering if someone could possibly help me with some functionality I am trying to achieve.. Essentially I have a jQuery function that is fired when a user visits a webpage. What I would like to do is make it to where that animation only plays once.. Possibly leveraging some cookie that would tell it not to play again for x amount of days. I noticed that alot of people having questions about cookies and jQuery have been mentioned the following cookie plugin, but I dont even really know how to leverage it. Any ideas? Right now the animation is: $('#header, #footer, #secondary-column').fadeTo(600, 1); I would assume that if I could set a cookie to tell it the following: $('#header, #footer, #secondary-column').fadeTo(0, 1);

    Read the article

  • Null Inner Bean with Spring IoC

    - by bruno conde
    Hi all. I have a singleton bean definition like this: <bean id="exampleBean" class="com.examples.ExampleBean"> <property name="exampleBean2"> <bean class="com.examples.ExampleBean2" /> </property> </bean> where ExampleBean could be: public class ExampleBean { private ExampleBean2 exampleBean2; public ExampleBean() { } public ExampleBean2 getExampleBean2() { return exampleBean2; } public void setExampleBean2(ExampleBean2 exampleBean2) { this.exampleBean2 = exampleBean2; } } The problem is that, in certain conditions, the com.examples.ExampleBean2 class might not exist at runtime witch will cause an error when the IoC tries to instantiate exampleBean. What I need is to ignore this error from IoC and allow the exampleBean to be created but leaving the exampleBean2 property null. So the question is: is this possible in any way? Thanks for all your help.

    Read the article

  • How can I get read-ahead bytes?

    - by Bruno Martinez
    Operating systems read from disk more than what a program actually requests, because a program is likely to need nearby information in the future. In my application, when I fetch an item from disk, I would like to show an interval of information around the element. There's a trade off between how much information I request and show, and speed. However, since the OS already reads more than what I requested, accessing these bytes already in memory is free. What API can I use to find out what's in the OS caches? Alternatively, I could use memory mapped files. In that case, the problem reduces to finding out whether a page is swapped to disk or not. Can this be done in any common OS?

    Read the article

  • Structure accessible by attribute name or index options

    - by Bruno DeGoia
    I am very new to Python, and trying to figure out how to create an object that has values that are accessible either by attribute name, or by index. For example, the way os.stat() returns a stat_result or pwd.getpwnam() returns a struct_passwd. In trying to figure it out, I've only come across C implementations of the above types. Nothing specifically in Python. What is the Python native way to create this kind of object? I apologize if this has been widely covered already. In searching for an answer, I must be missing some fundamental concept that is excluding me from finding an answer.

    Read the article

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