Search Results

Search found 588 results on 24 pages for 'ian ringrose'.

Page 14/24 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Is there any working implementation of reverse mode automatic differentiation for Haskell?

    - by Ian Fiske
    The closest-related implementation in Haskell I have seen is the forward mode at http://hackage.haskell.org/packages/archive/fad/1.0/doc/html/Numeric-FAD.html. The closest related related research appears to be reverse mode for another functional language related to Scheme at http://www.bcl.hamilton.ie/~qobi/stalingrad/. I see reverse mode in Haskell as kind of a holy grail for a lot of tasks, with the hopes that it could use Haskell's nested data parallelism to gain a nice speedup in heavy numerical optimization.

    Read the article

  • Python Socket Getting Connection Reset

    - by Ian
    I created a threaded socket listener that stores newly accepted connections in a queue. The socket threads then read from the queue and respond. For some reason, when doing benchmarking with 'ab' (apache benchmark) using a concurrency of 2 or more, I always get a connection reset before it's able to complete the benchmark (this is taking place locally, so there's no external connection issue). class server: _ip = '' _port = 8888 def __init__(self, ip=None, port=None): if ip is not None: self._ip = ip if port is not None: self._port = port self.server_listener(self._ip, self._port) def now(self): return time.ctime(time.time()) def http_responder(self, conn, addr): httpobj = http_builder() httpobj.header('HTTP/1.1 200 OK') httpobj.header('Content-Type: text/html; charset=UTF-8') httpobj.header('Connection: close') httpobj.body("Everything looks good") data = httpobj.generate() sent = conn.sendall(data) def http_thread(self, id): self.log("THREAD %d: Starting Up..." % id) while True: conn, addr = self.q.get() ip, port = addr self.log("THREAD %d: responding to request: %s:%s - %s" % (id, ip, port, self.now())) self.http_responder(conn, addr) self.q.task_done() conn.close() def server_listener(self, host, port): self.q = Queue.Queue(0) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind( (host, port) ) sock.listen(5) for i in xrange(4): #thread count thread.start_new(self.http_thread, (i+1, )) while True: self.q.put(sock.accept()) sock.close() server('', 9999) When running the benchmark, I get totally random numbers of good requests before it errors out, usually between 4 and 500. Edit: Took me a while to figure it out, but the problem was in sock.listen(5). Because I was using apache benchmark with a higher concurrency (5 and up) it was causing the backlog of connections to pile up, at which point the connections started getting dropped by the socket.

    Read the article

  • IWebBrowser: How to specify the encoding when loading html from a stream?

    - by Ian Boyd
    Using the concepts from the sample code provided by Microsoft for loading HTML content into an IWebBrowser from an IStream using the web browser's IPersistStreamInit interface: HRESULT LoadWebBrowserFromStream(IWebBrowser* pWebBrowser, IStream* pStream) { [snip] } How can one specify the encoding of the html inside the IStream? The IStream will contain a series of bytes, but the problem is what do those bytes represent? They could, for example, contain bytes where: each byte represents a character from the current Windows code-page (e.g. 1252) each byte could represent a character from the ISO-8859-1 character set the bytes could represent UTF-8 encoded characters every 2 bytes could represent a character, using UTF-16 encoding In my particular case, i am providing the IWebBrowser an IStream that contains a series of double-bytes characters (UTF-16), but the browser (incorrectly) believes that UTF-8 encoding is in effect. This results in garbled characters.

    Read the article

  • IE8 CSS Table Effect

    - by Ian
    I've been trying to make this cross browser (specifically IE), but I do not want to use tables. I will not be able to specify the container width with CSS because its contents (the image) will dynamically change with Javascript, so I need the container to 'auto-size' horizontally. The desired effect would be a centered image with two sets of text (one of the left and one of the left) directly underneath the image, aligned to it's inner edges. Example (Doesn't work on IE): http://pastehtml.com/view/19pbyw9.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> #container { display:table; } </style> </head> <body> <center> <div id="container"> <img src="http://www.google.com/intl/en_ALL/images/srpr/logo1w.png" alt="" /><br /> <span style="float: left;">test</span> <span style="float: right; text-align: right;">test2</span> </div> </center> </body> </html>

    Read the article

  • ADO/SQL Server: What is the error code for "timeout expired"?

    - by Ian Boyd
    i'm trying to trap a "timeout expired" error from ADO. When a timeout happens, ADO returns: Number: 0x80040E31 (DB_E_ABORTLIMITREACHED in oledberr.h) SQLState: HYT00 NativeError: 0 The NativeError of zero makes sense, since the timeout is not a function of the database engine (i.e. SQL Server), but of ADO's internal timeout mechanism. The Number (i.e. the COM hresult) looks useful, but the definition of DB_E_ABORTLIMITREACHED in oledberr.h says: Execution stopped because a resource limit was reached. No results were returned. This error could apply to things besides "timeout expired" (some potentially server-side), such as a governor that limits: CPU usage I/O reads/writes network bandwidth and stops a query. The final useful piece is SQLState, which is a database-independent error code system. Unfortunately the only reference for SQLState error codes i can find have no mention of HYT00. What to do? What do do? Note: i can't trust 0x80040E31 (DB_E_ABORTLIMITREACHED) to mean "timeout expired", anymore than i could trust 0x80004005 (E_UNSPECIFIED_ERROR) to mean "Transaction was deadlocked on lock resources with another process and has been chosen as the deadlock victim". My pseudo-question becomes: does anyone have documentation on what the SQLState "HYT000" means? And my real question still remains: How can i specifically trap an ADO timeout expired exception thrown by ADO? Gotta love the questions where the developer is trying to "do the right thing", but nobody knows how to do the right thing. Also gotta love how googling for DB_E_ABORTLIMITREACHED and this question is #9, with MSDN nowhere to be found. Update 3 From the OLEdb ICommand.Execute reference: DB_E_ABORTLIMITREACHED Execution has been aborted because a resource limit has been reached. For example, a query timed out. No results have been returned. "For example", meaning not an exhaustive list.

    Read the article

  • Using code in both Actionscript3 and Javascript

    - by Ian
    Here's an interesting architectural query. I have a piece of code that needs to run on the server (under Node.js) and on the client (in a Flash 10 app written with Actionscript 3). The code is mostly fairly intricate object manipulation, it doesn't make any API calls, and works fine in both contexts. So far the project is just a demo, so I've been happy to copy and paste the code into both places. But it might be quite interesting to move forward with this. So how would you do it? I assume there is no easy way to get the Flash SDK (has to build without an IDE) to read and do something useful with a .js file. My only thought is that I could write a code-generator that takes the .js file and places it in an ActionScript wrapper. Are there any obvious approaches that I've missed? Just to pre-empt an obvious answer, I know about cross-platform languages like HaXe.

    Read the article

  • Delphi: How to set the default project in a project group?

    - by Ian Boyd
    i have two projects in a project group: ProjectA ProjectB Whenever i open the ProjectGroup.bpg in Delphi, it always starts with the 2nd project as the active one: ProjectA ProjectB And every time i have to flip it to the the "real" project: ProjectA ProjectB How can i make ProjectA the default project that opens with the project group? ProjectGroup.bpg #------------------------------------------------------------------------------ VERSION = BWS.01 #------------------------------------------------------------------------------ !ifndef ROOT ROOT = $(MAKEDIR)\.. !endif #------------------------------------------------------------------------------ MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** DCC = $(ROOT)\bin\dcc32.exe $** BRCC = $(ROOT)\bin\brcc32.exe $** #------------------------------------------------------------------------------ PROJECTS = ProjectA.exe ProjectB.exe #------------------------------------------------------------------------------ default: $(PROJECTS) #------------------------------------------------------------------------------ ProjectA.exe: ProjectA.dpr $(DCC) ProjectB.exe: childfolder\ProjectB.dpr $(DCC)

    Read the article

  • C#, WPF. Length of string that will fit in a specific width.

    - by Ian
    Hi, I'm sure I'm missing something obvious, I have an area in which I intend to draw text. I know its (the area) height and width. I wish to know how many characters/Words will fit in the width, characters preferably. Second question, If the line is too long I'll want to draw a second line, so I guess I need to get the height of the text as well, including what ever it considers the right vertical padding? I'd also rather like to know the inverse, i.e. how many characters I can fit in a specific width. I assume the fact that WPF isn't constrained to pixels will have some bearing on the answer? Ultimately I'm planning on wrapping text around irregular shaped images embedded in the text. Any pointers in the right direction would be great. Thanks

    Read the article

  • How to sed search and replace without changing ownership

    - by Ian
    I found this command line search and replace example: find . -type f -print0 | xargs -0 sed -i 's/find/replace/g' It worked fine except it changed the date and file ownership on EVERY file it searched through, even those that did not contain the search text. What's a better solution to this task? Thanks.

    Read the article

  • Best way to model Installation logic/flow

    - by Ian
    Hi All, We are currently working on designing the installer for our product. We are currently on the design phase and I'm wondering what is the best diagram (UML or not) to use when modeling installation logic or flow? Currently, we are using the good'ol flowchart. Thanks!

    Read the article

  • Redis - Records Fall Off

    - by Ian
    With memcache, when you exceed the available ram, it automatically drops the oldest records off the end of the stack.. Is there a way to do this with redis? I'm trying to find ways to avoid running in to a write error (when there's no more available ram), other than setting a timeout. The only reason the timeout isn't useful, it because it doesn't guaranty the ability to write.

    Read the article

  • Can I recover lost commits in a SVN repository using a local tracking git-svn branch?

    - by Ian Stevens
    A SVN repo I use git-svn to track was recently corrupted and a backup was recovered. However, a week's worth of commits were lost in the recovery. Is it possible to recover those lost commits using git-svn dcommit on my local git repo? Is it sufficient to run git-svn dcommit with the SHA1 of the last recovered commit in SVN? eg. > svn info http://tracked-svn/trunk | sed -n "s/Revision: //p" 252 > git log --grep="git-svn-id:.*@252" --format=oneline | cut -f1 -d" " 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a > git svn dcommit 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a Or will the git-svn-id need to be stripped from the intended commits? I tried this using --dry-run but couldn't tell whether it would try to submit all commits: > git svn dcommit --verbose --dry-run 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a Committing to http://tracked-svn/trunk ... dcommitted on a detached HEAD because you gave a revision argument. The rewritten commit is: 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a Thanks for your help.

    Read the article

  • My app crashes after multiple rotates

    - by Ian Rae
    My app is crashing when I try and rotate it more than a couple of times. I first thought it was just the iPhone Simulator, so I loaded the app onto an iPod touch, and it crashed after fewer rotates in a row. I suspect it's a memory leak in one of my rotate methods. The only place I can think that the crash is being caused is in willRotateToInterfaceOrientation:duration:. The only two methods related to rotate that I've added/extended are shouldAutorotateToInterfaceOrientation: and willRotateToInterfaceOrientation:duration and I don't think it's the first because it only contains the two words: return YES;. Here is my willRotateToInterfaceOrientation:duration: method so you can review it and see where the possible memory leak is. -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration { UIFont *theFont; if ((orientation == UIInterfaceOrientationLandscapeLeft) || (orientation == UIInterfaceOrientationLandscapeRight)) { theFont = [yearByYear.font fontWithSize:16.0]; yearByYear.font = theFont; [theview setContentSize:CGSizeMake(460.0f, 635.0f)]; } else { theFont = [yearByYear.font fontWithSize:10.0]; yearByYear.font = theFont; [theview setContentSize:CGSizeMake(300.0f, 460.0f)]; } [theFont release]; } yearByYear is a UITextView theview is a UIScrollView if anyone has any idea of why my app is crashing, I would be greatly appreciative.

    Read the article

  • XSLT: Is there a way to "inherit" canned functionality?

    - by Ian Boyd
    i am once again having to cobble together a bit of XSLT into order to turn generated XML into (rather than simply generating HTML). i'm having huge deja-vu this time again. i'm once again having to solve again basic problems, e.g.: how to convert characters into valid html entity references how to preserve whitespace/carriage returns when converting to html how to convert to HTML as opposed to xhtml how to convert dates from xml format into presentable format how to tear apart strings with substring This is all stuff that i've solved many times before. But every time i come back to XSLT i have to start from scratch, re-inventing the wheel every time. If it were a programming language i would have a library of canned functions and procedures i can call. i would have subroutines to perform the commonly repeated tasks. i would inherit from a base class that already implements the ugly boilerplate stuff. Is there any way in XSLT to grow, expand and improve the ecosystem with canned code?

    Read the article

  • Why is OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true) causing an OCR running error?

    - by Ian Wells
    Hi folks, I am using MODI to read tiff images and do what I need to do with the text. Some images work fine and then other tiff images always cause the method, OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true) to fail. I have researched this and tried different variations such as 'false','false' in the parameter list. I have also tried SYSDEFAULT instead of English but I still get the error. Can anyone please tell me why it would fail on some tiff images and not on others? I have done some research and found this answer: One possible cause is MODI trying to process a file without any recognisable text. A blank document, or one which has only drawings/scribbles and is effectively blank, will cause this exception. Obviously this is not good enough as there is no way I can have an app that decides to OCR some images and not others. I handle the exception, but the OCR object is not then initalised so I can't do what I need to do from there. This is a bloody nightmare! Why can't the method just do it's bloody job and if the image has some unreadable pages then just ignore them? I am using Windows 7 Ultimate and Office 2007 Ultimate. Visual Studio version is 2008 Thanks, IW

    Read the article

  • Any open source back test engine using bloomberg tick-by-tick data?

    - by Ian Xu
    I have a back test on index futures to do. I've finished the test on 1-minute OHLC data and the result is OK. Further I want to opt our tick-by-tick data downloaded from Bloomberg. I have browsed the internet and found that several trading platforms are available for such function but Bloomberg is not in the data source providers list. So I think these are not suitable for my case. I'm wondering whether there is any open-source engine that I may embed to finish the test?

    Read the article

  • w3c validation error with utf-8

    - by ian
    When I try to validate a certain page I get the below error: Sorry, I am unable to validate this document because on line 136 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication. The error was: utf8 "\xFF" does not map to Unicode What exactly does this mean and how can I find out what character is causing the problem? The page is generated dynamically in PHP and a bit large and I am not sure what to look for.

    Read the article

  • Handling XMLHttpRequest to call external application

    - by Ian
    I need a simple way to use XMLHttpRequest as a way for a web client to access applications in an embedded device. I'm getting confused trying to figure out how to make something thin and light that handles the XMLHttpRequests coming to the web server and can translate those to application calls. The situation: The web client using Ajax (ExtJS specifically) needs to send and receive asynchronously to an existing embedded application. This isn't just to have a thick client/thin server, the client needs to run background checking on the application status. The application can expose a socket interface, with a known set of commands, events, and configuration values. Configuration could probably be transmitted as XML since it comes from a SQLite database. In between the client and app is a lighttpd web server running something that somehow handles the translation. This something is the problem. What I think I want: Lighttpd can use FastCGI to route all XMLHttpRequest to an external process. This process will understand HTML/XML, and translate between that and the application's language. It will have custom logic to simulate pushing notifications to the client (receive XMLHttpRequest, don't respond until the next notification is available). C/C++. I'd really like to avoid installing Java/PHP/Perl on an embedded device. So I'll need more low level understanding. How do I do this? Are there good C++ libraries for interpreting the CGI headers and HTML so that I don't have to do any syntax processing, I can just deal with the request/response contents? Are there any good references to exactly what goes on, server side, when handling the XMLHttpRequest and CGI interfaces? Is there any package that does most of this job already, or will I have to build the non-HTTP/CGI stuff from scratch? Thanks for any help! I am really having trouble learning about the server side of these technologies.

    Read the article

  • GCC/X86, Problems with relative jumps

    - by Ian Kelly
    I'm trying to do a relative jump in x86 assembly, however I can not get it to work. It seems that for some reason my jump keeps getting rewritten as an absolute jump or something. A simple example program for what I'm trying to do is this: .global main main: jmp 0x4 ret Since the jmp instruction is 4 bytes long and a relative jump is offset from the address of the jump + 1, this should be a fancy no-op. However, compiling and running this code will cause a segmentation fault. The real puzzler for me is that compiling it to the object level and then disassembling the object file shows that it looks like the assembler is correctly doing a relative jump, but after the file gets compiled the linker is changing it into another type of jump. For example if the above code was in a file called asmtest.s: $gcc -c asmtest.s $objdump -D asmtest.o ... Some info from objdump 00000000 <main>: 0: e9 00 00 00 00 jmp 5 <main+0x5> 5: c3 ret This looks like the assembler correctly made a relative jump, although it's suspicious that the jmp instruction is filled with 0s. I then used gcc to link it then disassembled it and got this: $gcc -o asmtest asmtest.o $objdump -d asmtest ...Extra info and other disassembled functions 08048394 <main>: 8048394: e9 6b 7c fb f7 jmp 4 <_init-0x8048274> 8048399: c3 ret This to me looks like the linker rewrote the jmp statement, or substituted the 5 in for another address. So my question comes down to, what am I doing wrong? Am I specifying the offset incorrectly? Am I misunderstanding how relative jumps work? Is gcc trying to make sure I don't do dangerous things in my code?

    Read the article

  • Python sock.listen(...)

    - by Ian
    All the examples I've seen of sock.listen(5) in the python documentation suggest I should set the max backlog number to be 5. This is causing a problem for my app since I'm expecting some very high volume (many concurrent connections). I set it to 200 and haven't seen any problems on my system, but was wondering how high I can set it before it causes problems.. Anyone know?

    Read the article

  • How do I map common properties in NHibernate

    - by Ian Oakes
    In the database I'm working with, every table repeats the same nine columns and I don't want to have to supply the same properties in each of my entities to map these columns. I've tried adding properties to a common base class and adding them to the sub class's mapping file, but this doesn't work. I've read the documentation around inheritance mapping but this did not help. What is the best way to map columns that repeat accross multiple tables in NHibernate?

    Read the article

  • Delphi: Alternative to using Reset/ReadLn for text file reading

    - by Ian Boyd
    i want to process a text file line by line. In the olden days i loaded the file into a StringList: slFile := TStringList.Create(); slFile.LoadFromFile(filename); for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; Problem with that is once the file gets to be a few hundred megabytes, i have to allocate a huge chunk of memory; when really i only need enough memory to hold one line at a time. (Plus, you can't really indicate progress when you the system is locked up loading the file in step 1). The i tried using the native, and recommended, file I/O routines provided by Delphi: var f: TextFile; begin Reset(f, filename); while ReadLn(f, oneLine) do begin //process the line end; Problem withAssign is that there is no option to read the file without locking (i.e. fmShareDenyNone). The former stringlist example doesn't support no-lock either, unless you change it to LoadFromStream: slFile := TStringList.Create; stream := TFileStream.Create(filename, fmOpenRead or fmShareDenyNone); slFile.LoadFromStream(stream); stream.Free; for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; So now even though i've gained no locks being held, i'm back to loading the entire file into memory. Is there some alternative to Assign/ReadLn, where i can read a file line-by-line, without taking a sharing lock? i'd rather not get directly into Win32 CreateFile/ReadFile, and having to deal with allocating buffers and detecting CR, LF, CRLF's. i thought about memory mapped files, but there's the difficulty if the entire file doesn't fit (map) into virtual memory, and having to maps views (pieces) of the file at a time. Starts to get ugly. i just want Reset with fmShareDenyNone!

    Read the article

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