Search Results

Search found 701 results on 29 pages for 'stephen gross'.

Page 18/29 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • MySQL: Complex Join Statement involving two tables and a third correlation table

    - by Stephen
    I have two tables that were built for two disparate systems. I have records in one table (called "leads") that represent customers, and records in another table (called "manager") that are the exact same customers but "manager" uses different fields (For example, "leads" contains an email address, and "manager" contains two fields for two different emails--either of which might be the email from "leads"). So, I've created a correlation table that contains the lead_id and manager_id. currently this correlation table is empty. I'm trying to query the "leads" table to give me records that match either "manager" email field with the single "leads" email field, while at the same time ignoring fields that have already been added to the "correlated" table. (this way I can see how many leads that match have not yet been correlated.) Here's my current, invalid SQL attempt: SELECT leads.id, manager.id FROM leads, manager LEFT OUTER JOIN correlation ON correlation.lead_id = leads.id WHERE correlation.id IS NULL AND leads.project != "someproject" AND (manager.orig_email = leads.email OR manager.dest_email = leads.email) AND leads.created BETWEEN '1999-01-01 00:00:00' AND '2010-05-10 23:59:59' ORDER BY leads.created ASC; I get the error: Unknown column 'leads.id' in 'on clause' Before you wonder: there are records in the "leads" table where leads.project != "someproject" and leads.created falls between those dates. I've included those additional parameters for completeness.

    Read the article

  • ASP.NET CacheDependency out of ThreadPool

    - by Stephen
    In an async http handler, we add items to the ASP.NET cache, with dependencies on some files. If the async method executes on a thread from the ThreadPool, all is fine: AsyncResult result = new AsyncResult(context, cb, extraData); ThreadPool.QueueUserWorkItem(new WaitCallBack(DoProcessRequest), result); But as soon as we try to execute on a thread out of the ThreadPool: AsyncResult result = new AsyncResult(context, cb, extraData); Runner runner = new Runner(result); Thread thread = new Thread(new ThreadStart(runner.Run()); ... where Runner.Run just invokes DoProcessRequest, The dependencies do trigger right after the thread exits. I.e. the items are immediately removed from the cache, the reason being the dependencies. We want to use an out-of-pool thread because the processing might take a long time. So obviously something's missing when we create the thread. We might need to propagate the call context, the http context... Has anybody already encountered that issue? Note: off-the-shelf custom threadpools probably solve this. Writing our own threadpool is probably a bad idea (think NIH syndrom). Yet I'd like to understand this in details, though.

    Read the article

  • CakePHP: How can I change this find call to include all records that do not exist in the associated

    - by Stephen
    I have a few tables with the following relationships: Company hasMany Jobs, Employees, and Trucks, Users I've got all my foreign keys set up properly, along with the tables' Models, Controllers, and Views. Originally, the Jobs table had a boolean field called "assigned". The following find operation (from the JobsController) successfully returns all employees, all trucks, and any jobs that are not assigned and fall on a certain day for a single company (without returning users by utilizing the containable behavior): $this->set('resources', $this->Job->Company->find('first', array( 'conditions' => array( 'Company.id' => $company_id ), 'contain' => array( 'Employee', 'Truck', 'Job' => array( 'conditions' => array( 'Job.assigned' => false, 'Job.pickup_date' => date('Y-m-d', strtotime('Today')); ) ) ) ))); Now, since writing this code, I decided to do a lot more with the job assignments. So I've created a new model "Assignment" that belongsTo Truck and belongsTo Job. I've added the hasMany Assignments to both the Truck model and the Jobs Model. I have both foreign keys in the assignments table, along with some other assignment fields. Now, I'm trying to get the same information above, only instead of checking the assigned field from the job table, I want to check the assignments table to ensure that the job does not exist there. I can no longer use the containable behavior if I'm going to use the "joins" feature of the find method due to mysql errors (according to the cookbook). But, the following query returns all jobs, even if they fall on different days. $this->set('resources', $this->Job->Company->find('first', array( 'joins' => array( array( 'table' => 'employees', 'alias' => 'Employee', 'type' => 'LEFT', 'conditions' => array( 'Company.id = Employee.company_id' ) ), array( 'table' => 'trucks', 'alias' => 'Truck', 'type' => 'LEFT', 'conditions' => array( 'Company.id = Truck.company_id' ) ), array( 'table' => 'jobs', 'alias' => 'Job', 'type' => 'LEFT', 'conditions' => array( 'Company.id = Job.company_id' ) ), array( 'table' => 'assignments', 'alias' => 'Assignment', 'type' => 'LEFT', 'conditions' => array( 'Job.id = Assignment.job_id' ) ) ), 'conditions' => array( 'Job.pickup_date' => $day, 'Company.id' => $company_id, 'Assignment.job_id IS NULL' ) )));

    Read the article

  • recursive find in emacs?

    - by Stephen
    Is there a recursive find function for a find in emacs? I thought the 'nix "find" was implemented in eshell but perhaps not (I've been using it on OS X but it must have been calling FreeBSD's "find")... I know of rgrep, find-grep, grep-find, in emacs, but I don't actually need the grepping part. Perhaps it's a feature in one of dired's functions (though I didn't find it)? Using windows and I miss some 'nix utilities... thought emacs 23.2 might fill in for me.

    Read the article

  • How do I get a div to float to the bottom of its container?

    - by Stephen Martin
    I have floated images and inset boxes at the top of a container using float:right (or left) many times. Recently I hit a need to float a div at the bottom right corner of another div with the normal text wrap that you get with float (text wrapped above and to the left only). I thought this must be relatively easy even though float has no bottom value but I haven't been able to do it using a number of techniques and searching the web hasn't come up with anything other than using absolute positioning but this doesn't give the correct word wrap behaviour. I had thought this would be a very common design but apparently it isn't. If nobody has a suggestion I'll have to break my text up into separate boxes and align the div manually but that is rather precarious and I'd hate to have to do it on every page that needs it.

    Read the article

  • Why use hashing to create pathnames for large collections of files?

    - by Stephen
    Hi, I noticed a number of cases where an application or database stored collections of files/blobs using a has to determine the path and filename. I believe the intended outcome is a situation where the path never gets too deep, or the folders ever get too full - too many files (or folders) in a folder making for slower access. EDIT: Examples are often Digital libraries or repositories, though the simplest example I can think of (that can be installed in about 30s) is the Zotero document/citation database. Why do this? EDIT: thanks Mat for the answer - does this technique of using a hash to create a file path have a name? Is it a pattern? I'd like to read more, but have failed to find anything in the ACM Digital Library

    Read the article

  • Where to handle fatal exceptions

    - by Stephen Swensen
    I am considering a design where all fatal exceptions will be handled using a custom UncaughtExceptionHandler in a Swing application. This will include unanticipated RuntimeExceptions but also custom exceptions which are thrown when critical resources are unavailable or otherwise fail (e.g. a settings file not found, or a server communication error). The UncaughtExceptionHandler will do different things depending on the specific custom exception (and one thing for all the unanticipated), but in all cases the application will show the user an error message and exit. The alternative would be to keep the UncaughtExceptionHandler for all unanticipated exceptions, but handle all other fatal scenarios close to their origin. Is the design I'm considering sound, or should I use the alternative?

    Read the article

  • [emacs] make ibuffer-visit-buffer behave like ido-switch-to-buffer?

    - by Stephen
    Is there a way to make ibuffer-visit-buffer behave like ido-switch-to-buffer (with raise-frame option)? If there is a window/frame containing the buffer I'd like emacs to take me there rather than opening the same buffer in the current window. I guess switch-to-buffer is remapped to ido-switch-to-buffer when ido-mode is turned on, so would doing something like that work in this case (remap ibuffer-visit-buffer to ido-switch-to-buffer)? Thanks

    Read the article

  • How to add reference an assembly that is not in the GAC from a t4mvc template (.tt)

    - by stephen
    I have found the place near the very top in a T4MVC template file (.tt) where assembly references can be added, which looks like: <#@ assembly name="System.Core" #> <#@ import namespace="System.Collections.Generic" #> However, it seems that I can only reference assemblies that are in the GAC. i.e. if I have an assembly MyProject.Stuff.dll (not in the GAC) added as a reference to the VS project containing the template then I expected to be able to add something like the following: <#@ assembly name="MyProject.Stuff" #> <#@ import namespace="MyProject.Stuff" #> If I do this then I get the following error: Error 1 Compiling transformation: Metadata file 'MyProject.Stuff' could not be found C:\Work\Development\DotNetSolution\MyProject\Utils\T4MVC\T4MVC.tt 1 1 How can I add a reference to an assembly that isn't in the GAC?

    Read the article

  • Apache ReWriteEngine throwing 500 Internal Server Error for too many internal redirects... why?!?!?!

    - by Stephen G
    I'm trying to implement a new ReWrite rule on my local dev machine. I have 13 rules set up already, and all work fine (even as of this writing). However, for some reason the newest one is throwing me 500 Internal Server Errors. The ReWrite rule is: RewriteRule stuff/public_html/vault/mystuff/view/(.*) /stuff/public_html/vault/mystuff/view/index.php?stuff=$1 RewriteRule stuff/public_html/vault/mystuff/view/(.*)/ /stuff/public_html/vault/mystuff/view/index.php?stuff=$1 Checked my apache logs and got this: [Thu Jan 13 22:07:43 2011] [error] [client ::1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary., referer: http://localhost:8888/stuff/public_html/vault/mystuff/all/index.php?curr=7 On the script I am trying to redirect to view/index.php?stuff=$1, there is nothing that even remotely resembles a redirect of any kind. I do have a very, very basic session verifier being called at the top of the landing script, which is as follows: //Start session session_start(); //Check whether the session variable SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) { header("location: ".$root_http.""); exit(); } However, when I access the page directly, it acts as it should, and there is no redirect. All of my other ReWrite rules and their corresponding landing pages are set up the exact same way. This is blowing my mind. Any help, PLEASE!?

    Read the article

  • A RecursiveParentChildIterator -- like the RecursiveDirectoryIterator

    - by Stephen J. Fuhry
    There are tons of examples of using the RecursiveIterator to flatten a tree structure.. but what about using it to explode a tree structure? Is there an elegant way to use this, or some other SPL library to recursively build a tree (read: turn a flat array into array of arbitrary depth) given a table like this: SELECT id, parent_id, name FROM my_tree EDIT: You know how you can do this with Directories? $it = new RecursiveDirectoryIterator("/var/www/images"); foreach(new RecursiveIteratorIterator($it) as $file) { echo $file . PHP_EOL; } .. What if you could do something like this: $it = new RecursiveParentChildIterator($result_array); foreach(new RecursiveIteratorIterator($it) as $group) { echo $group->name . PHP_EOL; // this would contain all of the children of this group, recursively $children = $group->getChildren(); } :END EDIT

    Read the article

  • emacs delete directory recursively?

    - by Stephen
    I was searching through for a way to copy/delete directory trees... dired seems to have dired-copy-file-recursive (though sans documentation) and a search on 'recursive' also returns: tramp-handle-dired-recursive-delete-directory is a compiled Lisp function in `tramp.el'. (tramp-handle-dired-recursive-delete-directory FILENAME) Recursively delete the directory given. This is like `dired-recursive-delete-directory' for Tramp files. But I can't find dired-recursive-delete-directory anywhere! Anyone know what's going on? Thanks ~

    Read the article

  • emacs lisp mapcar doesn't apply function to all elements?

    - by Stephen
    Hi, I have a function that takes a list and replaces some elements. I have constructed it as a closure so that the free variable cannot be modified outside of the function. (defun transform (elems) (lexical-let ( (elems elems) ) (lambda (seq) (let (e) (while (setq e (car elems)) (setf (nth e seq) e) (setq elems (cdr elems))) seq)))) I call this on a list of lists. (defun tester (seq-list) (let ( (elems '(1 3 5)) ) (mapcar (transform elems) seq-list))) => ((10 1 8 3 6 5 4 3 2 1) ("a" "b" "c" "d" "e" "f")) It does not seem to apply the function to the second element of the list provided to tester(). However, if I explicitly apply this function to the individual elements, it works... (defun tester (seq-list) (let ( (elems '(1 3 5)) ) (list (funcall (transform elems) (car seq-list)) (funcall (transform elems) (cadr seq-list))))) => ((10 1 8 3 6 5 4 3 2 1) ("a" 1 "c" 3 "e" 5)) If I write a simple function using the same concepts as above, mapcar seems to work... What could I be doing wrong? (defun transform (x) (lexical-let ( (x x) ) (lambda (y) (+ x y)))) (defun tester (seq) (let ( (x 1) ) (mapcar (transform x) seq))) (tester (list 1 3)) => (2 4) Thanks

    Read the article

  • Why does this regular expression fail?

    - by Stephen
    I have a password validation script in PHP that checks a few different regular expressions, and throws a unique error message depending on which one fails. Here is an array of the regular expressions and the error messages that are thrown if the match fails: array( 'rule1' => array( '/^.*[\d].*$/i', 'Password must contain at least one number.' ), 'rule2' => array( '/^.*[a-z].*$/i', 'Password must contain at least one lowercase letter' ), 'rule3' => array( '/^.*[A-Z].*$/i', 'Password must contain at least one uppercase letter' ), 'rule4' => array( '/^.*[~!@#$%^&*()_+=].*$/i', 'Password must contain at least one special character [~!@#$%^&*()_+=]' ) ); For some reason, no matter what I pass through the validation, the "Special Characters" rule fails. I'm guessing it's a problem with the expression. If there's a better (or correct) way to write these expressions, I'm all ears!

    Read the article

  • How to implement a simple queue properly?

    - by Stephen Hsu
    The current Go library doesn't provide the queue container. To implement a simple queue, I use circle array as the underlying data structure. It follows algorithms mentioned in TAOCP: Insert Y into queue X: X[R]<-Y; R<-(R+1)%M; if R=F then OVERFLOW. Delete Y from queue X: if F=R then UNDERFLOW; Y<-X[F]; F<-(F+1) % M. F: Front, R: Rear, M: Array length. Following is the code: package main import ( "fmt" ) type Queue struct { len int head, tail int q []int } func New(n int) *Queue { return &Queue{n, 0, 0, make([]int, n)} } func (p *Queue) Enqueue(x int) bool { p.q[p.tail] = x p.tail = (p.tail + 1) % p.len return p.head != p.tail } func (p *Queue) Dequeue() (int, bool) { if p.head == p.tail { return 0, false } x := p.q[p.head] p.head = (p.head + 1) % p.len return x, true } func main() { q := New(10) for i := 1; i < 13; i++ { fmt.Println(i, q.Enqueue(i)) } fmt.Println() for i := 1; i < 13; i++ { fmt.Println(q.Dequeue()) } } But the output is obviously wrong: 1 true 2 true 3 true 4 true 5 true 6 true 7 true 8 true 9 true 10 false 11 true 12 true 11 true 12 true 0 false 0 false 0 false 0 false 0 false 0 false 0 false 0 false 0 false 0 false I think I need one more field to make the code work properly. What do you suggest?

    Read the article

  • Hide Image Title in Slimbox

    - by Stephen
    My issue is a lot like this solved thread, except I'm using Slimbox 2: http://stackoverflow.com/questions/940994/hide-image-title-tool-tip-popup-on-mouse-rollover-or-hover When you hover over an image, the "Title" attribute pops up. I need HTML in my image title in Slimbox. So, of course, when you're hovering, the "Title" attribute shows all the HTML code. The code works perfectly when you're viewing the image in Slimbox so no problems there. I just need the Title attribute to be hidden/modified not to show this HTML code. I tried to change Q.title in slimbox.js to something else (like captionname). Then changed the HTML to call for: <a href="images/team/large.jpg" title="Joe Smith" captionname="URL" rel="lightbox-team"><img src="images/team/small.jpg" class ="headline" border="1" hspace="2" /></a> "Joe Smith" displays as the Title but when you view the image in Slimbox, captionname does not come up at all and neither does the Title. It's just blank where it should be. What do I need to modify in slimbox2.js to make this work?

    Read the article

  • NSColor, 10.6 and Gamma 2.2

    - by Stephen Blinkhorn
    With Snow Leopard the default gamma changed from 1.8 to 2.2. I happen to be working on a few Mac apps that use a very dark custom colour scheme provided by Cocoa. On 10.5 it looks fine but on 10.6 with the new gamma it's much darker and really hard on the eyes. The colour scheme is defined using numerous [NSColor colorWithCalibratedRed:green:blue:alpha:] objects within a theme class. Is there any way to 'convert' an NSColor object so that it displays on 10.6 exactly as it would on 10.5 with the old 1.8 gamma? I know this can be achieved globally from within System Preferences but that's not what I'm after.

    Read the article

  • Saving CFPropertyLists To Users Folder

    - by stephen blinkhorn
    I'm trying to save a CFPropertyList to a location in the user's home folder. Using the code below I'm getting errorCode = -10 (unknown error). CFURLRef fileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("~/testfile.txt"), kCFURLPOSIXPathStyle, false ); SInt32 errorCode; Boolean status = CFURLWriteDataAndPropertiesToResource(fileURL, xmlData, NULL, &errorCode); If I change the path to something like "/testfile.txt" without the '~' then everything works. How can one save a property list to the current user's home folder? Must one obtain the user's name first and include it in the path such as /users/toffler/testfile.txt?

    Read the article

  • CreateThread() fails on 64 bit Windows, works on 32 bit Windows. Why?

    - by Stephen Kellett
    Operating System: Windows XP 64 bit, SP2. I have an unusual problem. I am porting some code from 32 bit to 64 bit. The 32 bit code works just fine. But when I call CreateThread() for the 64 bit version the call fails. I have three places where this fails. 2 call CreateThread(). 1 calls beginthreadex() which calls CreateThread(). All three calls fail with error code 0x3E6, "Invalid access to memory location". The problem is all the input parameters are correct. HANDLE h; DWORD threadID; h = CreateThread(0, // default security 0, // default stack size myThreadFunc, // valid function to call myParam, // my param 0, // no flags, start thread immediately &threadID); All three calls to CreateThread() are made from a DLL I've injected into the target program at the start of the program execution (this is before the program has got to the start of main()/WinMain()). If I call CreateThread() from the target program (same params) via say a menu, it works. Same parameters etc. Bizarre. If I pass NULL instead of &threadID, it still fails. If I pass NULL as myParam, it still fails. I'm not calling CreateThread from inside DllMain(), so that isn't the problem. I'm confused and searching on Google etc hasn't shown any relevant answers. If anyone has seen this before or has any ideas, please let me know. Thanks for reading.

    Read the article

  • IE "Microsoft JScript runtime error: Object expected"

    - by Stephen Borg
    Hi there, I have problems with regards to javascript only when using IE. The error I am getting is "Microsoft JScript runtime error: Object expected" and I have no idea why. It is then jumping into the JQuery 1.4.2 file, without giving me a proper error message. All I am doing is simply reading on page load the raw URL, and getting a query string named Search. Using that in an AJAX call to return products and put then into a DIV. No biggies, but somehow IE is managing to blow my page up :-( Any ideas? Code as follows : <script type="text/javascript"> $(document).ready(function (e) { $('.boxLoader').show(); function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(window.location.href); if (results == null) return ""; else return decodeURIComponent(results[1].replace(/\+/g, " ")); } var Search; Search = getParameterByName("search"); $('#searchCriteria').text(Search); $.get("/Handlers/processProducts.aspx", { SearchCriteria: Search }, function (data) { $('#innercontent').html(data); $('#innercontent').fadeIn(200); $('.boxLoader').fadeOut(200); }); $('#searchBox').live("click", function () { $.get("/Handlers/processProducts.aspx", { SearchCriteria: $('#searchCriteria').val() }, function (data) { $('#innercontent').html(data); $('#innercontent').fadeIn(200); $('.boxLoader').fadeOut(200); }); }); }); </script>

    Read the article

  • Switching Views

    - by Stephen
    I have two XIb files and I need to switch between them with the swipe of a finger, like the native iphone weather app. does anyone know how to do this. please give some sample code if possible. thank you. P.S I am programming in Objective-C.

    Read the article

  • Why do I get HTTP Code 414 on one network but not another?

    - by Stephen Darlington
    I have an otherwise working iPhone program. A recent change means that it generates some very long URLs (over 4000 characters sometimes) which I know isn't a great idea and I know how to fix -- that's not what I'm asking here. The curious thing is that when I make the connection using a 3G network (Vodafone UK) I get this HTTP "414 Request-URI Too Long" error but when I connect using my local WiFi connection it works just fine. Why would I get different results using different types of network? Could they be routing requests to different servers depending on where the connection originates? Or is there something else at stake here? The corollary questions relate to how common this is. Is it likely to happen whenever I use a cell network or just some networks?

    Read the article

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