Search Results

Search found 1059 results on 43 pages for 'jon hopkins'.

Page 21/43 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Cross domain cookie tracking

    - by Jon
    Hi, The company I work for has four domains and I'm trying to set up the cookies, so one cookie can be generated and tracked across all the domains. From reading various posts on here I thought it was possible. I've set up a sub domain on one site, to serve a cookie and 1*1 pixel image to all four sites. But I can't get this working on the other sites. If anyone can clarify that: Its possible? If I'm missing something obvious or a link to a good example? I'm trying to do this server side with PHP. Thanks

    Read the article

  • Tell LINQ Distinct which item to return

    - by Jon
    I understand how to do a Distinct() on a IEnumerable and that I have to create an IEqualityComparer for more advanced stuff however is there a way in which you can tell which duplicated item to return? For example say you have a List<T> List<MyClass> test = new List<MyClass>(); test.Add(new MyClass {ID = 1, InnerID = 4}); test.Add(new MyClass {ID = 2, InnerID = 4}); test.Add(new MyClass {ID = 3, InnerID = 14}); test.Add(new MyClass {ID = 4, InnerID = 14}); You then do: var distinctItems = test.Distinct(new DistinctItemComparer()); class DistinctItemComparer : IEqualityComparer<MyClass> { public bool Equals(MyClass x, MyClass y) { return x.InnerID == y.InnerID;; } public int GetHashCode(MyClassobj) { return obj.InnerID.GetHasCode(); } } This code will return the classes with ID 1 and 3. Is there a way to return the ID matches 2 & 4.

    Read the article

  • Fetch data from multiple MySQL tables

    - by Jon McIntosh
    My two tables look like this: TABLE1 TABLE2 +--------------------+ +--------------------+ |field1|field2|field3| and |field2|field4|field5| +--------------------+ +--------------------+ I am already running a SELECT query for TABLE1, and assorting all of the data into variables: $query = "SELECT * FROM TABLE1 WHERE field2 = 2"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if((!is_bool($result) || $result) && $num_rows) { while($row = mysql_fetch_array($result)) { $field1 = $row['field1']; $field2 = $row['field2']; $field3 = $row['field3']; } } What I want to do is get the data from 'field4' on TABLE2 and add it to my variables. I would want to get field4 WHERE field2 = 2

    Read the article

  • What is the career value in learning ColdFusion?

    - by Jon Cram
    ColdFusion is a language I encounter rather infrequently, however it does turn up from time to time either in job adverts or as .cfm file extensions in URLs. There are possible job opportunities near to where I plan to live for ColdFusion developers. It might be in my interests to have a look at ColdFusion. ColdFusion appears, to me, to be a minority language compared to C#, Java or indeed most popular languages. Don thinks ColdFusion is declining in popularity. Would a ColdFusion position today be more related to the maintenance of legacy code than innovative, creative development, thus less interesting? Is there any long term career value in learning ColdFusion?

    Read the article

  • Is it possible to populate HTML form field data in an iPhone UIWebView using external accessory fram

    - by Jon Smallberries
    I have an iPhone app where I'd like to load a remotely served HTML form into a UIWebView and then populate that form as data becomes available from an external accessory using the "External Accessory Framework." Right now the data is entered by hand. The proposed flow is: Fetch an HTML page containing a form and put it into a UIWebView When data becomes available from the external accessory, populate the form field(s) Submit the form Is it possible to do this by "injecting" data from the external accessory into the UIWebView when all required data has been retrieved from the external accessory? I cannot seem to find any good examples on how to use the external accessory framework to achieve this.

    Read the article

  • Authkit - deferring action for HTTP '401' response to client application

    - by jon
    Form, Redirect and Forward all send an unauthenticated user to a Form on a login page specified within an Authkit middleware application. I'd like to allow a client application to request a service via XHR and then present a custom 'client side' form if a HTTP status code of 401 is returned, which would then post to Authkit for authentication until valid authentication/authorization occured. Specifically, 1) a jquery $.get request might request a resource. 2) if an Authkit cookie check confirmed previous authorization the content would be returned. 3) if not I would like Authkit to simply return the '401 response' (and not redirect to another page, or return a form template) where a client side exception handler would notify the user and present an authentication form. Can Authkit work like this?

    Read the article

  • Returning Index in Enumerable Select

    - by Jon
    I have a List<MyClass> with 2 items which have a SequenceNumber property. If I use this code below the returned index is 0 not 1: var test = TrackingCollection .Where(x => x.SequenceNumber == 2) .Select((item, index) => new { index, item.SequenceNumber }); Is this because that refers to 0 as the index in my new anonymous type or is it some zero index based weirdness that I just need to increment. What I'm after is to return the index in TrackingCollection where the sequence number is 2 or 887 or any other correct index in the original collection...

    Read the article

  • Filter entities that match all pairs

    - by Jon
    I have an entity (let's say Person) with a set of arbitrary attributes with a known subset of values. I need to search for all of these entities that match all my filter conditions. For example, my table structures look like this: Person: id | name 1 | John Doe 2 | Jane Roe 3 | John Smith Attribute: id | attr_name 1 | Sex 2 | Eye Color ValidValue: id | attr_id | value_name 1 | 1 | Male 2 | 1 | Female 3 | 2 | Blue 4 | 2 | Green 5 | 2 | Brown PersonAttributes id | person_id | attr_id | value_id 1 | 1 | 1 | 1 2 | 1 | 2 | 3 3 | 2 | 1 | 2 4 | 2 | 2 | 4 5 | 3 | 1 | 1 6 | 3 | 2 | 4 In JPA, I have entities built for all of these tables. What I'd like to do is perform a search for all entities matching a given set of attribute-value pairs. For instance, I'd like to be able to find all males (John Doe and John Smith), all people with green eyes (Jane Roe or John Smith), or all females with green eyes (Jane Roe). I see that I can already take advantage of the fact that I only really need to match on value_id, since that's already unique and tied to the attr_id. But where can I go from there?

    Read the article

  • Rails ActiveRecord BigNum to JSON

    - by Jon Hoffman
    Hi, I am serializing an ActiveRecord model in rails 2.3.2 to_json and have noticed that BigNum values are serialized to JSON without quotes, however, javascript uses 64 bits to represent large numbers and only ~52(?) of those bits are available for the integer part, the rest are for the exponent. So my 17 digit numbers become rounded off, grrr. Try the following in the Firebug console: console.log(123456789012345678) So, I'm thinking that the json encoder should be smart enough to quote numbers that are too big for the javascript engines to handle. How do I fix up rails to do that? Or, is there a way to override the encoding for a single property on the model (I don't want to_s elsewhere)? Thanks.

    Read the article

  • What is instrumentation?

    - by Jon Seigel
    I've heard this term used a lot in the same context as logging, but I can't seem to find a clear definition of what it actually is. Is it simply a more general class of logging/monitoring tools and activities? Please provide sample code/scenarios when/how instrumentation should be used.

    Read the article

  • DB Designer creates compound primary key

    - by Jon Winstanley
    When adding relationships to a database model in DB Designer 4, a composite primary key is being created every time. So every foreign key I add, I get an extra key added to a composite primary key. I think I must have changed a setting as I don't remember it doing this in the past. Does anyone know how to turn off this feature as I prefer to use a single surrogate primary keys in my database tables?

    Read the article

  • Custom StyleCop rule not working as expected

    - by Jon
    I'm trying to write a StyleCop rule that disallows underscores anywhere. There is a rule to say that you cant have public string _myfield but I don't want underscores anywhere ie/method names, property names, method parameters. Below is my code but its not working properly. Can anyone suggest why? using Microsoft.StyleCop; using Microsoft.StyleCop.CSharp; namespace DotNetExtensions.StyleCop.Rules { [SourceAnalyzer(typeof(CsParser))] public class NoUnderScores : SourceAnalyzer { public override void AnalyzeDocument(CodeDocument document) { CsDocument csdocument = (CsDocument) document; if (csdocument.RootElement != null && !csdocument.RootElement.Generated) csdocument.WalkDocument(new CodeWalkerElementVisitor<object>(this.VisitElement), null, null); } private bool VisitElement(CsElement element, CsElement parentElement, object context) { if (!element.Generated) { foreach(var token in element.Tokens) { if (token.Text.Contains("_")) AddViolation(element, "NoUnderScores"); } } return true; } } }

    Read the article

  • Implementing a robust async stream reader

    - by Jon
    I recently provided an answer to this question: C# - Realtime console output redirection. As often happens, explaining stuff (here "stuff" was how I tackled a similar problem) leads you to greater understanding and/or, as is the case here, "oops" moments. I realized that my solution, as implemented, has a bug. The bug has little practical importance, but it has an extremely large importance to me as a developer: I can't rest easy knowing that my code has the potential to blow up. Squashing the bug is the purpose of this question. I apologize for the long intro, so let's get dirty. I wanted to build a class that allows me to receive input from a Stream in an event-based manner. The stream, in my scenario, is guaranteed to be a FileStream and there is also an associated StreamReader already present to leverage. The public interface of the class is this: public class MyStreamManager { public event EventHandler<ConsoleOutputReadEventArgs> StandardOutputRead; public void StartSendingEvents(); public void StopSendingEvents(); } Obviously this specific scenario has to do with a console's standard output, but that is a detail and does not play an important role. StartSendingEvents and StopSendingEvents do what they advertise; for the purposes of this discussion, we can assume that events are always being sent without loss of generality. The class uses these two fields internally: protected readonly StringBuilder inputAccumulator = new StringBuilder(); protected readonly byte[] buffer = new byte[256]; The functionality of the class is implemented in the methods below. To get the ball rolling: public void StartSendingEvents(); { this.stopAutomation = false; this.BeginReadAsync(); } To read data out of the Stream without blocking, and also without requiring a carriage return char, BeginRead is called: protected void BeginReadAsync() { if (!this.stopAutomation) { this.StandardOutput.BaseStream.BeginRead( this.buffer, 0, this.buffer.Length, this.ReadHappened, null); } } The challenging part: BeginRead requires using a buffer. This means that when reading from the stream, it is possible that the bytes available to read ("incoming chunk") are larger than the buffer. Since we are only handing off data from the stream to a consumer, and that consumer may well have inside knowledge about the size and/or format of these chunks, I want to call event subscribers exactly once for each chunk. Otherwise the abstraction breaks down and the subscribers have to buffer the incoming data and reconstruct the chunks themselves using said knowledge. This is much less convenient to the calling code, and detracts from the usefulness of my class. To this end, if the buffer is full after EndRead, we don't send its contents to subscribers immediately but instead append them to a StringBuilder. The contents of the StringBuilder are only sent back whenever there is no more to read from the stream (thus preserving the chunks). private void ReadHappened(IAsyncResult asyncResult) { var bytesRead = this.StandardOutput.BaseStream.EndRead(asyncResult); if (bytesRead == 0) { this.OnAutomationStopped(); return; } var input = this.StandardOutput.CurrentEncoding.GetString( this.buffer, 0, bytesRead); this.inputAccumulator.Append(input); if (bytesRead < this.buffer.Length) { this.OnInputRead(); // only send back if we 're sure we got it all } this.BeginReadAsync(); // continue "looping" with BeginRead } After any read which is not enough to fill the buffer, all accumulated data is sent to the subscribers: private void OnInputRead() { var handler = this.StandardOutputRead; if (handler == null) { return; } handler(this, new ConsoleOutputReadEventArgs(this.inputAccumulator.ToString())); this.inputAccumulator.Clear(); } (I know that as long as there are no subscribers the data gets accumulated forever. This is a deliberate decision). The good This scheme works almost perfectly: Async functionality without spawning any threads Very convenient to the calling code (just subscribe to an event) Maintains the "chunkiness" of the data; this allows the calling code to use inside knowledge of the data without doing any extra work Is almost agnostic to the buffer size (it will work correctly with any size buffer irrespective of the data being read) The bad That last almost is a very big one. Consider what happens when there is an incoming chunk with length exactly equal to the size of the buffer. The chunk will be read and buffered, but the event will not be triggered. This will be followed up by a BeginRead that expects to find more data belonging to the current chunk in order to send it back all in one piece, but... there will be no more data in the stream. In fact, as long as data is put into the stream in chunks with length exactly equal to the buffer size, the data will be buffered and the event will never be triggered. This scenario may be highly unlikely to occur in practice, especially since we can pick any number for the buffer size, but the problem is there. Solution? Unfortunately, after checking the available methods on FileStream and StreamReader, I can't find anything which lets me peek into the stream while also allowing async methods to be used on it. One "solution" would be to have a thread wait on a ManualResetEvent after the "buffer filled" condition is detected. If the event is not signaled (by the async callback) in a small amount of time, then more data from the stream will not be forthcoming and the data accumulated so far should be sent to subscribers. However, this introduces the need for another thread, requires thread synchronization, and is plain inelegant. Specifying a timeout for BeginRead would also suffice (call back into my code every now and then so I can check if there's data to be sent back; most of the time there will not be anything to do, so I expect the performance hit to be negligible). But it looks like timeouts are not supported in FileStream. Since I imagine that async calls with timeouts are an option in bare Win32, another approach might be to PInvoke the hell out of the problem. But this is also undesirable as it will introduce complexity and simply be a pain to code. Is there an elegant way to get around the problem? Thanks for being patient enough to read all of this.

    Read the article

  • How to tell if XUL menupopup opens down or up?

    - by Jon
    I have an extension that can be placed on any toolbar (like the bookmarks, menu or status bars). In general, the context menu opens downward, but when placed on the status bar and Firefox is closed to the bottom of the screen, the context menu opens upward. I'd like to try reordering the context menu based on its up or down orientation, so that the same options are always closest to the mouse. For example, when opened downward it appears like this: -- (mouse) --------------- - MenuItem A - --------------- - MenuItem B - --------------- - MenuItem C - --------------- - ....... - --------------- When it opens upwards its like this: --------------- - MenuItem A - --------------- - MenuItem B - --------------- - MenuItem C - --------------- - ....... - --------------- -- (mouse) However, I'd like "MenuItem A" to appear closest to the mouse at all times, since its the most common item. I can render the items dynamically, so I really just need to find out the orientation.

    Read the article

  • Java error on bilinear interpolation of 16 bit data

    - by Jon
    I'm having an issue using bilinear interpolation for 16 bit data. I have two images, origImage and displayImage. I want to use AffineTransformOp to filter origImage through an AffineTransform into displayImage which is the size of the display area. origImage is of type BufferedImage.TYPE_USHORT_GRAY and has a raster of type sun.awt.image.ShortInterleavedRaster. Here is the code I have right now displayImage = new BufferedImage(getWidth(), getHeight(), origImage.getType()); try { op = new AffineTransformOp(atx, AffineTransformOp.TYPE_BILINEAR); op.filter(origImage, displayImage); } catch (Exception e) { e.printStackTrace(); } In order to show the error I have created 2 gradient images. One has values in the 15 bit range (max of 32767) and one in the 16 bit range (max of 65535). Below are the two images 15 bit image 16 bit image These two images were created in identical fashions and should look identical, but notice the line across the middle of the 16 bit image. At first I thought that this was an overflow problem however, it is weird that it's manifesting itself in the center of the gradient instead of at the end where the pixel values are higher. Also, if it was an overflow issue than I would suspect that the 15 bit image would have been affected as well. Any help on this would be greatly appreciated.

    Read the article

  • Changing paths to images in Wordpress

    - by Jon Winstanley
    I recently moved a friends blog onto his new web hosts but unfortunately the images are not working. This is due to the old host having the following path for images: http://www.example.com/blog/wp-content/uploads/2009/07/imagename.jpg The new host uses a different layout and has this path for the file: http://www.example.com/wp-content/uploads/2009/07/imagename.jpg 'Blog' has been removed. Does anyone know the easiest way to fix this issue?

    Read the article

  • Useful Eclipse Java Code Templates

    - by Jon
    You can create various Java code templates in Eclipse via the Window->Preferences->Java -> Editor -> Templates e.g. sysout is expanded to: System.out.println(${word_selection}${});${cursor} You can activate this by typing sysout followed by CTRL+SPACE What useful Java code templates do you currently use? Include the name and description of it and why it's awesome. There's an open bounty on this for an original/novel use of a template rather than a built-in existing feature. Create Log4J logger Get swt color from display Syncexec - Eclipse Framework Singleton Pattern/Enum Singleton Generation Readfile Const Traceout Format String Comment Code Review String format Try Finally Lock Message Format i18n and log Equalsbuilder Hashcodebuilder Spring Object Injection Create FileOutputStream

    Read the article

  • Dev environment - Cubicles or pods?

    - by jon
    We're reorganizing our workspaces at work, and are individually being given the choice of working in a more open space with a few other developers, or a more closed off space by ourselves. Which should I choose?

    Read the article

  • Language in a Sandbox in Rails

    - by Jon Romero
    I've found that there WAS a sandbox gem (created by the guys that made try ruby in your browser but it was compatible only with Ruby 1.8. Another problem is that I cannot find it anymore (it seems they stop serving the gem from the servers...). So, is there any secure way of running ruby in a sandbox (so you can run it from your browser)? Or an easy way to run (for example lua/python) in a sandbox (no filesystem access, no creation of objects etc) and be called from Ruby (Rails 2.2)? I want to make an application like try_ruby even without having a ruby underneath. But it has to be an easy language (I saw there was a prolog in ruby, even a lisp but I don't think they are easy to learn languages...). So, do you have any suggestions or tips? Or should I just start creating my own DSL in Ruby (if there is a solution in creating a somewhat safe system)? Thx

    Read the article

  • Uploadify refuses to upload WMV, FLV and MP4 files - SOLVED

    - by Jon Winstanley
    The uploadify plugin for JQuery seems very good and works for most file types. However, it allows me to upload all file types apart from the ones I need! Namely .WMV, .FLV and .MP4 Uploads of any other type work. I have already tried changing the fileExt parameter and also tried removing it altogether. I have testing in Google Chrome, IE7 and Firefox and none work for these file types. I have a ton of local projects already and uploading is not an issue on any other project, I even use the same example files (This is the first time I have used Uploadify) Is there a known reason for this behaviour? EDIT: Have found the issue. I had forgotten to add my usual .htaccess file to the example project.

    Read the article

  • How to start recognizing design patterns as you are programming?

    - by Jon Erickson
    I have general academic knowledge of the various design patterns that are discussed in GoF and Head First Design Patterns, but I have a difficult time applying them to the code that I am writing. A goal for me this year is to be able to recognize design patterns that are emerging from the code that I write. Obviously this comes with experience (I have about 2 years in the field), but my question is how can I jumpstart my ability to recognize design patterns as I am coding, maybe a suggestion as to what patterns are easiest to start applying in client-server applications (in my case mainly c# webforms with ms sql db's, but this could definitely be language agnostic).

    Read the article

  • Distributed sequence number generation?

    - by Jon
    I've generally implemented sequence number generation using database sequences in the past. e.g. Using Postgres SERIAL type http://neilconway.org/docs/sequences/ I'm curious though as how to generate sequence numbers for large distributed systems where there is no database. Does anybody have any experience or suggestions of a best practice for achieving sequence number generation in a thread safe manner for multiple clients?

    Read the article

  • Useful Java Annotations

    - by Jon
    I'm interested in finding out exactly which Java annotations people think are most useful during development. This doesn't necessarily have to limited to the core Java API, you may include annotations you found in third party libraries or annotations you've developed yourself (make sure you include a link to the source). I'm really interested in common development tasks rather than knowing why the @ManyToOne(optional=false) in JPA is awesome... Include the annotation and a description of why it's useful for general development.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >