Search Results

Search found 1913 results on 77 pages for 'paul huff'.

Page 42/77 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • How to get Netty websocket client example working

    - by Paul Butcher
    I'm struggling to get the netty example websocket client working. I've compiled successfully with 4.0.0.Alpha8, but when I try to connect to a server (also a netty example) I get: Exception in thread "main" io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid handshake response upgrade: websocket at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13.finishHandshake(WebSocketClientHandshaker13.java:204) which makes no sense to me whatsoever, given that this piece of code reads: String upgrade = response.getHeader(Names.UPGRADE); if (!Values.WEBSOCKET.equalsIgnoreCase(upgrade)) { throw new WebSocketHandshakeException("Invalid handshake response upgrade: " + response.getHeader(Names.UPGRADE)); } And as the message in the exception demonstrates, the Upgrade header does contain websocket as expected. Any idea what's going on?

    Read the article

  • running shell commands with gnu clisp

    - by Paul Nathan
    I'm trying to create a "system" command for clisp that works like this (setq result (system "pwd")) ;;now result is equal to /my/path/here I have something like this: (defun system (cmd) (ext:run-program :output :stream)) But, I am not sure how to transform a stream into a string. I've reviewed the hyperspec and google more than a few times.

    Read the article

  • javascript parse parenthesis

    - by Paul
    I need parse a string inside a parenthesis, which looks like (A, B, C), where A, B, and C are string that can contain any legal JavaScript code. For example, B might be a very long string with nested structures similar to (A, B, C). What would be the best way to parse such a string?

    Read the article

  • Eclipse CDT: cannot debug or terminate application

    - by Paul Lammertsma
    I have Eclipse set up fairly nicely to run the G++ compiler through Cygwin. Even the character encoding is set up correctly! There still seems to be something wrong with my configuration: I can't debug. The pause button in the debug view is simply disabled, and no threads appear in my application tree. It seems that gdb is simply not communicating with Eclipse. Presently, I have the debug settings as follows: Debugger: "Cygwin gdb Debugger" GDB debugger: gdb GDB command file: .gdbinit Protocol: Default I should mention here that I have no idea what .gdbinit does; in my project it is merely an empty file. What is wrong with my configuration? Debugging When attempting to terminate the application in debug mode, Eclipse displays the following error: Target request failed: failed to interrupt. I can't kill the process, either; I have to kill its parent gdb.exe, which in turn kills my application. Running When running it normally, a bunch of kill.exes are called, doing nothing, while Eclipse displays the following error: Terminate failed. I can kill FaceDetector.exe from the task manager. Process Explorer This is what it looks like in Process Explorer (debugging left, running right):

    Read the article

  • C#/Java: Proper Implementation of CompareTo when Equals tests reference identity

    - by Paul A Jungwirth
    I believe this question applies equally well to C# as to Java, because both require that {c,C}ompareTo be consistent with {e,E}quals: Suppose I want my equals() method to be the same as a reference check, i.e.: public bool equals(Object o) { return this == o; } In that case, how do I implement compareTo(Object o) (or its generic equivalent)? Part of it is easy, but I'm not sure about the other part: public int compareTo(Object o) { if (! (o instanceof MyClass)) return false; MyClass other = (MyClass)o; if (this == other) { return 0; } else { int c = foo.CompareTo(other.foo) if (c == 0) { // what here? } else { return c; } } } I can't just blindly return 1 or -1, because the solution should adhere to the normal requirements of compareTo. I can check all the instance fields, but if they are all equal, I'd still like compareTo to return a value other than 0. It should be true that a.compareTo(b) == -(b.compareTo(a)), and the ordering should stay consistent as long as the objects' state doesn't change. I don't care about ordering across invocations of the virtual machine, however. This makes me think that I could use something like memory address, if I could get at it. Then again, maybe that won't work, because the Garbage Collector could decide to move my objects around. hashCode is another idea, but I'd like something that will be always unique, not just mostly unique. Any ideas?

    Read the article

  • Ext.Viewport with Menu in North Region problem...

    - by Paul
    Hello... I have a Ext.Viewport in my page... In North region, I have a Dropdown Menu... But When I mouse over a menu item, the menu items drop down but the items appear below the Center region panel. I have been unable to get this to work. I tried setting the z-index but no luck at all. Help? Thanks

    Read the article

  • Ruby socket server thread question: how to send to all clients?

    - by Paul
    I'm making a TCP socket server(ruby). A thread is created for each connected client. At some point I try to send data to all connected clients. The thread aborts on exception while trying.(ruby 1.8.7) require 'socket' # I test it home right now server = TCPServer.new('localhost', 12345); while(session = server.accept) #Here is the thread being created Thread.new(session) do |s| while(msg = s.gets) #Here is the part that causes the error Thread.list.each { |aThread| if aThread != Thread.current #So what I want it to do is to echo the message from one client to all others #But for some reason it doesn't, and aborts on the following string aThread.print "#{msg}\0" end } end end Thread.abort_on_exception = true end What am I doing wrong?

    Read the article

  • How to "smart resize" a displayed image to original aspect ratio

    - by Paul Sasik
    I have an application in which end-users can size and position images in a designer. Since the spec calls for the image to be "stretched" to the containing control, the end user can end up with an awkwardly stretched image. To help the user with image sizing I am thinking of implementing a smart resizer function which would allow the the user to easily fix the aspect ratio of the picture so that it no longer appears stretched. The quick way to solve this is to actually provide two options: 1) scale from width 2) scale from height. The user chooses the method and the algorithm adjusts the size of the picture by using the original aspect ratio. For example: A picture is displayed as 200x200 on the designer but the original image is 1024x768 pixels. The user chooses "Smart Size from width" and the new size becomes ~200x150 since the original aspect ratio is ~1.333 That's OK, but how could I make the algorithm smarter and not bother the user by asking which dimension the recalculation should be based on?

    Read the article

  • SmartGwt DateItem useTextField=true - how to make text entry field UNeditable

    - by Paul
    Since I can't figure out how to solve my problem presented here I'm thinking for the moment at a temporary solution. I have a smartgwt DateItem widget: DateItem date = new DateItem("Adate"); date.setWidth(120); date.setWrapTitle(false); date.setAttribute("useTextField", true); date.setAttribute("inputFormat", "yyyy/MM/dd"); date.setAttribute("displayFormat", "toJapanShortDate"); Because the attribute useTextField is set to true we can see the text entry field. How can I make this text entry field to be uneditable. Actually I want to have only the possibility to choose the date from calendar and not to change it manually. Resolved - the issue exposed above - thanks to @RAS user. TextItem textItem = new TextItem(); textItem.setAttribute("readOnly", true); date.setAttribute("textFieldProperties", textItem); Related link But I have now another issue: The date chooser won't show the date on the text field but Today's date. For example, enter 30/05/2009 on the text field, go to another field, then come back on click on the date chooser and the selected day will be Today's date instead on June 30th, 2009. Which is the reason for this? Can this be solved? Also let's say I let to the user to opportunity to manually modify the date - can I put some validators on it? Thank you.

    Read the article

  • Tinyurl API Example - Am i doing it right :D

    - by Paul Weber
    Hi ... we use super-long Hashes for the Registration of new Users in our Application. The Problem is that these Hashes break in some Email Clients - making the Links unusable. I tried implementing the Tinyurl - API, with a simple Call, but i think it times out sometimes ... sometimes the mail does not reach the user. I updated the Code, but now the URL is never converted. Is Tinyurl really so slow or am i doing something wrong? (I mean hey, 5 Seconds is much in this Times) Can anybody recommend me a more reliable service? All my Fault, forgot a false in the fopen. But i will leave this sample of code here, because i often see this sample, wich i think does not work very reliable: return file_get_contents('http://tinyurl.com/api-create.php?url='.$u); This is the - i think fully working sample. I would like to hear about Improvements. static function gettinyurl( $url ) { $context = stream_context_create( array( 'http' => array( 'timeout' => 5 // 5 Seconds should be enough ) ) ); // get tiny url via api-create.php $fp = fopen( 'http://tinyurl.com/api-create.php?url='.$url, 'r', $context); // open (read) api-create.php with long url as get parameter if( $fp ) { // check if open was ok $tinyurl = fgets( $fp ); // read response if( $tinyurl && !empty($tinyurl) ) // check if response is ok $url = $tinyurl; // set response as url fclose( $fp ); // close connection } // return return $url; // return (tiny) url }

    Read the article

  • Static Class Variables in Dynamic Library and Main Program

    - by Paul
    I am working on a project that has a class 'A' that contains a static stl container class. This class is included in both my main program and a .so file. The class uses the default(implicit, not declared) constructor/destructor. The main program loads the .so file using dlopen() and in its destructor, calls dlclose(). The program crashes after main exits when glibc calls the destructor for the static class member variable. The problem appears to be that when dlclose() is called, the destructor for the static variable is called, then when main exits() glibc also calls the destructor, resulting in a double free. I have 2 questions, namely: 1) In this particular case, why are there not two copies of the static variable(yes i know that sounds somewhat ridiculous, but since both the main program and .so file have a separately compiled 'A', shouldn't they each have one?) 2) Is there any way to resolve this issue without re-writing class 'A' to not contain static member variables?

    Read the article

  • javascript AOP advice to statements

    - by Paul
    Some javascript libraries, such as JQuery and Dojo, provide AOP APIs that can introduce before, after, or around advice to a function. Just wondering whether there is any javascript AOP libraries can introduce such advices to an individual statement?

    Read the article

  • fullcalendar : updating option function callbacks after init

    - by Paul Maneesilasan
    Ok, so I have a problem with setting options whose values are callback functions when I try to set them after plugin initialization. I think this would be a common behavior, to dynamically set event callback after init'ing the calendar. Here is a snipit of code: $(document).ready(function() { $('#calendar').fullCalendar({ editable: false ,events:[{"title":"meeting.title","start":"2010-05-21 15:58:16 UTC"},{"title":"meeting.title","start":"2010-05-24 15:58:16", "url":"http://google.com"}] /* ,eventClick: function(event) { if (event.url) { window.open(event.url); return false; } } */ }); $('#calendar').fullCalendar('options', 'eventClick', function(event) { if (event.url) { window.open(event.url); return false; } }); }); You can see that I have setting the eventClick function as an init option commented out. If I do it that way, it works fine. However if I try to set it after the init, it doesn't work :( Is the some other way to do this? Or am I stuck with having to set the behavior upfront?

    Read the article

  • Recommended build system for latex?

    - by Paul Biggar
    I'm trying to figure out the best build system for latex. Currently, I use latex-makefile, editing in vim, and viewing changes in Okular or gv. The major problem is that it sometimes gets hides errors on me, and I have to run latex manually. The major advantages are that it does all the iteration I need, and offers both pdf and ps simply. If you have experience with latex-mk vim-latex kile lyx miktex latex-makefile the ultimate latex makefile rubber any others I havent come across Would you recommend them, and why/why not?

    Read the article

  • jQuery - ASPX Security libraries

    - by Jean Paul
    Hello. I would like to know if there's a combo like jCryption ([jCryption]) - PHP but for jQuery - ASPX. I mean, I have been searching for a combo to send data both ways (Client-server, server-client) with jQuery to ASPX. The best I found was jCryption that sends data from JavaScrpit to PHP. I need a combo to send data from JavaScrpit to ASPX. Any ideas?? PD: Please don't tell me to use HTTPS, it's not enough to ensure the data communication on a client - server application.

    Read the article

  • How to have struct members accessible in different ways

    - by Paul J. Lucas
    I want to have a structure token that has start/end pairs for position, sentence, and paragraph information. I also want the members to be accessible in two different ways: as a start/end pair and individually. Given: struct token { struct start_end { int start; int end; }; start_end pos; start_end sent; start_end para; typedef start_end token::*start_end_ptr; }; I can write a function, say distance(), that computes the distance between any of the three start/end pairs like: int distance( token const &i, token const &j, token::start_end_ptr mbr ) { return (j.*mbr).start - (i.*mbr).end; } and call it like: token i, j; int d = distance( i, j, &token::pos ); that will return the distance of the pos pair. But I can also pass &token::sent or &token::para and it does what I want. Hence, the function is flexible. However, now I also want to write a function, say max(), that computes the maximum value of all the pos.start or all the pos.end or all the sent.start, etc. If I add: typedef int token::start_end::*int_ptr; I can write the function like: int max( list<token> const &l, token::int_ptr p ) { int m = numeric_limits<int>::min(); for ( list<token>::const_iterator i = l.begin(); i != l.end(); ++i ) { int n = (*i).pos.*p; // NOT WHAT I WANT: It hard-codes 'pos' if ( n > m ) m = n; } return m; } and call it like: list<token> l; l.push_back( i ); l.push_back( j ); int m = max( l, &token::start_end::start ); However, as indicated in the comment above, I do not want to hard-code pos. I want the flexibility of accessible the start or end of any of pos, sent, or para that will be passed as a parameter to max(). I've tried several things to get this to work (tried using unions, anonymous unions, etc.) but I can't come up with a data structure that allows the flexibility both ways while having each value stored only once. Any ideas how to organize the token struct so I can have what I want? Attempt at clarification Given struct of pairs of integers, I want to be able to "slice" the data in two distinct ways: By passing a pointer-to-member of a particular start/end pair so that the called function operates on any pair without knowing which pair. The caller decides which pair. By passing a pointer-to-member of a particular int (i.e., only one int of any pair) so that the called function operates on any int without knowing either which int or which pair said int is from. The caller decides which int of which pair. Another example for the latter would be to sum, say, all para.end or all sent.start. Also, and importantly: for #2 above, I'd ideally like to pass only a single pointer-to-member to reduce the burden on the caller. Hence, me trying to figure something out using unions.

    Read the article

  • django admin site make CharField a PasswordInput

    - by Paul
    I have a Django site in which the site admin inputs their Twitter Username/Password in order to use the Twitter API. The Model is set up like this: class TwitterUser(models.Model): screen_name = models.CharField(max_length=100) password = models.CharField(max_length=255) def __unicode__(self): return self.screen_name I need the Admin site to display the password field as a password input, but can't seem to figure out how to do it. I have tried using a ModelAdmin class, a ModelAdmin with a ModelForm, but can't seem to figure out how to make django display that form as a password input...

    Read the article

  • Best way to ensure accurate timing with C

    - by Paul
    I am a beginning C programmer (though not a beginning programmer) looking to dive into a project to teach myself C. My project is music-based, and because of this I am curious whether there are any 'best practices' per-se, when it comes to timing functions.

    Read the article

  • Sync Framework: SqlSyncProvider ItemConflicting vs ApplyChangeFailed

    - by Paul Smith
    I'm trying to use design a syncronisation application that syncs changes between different SQL Server databases. I came up with a design based around receiving the ItemConflicting event, storing the knowledge associated with the conflict, and resolving all conflicts off-line. However, it seems that I can only get the ApplyChangeFailed event to fire. Is there some reason why SqlSyncProvider does not use the ItemConflicting event? Am I just hooking up to the event wrongly? The reason I care is that the ItemConlficting event allows me to simply log the conflict and continue with the rest of the synchronisation in a way that I can't seem to achieve with the ApplychangeFailed event.

    Read the article

  • Problem with MongoDB Ruby Driver

    - by Paul
    I'm on Ubuntu, and I've done install gem mongo which reported Successfully installed bson-1.0 Successfully installed mongo-1.0 2 gems installed I've started mongod Now I cd to the mongo gem directory and try > ruby examples/simple.rb and I get the error ./examples/../lib/mongo.rb:31:in `require': no such file to load -- bson (LoadError) from ./examples/../lib/mongo.rb:31 from examples/simple.rb:3:in `require' from examples/simple.rb:3 which I can't make sense of, since the bson gem is installed > gem list *** LOCAL GEMS *** bson (1.0) bson_ext (1.0) mongo (1.0) rack (1.1.0) sinatra (1.0) Any suggestions what's up here?

    Read the article

  • Text not encoded properly.

    - by Paul Knopf
    In my masterpage, I have the following in the header. This allows me to put special characters into my website. The problem is that when javascript tries to load (on the client) special characters, I get that weird box. Example url... http://89.184.149.229/Sandportal/vinnan/trol-lna/monica-sakk--vikuskiftinum Text is below the 4 stars (mid left). Any help is greatly appreciated.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >