Daily Archives

Articles indexed Thursday May 13 2010

Page 16/119 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • How to use atmosphere-spade-server in combination with atmosphere-pubsub.war

    - by Alfred
    I would like to play with atmosphere-spade-server.jar + pubsub.war. First of I have maven installed, but to be honest Maven is kind of new to me. Could please someone please explain me how to use it correctly. What I have tried Download atmosphere-spade-server + pubsub.war from there site. java -jar atmosphere-spade-server-0.6.0-20100329.142039-1.jar -a atmosphere-pubsub.war curl http://localhost:8080/atmosphere-pubsub/myAtmosphereTopic <html><body><h1>Resource Not> Found</h1></body></html> I would just have a guided tour of how to use Atmosphere.

    Read the article

  • Rails is caching when I don't want it to. Why?

    - by ryeguy
    Rails is caching the index method of one of my controllers. It's a very simple application and only has like 2 controllers and a handful of actions each. The weird thing is I don't have any caching in my application at all, at least not explicitly. The pages get uncached if I restart passenger. Does rails do some kind of automatic page caching? There are no files in the public directory The page is returning a 200 header I have no caching blocks in my views (I use haml, if that matters) I have no action, controller, or page caching defined The request is hitting rails, verified by the production log I have the following in my production.rb: config.cache_classes = true config.action_controller.consider_all_requests_local = false config.action_controller.perform_caching = true config.action_view.cache_template_loading = true

    Read the article

  • Killing a thread while deleting an object

    - by viswanathan
    I have an application which does some socket communication with some hardwares. Assume for the particular hardware i have an object and this object intiates a thread which listens on a particular port number say 5001 infinitely until a connection is established. Now if i delete this obect is there anyway by which i can ensure that the thread that is listening on port number 5001 infinitely also gets destroyed.

    Read the article

  • Got a minus one from a read call.

    - by sunyata
    I connect to a database with read only access using SQL developer. It's a TNS connection. I use a tnsnames.ora, forwarding port script and SQL Developer. In the past, occasionally, when connecting, I get a error message Got a minus one from a read call. Vendor Code 0 If I do a reboot, it goes away. Another friend suggested changed the forwarding port which worked for him. I recently upgraded to a new computer and now it seems that I am getting the error message consistently. Reboot or changing forwarding port does not help at all. The port forwarding script contains something like this putty -L ::1521 Does anybody have any idea? Thanks.

    Read the article

  • Can't figure out what's wrong with my php/sql statement

    - by Olegious
    So this is probably a dumb beginner question, but I've been looking at it and can't figure it out. A bit of background: just practicing making a web app, a form on page 1 takes in some values from the user, posts them to the next page which contains the code to connect to the DB and populate the relevant tables. I establish the DB connection successfully, here's the code that contains the query: $conn->query("SET NAMES 'utf9'"); $query_str = "INSERT INTO 'qa'.'users' ('id', 'user_name','password' ,'email' ,'dob' ,'sx') VALUES (NULL, $username, $password, $email, $dob, $sx);"; $result = @$conn->query($query_str); Here's the error that is returned:Insert query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''qa'.'users' ('id', 'user_name' ,'password' ,'email' ,'dob' ,'s' at line 1 Thanks in advance!

    Read the article

  • Autocomplete server-side implementation

    - by toluju
    What is a fast and efficient way to implement the server-side component for an autocomplete feature in an html input box? I am writing a service to autocomplete user queries in our web interface's main search box, and the completions are displayed in an ajax-powered dropdown. The data we are running queries against is simply a large table of concepts our system knows about, which matches roughly with the set of wikipedia page titles. For this service obviously speed is of utmost importance, as responsiveness of the web page is important to the user experience. The current implementation simply loads all concepts into memory in a sorted set, and performs a simple log(n) lookup on a user keystroke. The tailset is then used to provide additional matches beyond the closest match. The problem with this solution is that it does not scale. It currently is running up against the VM heap space limit (I've set -Xmx2g, which is about the most we can push on our 32 bit machines), and this prevents us from expanding our concept table or adding more functionality. Switching to 64-bit VMs on machines with more memory isn't an immediate option. I've been hesitant to start working on a disk-based solution as I am concerned that disk seek time will kill performance. Are there possible solutions that will let me scale better, either entirely in memory or with some fast disk-backed implementations? Edits: @Gandalf: For our use case it is important the the autocompletion is comprehensive and isn't just extra help for the user. As for what we are completing, it is a list of concept-type pairs. For example, possible entries are [("Microsoft", "Software Company"), ("Jeff Atwood", "Programmer"), ("StackOverflow.com", "Website")]. We are using Lucene for the full search once a user selects an item from the autocomplete list, but I am not yet sure Lucene would work well for the autocomplete itself. @Glen: No databases are being used here. When I'm talking about a table I just mean the structured representation of my data. @Jason Day: My original implementation to this problem was to use a Trie, but the memory bloat with that was actually worse than the sorted set due to needing a large number of object references. I'll read on the ternary search trees to see if it could be of use.

    Read the article

  • UIScrollView not scrolling...

    - by Mark
    I have a UIScrollView which contains many UIImageView's UILabel's etc... the labels are well longer that the UIScrollView, but when I run the app, I cannot click and scroll down... Why might this be? Thanks

    Read the article

  • view parents' class members in netbeans navigator?

    - by fayer
    in the navigator i can only see the current class' members. is there a way to include the parents' members. cause it is very useful when working with a framework, then you don't have to look for them in the documentation. i think this is available in eclipse but not netbeans.

    Read the article

  • Get the signed/unsigned variant of an integer template parameter without explicit traits

    - by Blair Holloway
    I am looking to define a template class whose template parameter will always be an integer type. The class will contain two members, one of type T, and the other as the unsigned variant of type T -- i.e. if T == int, then T_Unsigned == unsigned int. My first instinct was to do this: template <typename T> class Range { typedef unsigned T T_Unsigned; // does not compile public: Range(T min, T_Unsigned range); private: T m_min; T_Unsigned m_range; }; But it doesn't work. I then thought about using partial template specialization, like so: template <typename T> struct UnsignedType {}; // deliberately empty template <> struct UnsignedType<int> { typedef unsigned int Type; }; template <typename T> class Range { typedef UnsignedType<T>::Type T_Unsigned; /* ... */ }; This works, so long as you partially specialize UnsignedType for every integer type. It's a little bit of additional copy-paste work (slash judicious use of macros), but serviceable. However, I'm now curious - is there another way of determining the signed-ness of an integer type, and/or using the unsigned variant of a type, without having to manually define a Traits class per-type? Or is this the only way to do it?

    Read the article

  • CDN with South America peering points / edge nodes

    - by Bill
    Hello, Does anyone one know of a CDN (Content Delivery Network) with true South American peering points or edge nodes? This seems to be quite rare. It seems that most CDNs serve Central and South America from Texas. However, our application requires low latency in Brazil, so this is not a good solution for us. We would like to avoid having to set up servers in South America just for this piece of the application, but may end up doing that. Thanks, Bill

    Read the article

  • Update a list of things without hitting every entry

    - by bobobobo
    I have a list in a database that the user should be able to order. itemname| order value (int) --------+--------------------- salad | 1 mango | 2 orange | 3 apples | 4 On load from the database, I simply order by order_value. By drag 'n drop, he should be able to move apples so that it appears at the top of the list.. itemname| order value (int) --------+--------------------- apples | 4 salad | 1 mango | 2 orange | 3 Ok. So now internally I have to update EVERY LIST ITEM! If the list has 20 or 100 items, that's a lot of updates for a simple drag operation. itemname| order value (int) --------+--------------------- apples | 1 salad | 2 mango | 3 orange | 4 I'd rather do it with only one update. One way I thought of is if "internal Order" is a double value. itemname| order value (double) --------+--------------------- salad | 1.0 mango | 2.0 orange | 3.0 apples | 4.0 SO after the drag n' drop operation, I assign apples has a value that is less than the item it is to appear in front of: itemname| order value (double) --------+--------------------- apples | 0.5 salad | 1.0 mango | 2.0 orange | 3.0 .. and if an item is dragged into the middle somewhere, its order_value is bigger than the one it appears after .. here I moved orange to be between salad and mango: itemname| order value (double) --------+--------------------- apples | 0.5 salad | 1.0 orange | 1.5 mango | 2.0 Any thoughts on better ways to do this?

    Read the article

  • Tunnel Failed at the time of Upload file to FTP

    - by Karthick
    File upload is works fine from my simulator (blackberry 8830).It upload the file to FTP Server. But in the device when I try to upload file to FTP server it gives the alert “Tunnel Failed “. I am using StreamConnection sc = (StreamConnection) Connector.open(url); How to solve this issue. Can anyone help me???

    Read the article

  • How do I restrict accepting only one type in my generic method?

    - by kunjaan
    I have a generic function foo, which accepts any type and prints them out. public static <T> T foo(T... arg) { List<T> foo = Arrays.asList(arg); for (T t : foo) { System.out.println(t); } return null; } How do I make sure that the arguments received are of only 1 type. For example, {1,'a',3} should be invalid. It should either be all numbers or all characters.

    Read the article

  • Shortest distance between two line segments

    - by Frank
    I need a function to find the shortest distance between two line segments. A line segment is defined by two endpoints. So for example one of my line segments (AB) would be defined by the two points A (x1,y1) and B (x2,y2) and the other (CD) would be defined by the two points C (x1,y1) and D (x2,y2). Feel free to write the solution in any language you want and I can translate it into javascript. Please keep in mind my geometry skills are pretty rusty. I have already seen http://stochastix.wordpress.com/2008/12/28/distance-between-two-lines/ and I am not sure how to translate this into a function. Thank you so much for help.

    Read the article

  • row convert to column in sql 2008

    - by jay
    create table #cusphone(cusid int,cusph1 int) insert into #cusphone values(1,48509) insert into #cusphone values(1,48508) insert into #cusphone values(1,48507) insert into #cusphone values(2,48100) out put 1 48509 48508 48507 2 48100 null null

    Read the article

  • Populate JOIN into a list in one database query

    - by axio
    I am trying to get the records from the 'many' table of a one-to-many relationship and add them as a list to the relevant record from the 'one' table. I am also trying to do this in a single database request. Code derived from http://stackoverflow.com/questions/1580199/linq-to-sql-populate-join-result-into-a-list almost achieves the intended result, but makes one database request per entry in the 'one' table which is unacceptable. That failing code is here: var res = from variable in _dc.GetTable<VARIABLE>() select new { x = variable, y = variable.VARIABLE_VALUEs }; However if I do a similar query but loop through all the results, then only a single database request is made. This code achieves all goals: var res = from variable in _dc.GetTable<VARIABLE>() select variable; List<GDO.Variable> output = new List<GDO.Variable>(); foreach (var v2 in res) { List<GDO.VariableValue> values = new List<GDO.VariableValue>(); foreach (var vv in v2.VARIABLE_VALUEs) { values.Add(VariableValue.EntityToGDO(vv)); } output.Add(EntityToGDO(v2)); output[output.Count - 1].VariableValues = values; } However the latter code is ugly as hell, and it really feels like something that should be do-able in a single linq query. So, how can this be done in a single linq query that makes only a single database query? In both cases the table is set to preload using the following code: _dc = _db.CreateLinqDataContext(); var loadOptions = new DataLoadOptions(); loadOptions.LoadWith<VARIABLE>(v => v.VARIABLE_VALUEs); _dc.LoadOptions = loadOptions; I am using .NET 3.5, and the database back-end was generated using SqlMetal.

    Read the article

  • Calling Facebook API without authenticating user/"connecting"

    - by Andy
    Hi, I am working with facebook's API and I want to call the links.prevew method. http://wiki.developers.facebook.com/index.php/Links.preview Is it possible to call this method without having my user authenticate or "connect"? For example, not all of my users have hooked up their facebook accounts to my website, but I still want to use this API method. I am getting the following error: Fatal error: Uncaught Exception: 453: A session key is required for calling this method thrown in /public_html/libs/facebook.php on line 413 But on the wiki it says that the method does not require a session key? If it is not possible to make API calls without such a key, is there anyway I can make calls on behalf of my account or my applications account (rather then a users account)? Any help is appreciated, thanks!

    Read the article

  • Using generics in F# to create an EnumArray type

    - by Matthew
    I've created an F# class to represent an array that allocates one element for each value of a specific enum. I'm using an explicit constructor that creates a dictionary from enum values to array indices, and an Item property so that you can write expressions like: let my_array = new EnumArray<EnumType, int> my_array.[EnumType.enum_value] <- 5 However, I'm getting the following obscure compilation error at the line marked with '// FS0670' below. error FS0670: This code is not sufficiently generic. The type variable ^e when ^e : enum<int> and ^e : equality and ^e : (static member op_Explicit : ^e -> int) could not be generalized because it would escape its scope. I'm at a loss - can anyone explain this error? type EnumArray< 'e, 'v when 'e : enum<int> and 'e : equality and ^e : (static member op_Explicit : ^e -> int) > = val enum_to_int : Dictionary<'e, int> val a : 'v array new() as this = { enum_to_int = new Dictionary<'e, int>() a = Array.zeroCreate (Enum.GetValues(typeof<'e>).Length) } then for (e : obj) in Enum.GetValues(typeof<'e>) do this.enum_to_int.Add(e :?> 'e, int(e :?> 'e)) member this.Item with get (idx : 'e) : 'v = this.a.[this.enum_to_int.[idx]] // FS0670 and set (idx : 'e) (c : 'v) = this.a.[this.enum_to_int.[idx]] <- c

    Read the article

  • Convert string to GUID with sscanf

    - by Andy Li
    I'm trying to convert a string to GUID with sscanf: GUID guid; sscanf( "11111111-2222-3333-4455-667788995511", "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &guid.Data1, &guid.Data2, &guid.Data3, &guid.Data4[0], &guid.Data4[1], &guid.Data4[2], &guid.Data4[3], &guid.Data4[4], &guid.Data4[5], &guid.Data4[6], &guid.Data4[7]); However, in runtime, it fails and exits with "Error: Command failed". Why? How to fix it? I do not want to compile with /clr so cannot use System.

    Read the article

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