Search Results

Search found 3484 results on 140 pages for 'chris dubois'.

Page 112/140 | < Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >

  • jQuery: Listen to changes within a DIV and act accordingly

    - by Chris
    I have a function that grabs an XML document and transforms it according to an XSL document. It then places the result into a div with the id laneconfigdisplay. What I want to do is, separate to the transformation logic, setup a jQuery change event for that div so I can tell when it has changed, and run some jQuery code. I have tried the following, but it does not work! $(document).ready(function() { $('#laneconfigdisplay').change(function() { alert('woo'); }); //Do XML / XSL transformation here }); <!-- HTML code here --> <div id="laneconfigdisplay"></div> What am I doing wrong?

    Read the article

  • Finding open contiguous blocks of time for every day of a month, fast

    - by Chris
    I am working on a booking availability system for a group of several venues, and am having a hard time generating the availability of time blocks for days in a given month. This is happening server-side in PHP, but the concept itself is language agnostic -- I could be doing this in JS or anything else. Given a venue_id, month, and year (6/2012 for example), I have a list of all events occurring in that range at that venue, represented as unix timestamps start and end. This data comes from the database. I need to establish what, if any, contiguous block of time of a minimum length (different per venue) exist on each day. For example, on 6/1 I have an event between 2:00pm and 7:00pm. The minimum time is 5 hours, so there's a block open there from 9am - 2pm and another between 7pm and 12pm. This would continue for the 2nd, 3rd, etc... every day of June. Some (most) of the days have nothing happening at all, some have 1 - 3 events. The solution I came up with works, but it also takes waaaay too long to generate the data. Basically, I loop every day of the month and create an array of timestamps for each 15 minutes of that day. Then, I loop the time spans of events from that day by 15 minutes, marking any "taken" timeslot as false. Remaining, I have an array that contains timestamp of free time vs. taken time: //one day's array after processing through loops (not real timestamps) array( 12345678=>12345678, // <--- avail 12345878=>12345878, 12346078=>12346078, 12346278=>false, // <--- not avail 12346478=>false, 12346678=>false, 12346878=>false, 12347078=>12347078, // <--- avail 12347278=>12347278 ) Now I would need to loop THIS array to find continuous time blocks, then check to see if they are long enough (each venue has a minimum), and if so then establish the descriptive text for their start and end (i.e. 9am - 2pm). WHEW! By the time all this looping is done, the user has grown bored and wandered off to Youtube to watch videos of puppies; it takes ages to so examine 30 or so days. Is there a faster way to solve this issue? To summarize the problem, given time ranges t1 and t2 on day d, how can I determine the remaining time left in d that is longer than the minimum time block m. This data is assembled on demand via AJAX as the user moves between calendar months. Results are cached per-page-load, so if the user goes to July a second time, the data that was generated the first time would be reused. Any other details that would help, let me know. Edit Per request, the database structure (or the part that is relevant here) *events* id (bigint) title (varchar) *event_times* id (bigint) event_id (bigint) venue_id (bigint) start (bigint) end (bigint) *venues* id (bigint) name (varchar) min_block (int) min_start (varchar) max_start (varchar)

    Read the article

  • OpenGL gluLookAt issues

    - by Chris D
    I am trying to switch my space invaders game to a first person view, i.e. a view of the world from the ship. I am getting a bit confused about what point I should be looking at. I am currently using these parameters in gluLookAt: GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); GLU.gluLookAt(ship3dPos.x, ship3dPos.y, ship3dPos.z,400.0f, 600.0f,-50.0f, 0.0f, 1.0f,-0.0f); Where ship3dPos is a Vector3f. I'm not sure what I'm supposed to set parameters 4,5 and 6 to, to get a view of the whole world(window is 800/600). I want to have a view of say 100.0 wide from the ships perspective, with this view moving along the x-axis as the player moves the ship. Thanks

    Read the article

  • Select all text in an <input /> when it gains focus

    - by Chris Barr
    I've got a textbox (set to readonly) and I need its' contents to be selected for easy copy/paste when it gains focus. Using the code below it only seems to quickly select the text and then unselect it for some reason. HTML <input id='thing' type='text' value='some text' readonly='readonly' />? JavaScript document.getElementById('thing').onfocus = function(){ this.select(); };? Fiddle: http://jsfiddle.net/cfqje/

    Read the article

  • Can I set NHibernate's default "OrderBy" to be "CreatedDate" not "Id"?

    - by Chris F
    This is an oddball question I figure. Can I get NHibernate to ask SQL to sort data by CreatedDate by default unless I set an OrderBy in my HQL or Criteria? I'm interested in knowing whether this sort can be accomplished at the DB level to avoid bringing in LINQ. The reason is that I use GUIDs for Ids and when I do something like this: Sheet sheet = sheetRepository.Get(_someGUID); IList<SheetLineItems> lineItems = sheet.LineItems; to fetch all of the lineItems, they come back in whatever arbitrary way that SQL sorts that fetch, which I figure is GUID. At some point I'll add ordinals to my line items, but for now, I just want to use CreatedDate as the sort criteria. I don't want to be forced to do: IList<SheetLineItem> lineItems = sheetLineItemRepository.GetAll(_sheetGUID); and then writing that method to sort by CreatedDate. I figure if everything is just sorted on CreatedDate by default, that would be fine, unless specifically requested otherwise.

    Read the article

  • NSTextField enter to trigger action

    - by Chris
    I've been looking all over for a simple example of how to have an action (or button) be triggered when the enter key is hit in the text field. Should I subclass the text field? Would I need to set a delegate to call the action I need? Is there a way to catch the event in my main window controller class? If you could even just point me to the right direction that would be great. Thanks.

    Read the article

  • help('modules') crashing? Not sure how to fix..

    - by Chris
    I was trying to install a module for opencv and added an opencv.pth file to the folder beyond my sites.py file. I have since deleted it and no change. When I try to run help('modules'), I get the following error: Please wait a moment while I gather a list of all available modules... /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/twisted/words/im/init.py:8: UserWarning: twisted.im will be undergoing a rewrite at some point in the future. warnings.warn("twisted.im will be undergoing a rewrite at some point in the future.") /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py:110: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or actively maintained. Please switch to the wx package as soon as possible. import(name) Traceback (most recent call last): File "", line 1, in File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site.py", line 348, in call return pydoc.help(*args, **kwds) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1644, in call self.help(request) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1681, in help elif request == 'modules': self.listmodules() File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1802, in listmodules ModuleScanner().run(callback) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1853, in run for importer, modname, ispkg in pkgutil.walk_packages(): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 110, in walk_packages import(name) File "/BinaryCache/wxWidgets/wxWidgets-11~262/Root/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wxaddons/init.py", line 180, in import_hook File "/Library/Python/2.5/site-packages/ctypes_opencv/init.py", line 19, in from ctypes_opencv.cv import * File "/BinaryCache/wxWidgets/wxWidgets-11~262/Root/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wxaddons/init.py", line 180, in import_hook File "/Library/Python/2.5/site-packages/ctypes_opencv/cv.py", line 2567, in ('desc', CvMat_r, 1), # CvMat* desc File "/Library/Python/2.5/site-packages/ctypes_opencv/cxcore.py", line 114, in cfunc return CFUNCTYPE(result, *atypes)((name, dll), tuple(aflags)) AttributeError: dlsym(0x2674d10, cvCreateFeatureTree): symbol not found What gives?!

    Read the article

  • Persistent SQL Table lock from C#

    - by Chris
    I'm trying to create a persistent SQL (SQL Server 2005) lock on a table level. I'm not updating/querying the specified table, but I need to prevent a third party application from updating the locked table as a means to prevent transactions from being posted (the table I wish to lock is the key on their transaction that interferes with my processing). From my experience the table is only locked for the time a specific transaction is taking place. Any ideas? The 3rd party developer has logged this feature as an enhancement, but since they are in the middle of rolling out a major release I can expect to wait at least 6 months for this. I know that this isn't a great solution, since their software will fall over but it is of a critical enough nature that we're willing to live with the consequences.

    Read the article

  • gprof and execl() - is it possible?

    - by Chris
    Background: I have a game (an old-school-esque MUD) which I've been attempting to profile with gprof. The documentation of gprof (on Linux 2.6) states that The profiled program must call "exit"(2) or return normally for the profiling information to be saved in the gmon.out file. Now, if I kill the server with the shutdown command, the application "returns normally" (i.e., main() returns) and I get a gmon.out to analyze. However, it's far more common to reboot the server. The reboot command does the following: Writes usernames and socket FD numbers to disc. Makes a call to execl(). The new process looks for the stored data, picks up the FDs, and moves on. I see the following error on the command line, as the whole process fails: Profiling timer expired ./program Question: Is it possible to get a gmon.out file from the execl()-calling process? Perhaps some environmental parameter to execl(), or else perhaps a different, gprof-friendly, system call to achieve the same effect (beginning a new process while preserving file descriptors)?

    Read the article

  • What is the reason not to use select * ?

    - by Chris Lively
    I've seen a number of people claim that you should specifically name each column you want in your select query. Assuming I'm going to use all of the columns anyway, why would I not use SELECT *? Even considering the question from 9/24, I don't think this is an exact duplicate as I'm approaching the issue from a slightly different perspective. One of our principles is to not optimize before it's time. With that in mind, it seems like using SELECT * should be the preferred method until it is proven to be a resource issue or the schema is pretty much set in stone. Which, as we know, won't occur until development is completely done. That said, is there an overriding issue to not use SELECT *?

    Read the article

  • Core Data combined Query

    - by Chris Summer
    Hey, i have question related to CoreData. My iphone project has 2 Entities, Organisation and Brand with a 1 to many "BrandsToOrg" relationship and inverse. So my project has a Mapview, where you can see all the Organisations and a little subview when you click on those Organisations.At the subview there is a "show Brands" Button, which should init a new TableView who only shows the brands belong to the seleceted organisation. Any ideas how i can code that? thx NSPredicate *predicate = [NSPredicate predicateWithFormat: @"(TitleMedium == %@)",@"Rock Antenne"];???? NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:self.entityName inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; // If a predicate was passed, pass it to the query if(predicate != nil) { [request setPredicate:predicate]; } // If a sort key was passed, use it for sorting. NSString *sortKey=@"TitleMedium"; BOOL sortAscending=YES; if(sortKey != nil) { NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:sortKey ascending:sortAscending]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [sortDescriptors release]; [sortDescriptor release]; } NSError *error; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; [request release]; [self setEntityArray:mutableFetchResults];

    Read the article

  • converting tabular structures in a Word document into an actual table or reading data from the tabul

    - by Chris
    I have a macro which can read the last cell/column of all tables in a Word 2003/2007 document and store the data in an MS-Access table. But, some Word documents have the data in structures like a table format but are not actually tables. The structure looks like a table, but the table borders are actually line connectors. These documents were created by a software(VeryPDF PDF to Word converter) which converted the PDF documents(the original format these documents were) into Word documents. Is there a way I can convert/replace the tabular structures with actual tables in Word so that I can use the macro? Or, is there a way I can read the value of the last column from the tabular structures using some VBA code? Any advice would be appreciated.

    Read the article

  • Is there a case for parameterising using Abstract classes rather than Interfaces?

    - by Chris
    I'm currently developing a component based API that is heavily stateful. The top level components implement around a dozen interfaces each. The stock top-level components therefore sit ontop of a stack of Abstract implementations which in turn contain multiple mixin implementations and implement multiple mixin interfaces. So far, so good (I hope). The problem is that the base functionality is extremely complex to implement (1,000s of lines in 5 layers of base classes) and therefore I do not wish for component writers to implement the interfaces themselves but rather to extend my base classes (where all the boiler plate code is already written). If the API therefore accepts interfaces rather than references to the Abstract implementation that I wish for component writers to extends, then I have a risk that the implementer will not perform the validation that is both required and assumed by other areas of code. Therefore, my question is, is it sometimes valid to paramerise API methods using an abstract implementation reference rather than a reference to the interface(s) that it implements? Do you have an example of a well-designed API that uses this technique or am I trying to talk myself into bad-practice?

    Read the article

  • mod_rewrite to make a short URL

    - by Chris Stewart
    I have a url like: http://skepticalgamer.com/category/slam-the-controller I'd like to strip out "category" from the URL. So I'd want: http://skepticalgamer.com/slam-the-controller to act as if it were the original URL above. Is that something that can be done with mod_rewrite?

    Read the article

  • Objective C: App freezes when using a timer

    - by Chris
    It took me hours to figure out how to implement a timer into my program, but when it runs, the app doesn't load completely as it did before the timer. In my main.m: int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; OutLauncher *theLauncher = [[OutLauncher alloc] init]; NSTimer *theTimer = [theLauncher getTimer]; [theTimer retain]; [[NSRunLoop currentRunLoop] addTimer: theTimer forMode: NSDefaultRunLoopMode]; [[NSRunLoop currentRunLoop] run]; [pool release]; return 0; } The file OutLauncher is being imported into that, which looks like this: - (void)doStuff { NSLog( @"Doing Stuff"); } - (NSTimer *)getTimer{ NSTimer *theTimer; theTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector: @selector(doStuff) userInfo:nil repeats:YES]; return [theTimer autorelease]; } The timer works, the console updates every second with the phrase "doing stuff" but the rest of the program just won't load. It will if I comment out the code I added to int main though

    Read the article

  • many-to-many mapping in NHibernate

    - by Chris Stewart
    I'm looking to create a many to many relationship using NHibernate. I'm not sure how to map these in the XML files. I have not created the classes yet, but they will just be basic POCOs. Tables Person personId name Competency competencyId title Person_x_Competency personId competencyId Would I essentially create a List in each POCO for the other class? Then map those somehow using the NHibernate configuration files?

    Read the article

  • Using a message class static method taking in an action to wrap Try/Catch

    - by Chris Marisic
    I have a Result object that lets me pass around a List of event messages and I can check whether an action was successful or not. I've realized I've written this code in alot of places Result result; try { //Do Something ... //New result is automatically a success for not having any errors in it result = new Result(); } catch (Exception exception) { //Extension method that returns a Result from the exception result = exception.ToResult(); } if(result.Success) .... What I'm considering is replacing this usage with public static Result CatchException(Action action) { try { action(); return new Result(); } catch (Exception exception) { return exception.ToResult(); } } And then use it like var result = Result.CatchException(() => _model.Save(something)); Does anyone feel there's anything wrong with this or that I'm trading reusability for obscurity?

    Read the article

  • How can I implement drag-out-to-delete in Flex?

    - by Chris R
    I have a List component from which I'd like to be able to remove items using drag & drop, but without having a specific target. If you use the mac, the behaviour I'm looking for is something like what the Dock uses; when you drag something out of the bounds of the control it should get an icon that indicates that it'll be deleted (OSX uses a cloud or something?) and then if you release it it will be removed from the list. How can I do this? (If I need to provide a more clear description, please comment; I'll fill in what I can)

    Read the article

  • Orverride Problem for Custom Design on Product - Magneto

    - by Chris
    I am running several sites in several different languages off of single instance of magneto. There are two main styles Site 1 Site 2 Each site has some cusomtimizations based on language So each shop view has an some templates defined Site 2 - DE Site 2 - UK Now the problem is that when I apply a product level design, it forget's about the language level definition and skips back to the main definition. I want it to work like this Site 2 Site 2 DE Product Style But Instead it seems to work like this Site 2 Site 2 DE Product Style Where Site 2 DE is not ignored because a custom product style has been defined. How can I get the first hierarchy to work? So that my product styles do not override the language styles completely.

    Read the article

  • google salve - maven

    - by chris-gr
    Hi all, I tried to install google salve http://code.google.com/p/salve/ by adding following statements in the project's pom file: However, when running mvn dependency:resolve it states "unable to find resource "salve:salve:jar:2.0" in repository salve What's wrong? <dependency> <groupId>salve</groupId> <artifactId>salve</artifactId> <version>2.0</version> </dependency> <repository> <id>salve</id> <name>Google Maven Repository</name> <url>http://salve.googlecode.com/svn/maven2/</url> </repository>

    Read the article

  • Casting a Calculated Column in a MySQL view.

    - by Chris Brent
    I have a view that contains a calculated column. Is there are a way to cast it as a CHAR or VARCHAR rather than a VARBINARY ? Obviously, I have tried using CAST(... as CHAR) but it gives an error. Here is a simple replicable example. CREATE VIEW view_example AS SELECT concat_ws('_', lpad(9, 3,'0'), lpad(1,3,'0'), date_format(now(),'%Y%m%d%H%i%S')) AS calculated_field_id; This is how my view is created: describe view_example; +---------------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------------+---------------+------+-----+---------+-------+ | calculated_field_id | varbinary(27) | YES | | NULL | | +---------------------+---------------+------+-----+---------+-------+ select version(); +-----------------------+ | version() | +-----------------------+ | 5.0.51a-community-log | +-----------------------+

    Read the article

  • Best practices: displaying text that was input via multi-line text box

    - by chris
    I have a multi-line text box. When users simply type away, the text box wraps the text, and it's saved as a single line. It's also possible that users may enter line breaks, for example when entering a "bulleted" lists like: Here are some suggestions: - fix this - remove that - and another thing Now, the problem occurs when I try to display the value of this field. In order to preserve the formatting, I currently wrap the presentation in <pre> - this works to preserve user-supplied breaks, but when there's a lot of text saved as a single line, it displays the whole text block as single line, resulting in horizontal scrolling being needed to see everything. Is there a graceful way to handle both of these cases?

    Read the article

  • Need help optimizing this Django aggregate query

    - by Chris Lawlor
    I have the following model class Plugin(models.Model): name = models.CharField(max_length=50) # more fields which represents a plugin that can be downloaded from my site. To track downloads, I have class Download(models.Model): plugin = models.ForiegnKey(Plugin) timestamp = models.DateTimeField(auto_now=True) So to build a view showing plugins sorted by downloads, I have the following query: # pbd is plugins by download - commented here to prevent scrolling pbd = Plugin.objects.annotate(dl_total=Count('download')).order_by('-dl_total') Which works, but is very slow. With only 1,000 plugins, the avg. response is 3.6 - 3.9 seconds (devserver with local PostgreSQL db), where a similar view with a much simpler query (sorting by plugin release date) takes 160 ms or so. I'm looking for suggestions on how to optimize this query. I'd really prefer that the query return Plugin objects (as opposed to using values) since I'm sharing the same template for the other views (Plugins by rating, Plugins by release date, etc.), so the template is expecting Plugin objects - plus I'm not sure how I would get things like the absolute_url without a reference to the plugin object. Or, is my whole approach doomed to failure? Is there a better way to track downloads? I ultimately want to provide users some nice download statistics for the plugins they've uploaded - like downloads per day/week/month. Will I have to calculate and cache Downloads at some point? EDIT: In my test dataset, there are somewhere between 10-20 Download instances per Plugin - in production I expect this number would be much higher for many of the plugins.

    Read the article

  • How to programmatically register a component that depends on a list of already registered components

    - by Chris Carter
    I'm programmatically registering a group of services that all implement the same interface, IRule. I have another service that looks like this: public class MyService { private IEnumerable<IRule> _rules; public MyService(IEnumerable<IRule> rules){ _rules = rules; } } Hammett posted something that looked like what I wanted, http://hammett.castleproject.org/?p=257. I changed the signature to IRule[] and tried the ArrayResolver trick in the post but that didn't work for me(note, it didn't break anything either). Anyone know how to programmatically register a component like the code I posted above?

    Read the article

< Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >