Search Results

Search found 1752 results on 71 pages for 'andrew wheeler'.

Page 6/71 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Why does my custom component raise AVs in the IDE?

    - by Mason Wheeler
    I'm trying to write a simple component that will allow you to embed one or more SDL rendering surfaces on a Delphi window, using the SDL 1.3 APIs. It will compile and install just fine, but when I try to use the component in the form designer, it raises AVs whenever I try to access its properties in the object inspector, save the form, or delete the component, and placing one on a form then trying to run gives a linker error: it apparently can't read the DFM properly for whatever reason. The DLL can be found at http://www.libsdl.org/tmp/SDL-1.3-dll.zip and the source code to my component can be downloaded here. SDL.pas is a JEDI-SDL header file; the rest is my own code. I don't see any reason for this to raise AVs in the form designer. If I dynamically create the control at runtime I don't have any stability issues. Can anyone take a look at this and maybe provide some feedback that might help me clear it up?

    Read the article

  • Piwik Web Analytics - Anyone with experience of it?

    - by Phil.Wheeler
    I'm considering trying to get more granular analytics for my sites than the free plan on my current provider, Clicky, provides. Piwik looks like a strong contender in the analytics space (and I'm surprised I haven't heard about it before) but I want to be sure I'm not throwing the baby out with the bathwater by swapping to it. Does anyone have any experience with this software and - in particular - are there any people out there who've tried customising the code or developing their own plugin?

    Read the article

  • How do I read an arbitrary chunk from a PNG file?

    - by Mason Wheeler
    I've got some custom metadata to put into a PNG file. It's being saved through libpng, and it's not difficult to write out a custom chunk. I just call png_write_chunk with the name, length and data. But I can't see how to get the data back out again. I'd expect there to be a png_read_chunk function that takes a chunk name and returns a pointer to the data or something like that, but there's nothing like that in png.h. Does anyone know how to accomplish this?

    Read the article

  • Biggest Delphi nitpicks

    - by Mason Wheeler
    What sort of minor annoyances do you run into using Delphi? I'm not looking for major issues such as "I want a 64-bit compiler." Just little things that can be easily worked around but still should have been implemented better so you don't have to work around them? Marking this CW. I'm more interested in the answers than the points.

    Read the article

  • How to know when my control changes size?

    - by Mason Wheeler
    I'm building a custom control, and I need it to be able to respond when it gets resized. I need the old dimensions and the new dimensions available in order to do some calculations. Unfortunately, the SetWidth and SetHeight methods are private to TControl, not protected, and so I can't override them. Is there any other way to know that my control's about to be resized, and to have the old size and the new size both available?

    Read the article

  • [MySQL/PHP] Avoid using RAND()

    - by Andrew Ellis
    So... I have never had a need to do a random SELECT on a MySQL DB until this project I'm working on. After researching it seems the general populous says that using RAND() is a bad idea. I found an article that explains how to do another type of random select. Basically, if I want to select 5 random elements, I should do the following (I'm using the Kohana framework here)? If not, what is a better solution? Thanks, Andrew <?php final class Offers extends Model { /** * Loads a random set of offers. * * @param integer $limit * @return array */ public function random_offers($limit = 5) { // Find the highest offer_id $sql = ' SELECT MAX(offer_id) AS max_offer_id FROM offers '; $max_offer_id = DB::query(Database::SELECT, $sql) ->execute($this->_db) ->get('max_offer_id'); // Check to make sure we're not trying to load more offers // than there really is... if ($max_offer_id < $limit) { $limit = $max_offer_id; } $used = array(); $ids = ''; for ($i = 0; $i < $limit; ) { $rand = mt_rand(1, $max_offer_id); if (!isset($used[$rand])) { // Flag the ID as used $used[$rand] = TRUE; // Set the ID if ($i > 0) $ids .= ','; $ids .= $rand; ++$i; } } $sql = ' SELECT offer_id, offer_name FROM offers WHERE offer_id IN(:ids) '; $offers = DB::query(Database::SELECT, $sql) ->param(':ids', $ids) ->as_object(); ->execute($this->_db); return $offers; } }

    Read the article

  • How to tie a Hudson job to a user who has access to run MSIExec

    - by Andrew
    Hi All, I have a batch file that calls "MSIExec /X {MyGUID} /qn". This runs successfully when run with my admin user. When I run it as a Window Batch command from a Hudson job it fails with "T?h?e? ?i?n?s?t?a?l?l?a?t?i?o?n? ?s?o?u?r?c?e? ?f?o?r? ?t?h?i?s? ?p?r?o?d?u?c?t? ?i?s? ?n?o?t? ?a?v?a?i?l?a?b?l?e?.? ? ?V?e?r?i?f?y? ?t?h?a?t? ?t?h?e? ?s?o?u?r?c?e? ?e?x?i?s?t?s? ?a?n?d? ?t?h?a?t? ?y?o?u? ?c?a?n? ?a?c?c?e?s?s? ?i?t?.? " I am inclined to think that the issue is that the job is started by the "anonymous" user rather than my admin user. How in hudson do I "tie" the job to be run under the admin user? Thanks in advance. Regards, Andrew

    Read the article

  • How do I make lines scale when using GLOrtho?

    - by Mason Wheeler
    I'm using GLOrtho to set up a 2D view that I can render textures onto. It works really well, up until I try to zoom in on the image. If I pass half the width and half the height of the viewport to GLOrtho, I end up with all my textures displayed twice as big as normal, which is exactly what I expect. But then I try to draw a box around part of the image and it all falls apart. I call glBegin(GL_LINE_LOOP), place the four vertices, and call glEnd, and I expect to see the same thing I would see if I drew it at normal zoom level, doubled. Instead, I get lines that are all the right length, but they all come out one pixel wide, instead of two, and it looks really bad. What am I missing?

    Read the article

  • How to publish a list of integers?

    - by Mason Wheeler
    I want to make a component that includes a list of integers as one of its serialized properties. I know I can't declare a TList<integer> as a published property, because it doesn't descend from TPersistent. I've read that you can define "fake" published properties if you override DefineProperties, but I'm not quite sure how that works, especially when it comes to creating a fake property that's a list, not a single value. Can someone point me in the right direction?

    Read the article

  • Should Marketing departments have basic HTML skills?

    - by Phil.Wheeler
    Working within an organisation as part of the in-house site development team, a lot of my team's throughput is driven by the colouring-in (marketing) department. It is their responsibility to provide approved content and imagery for the features or enhancements that we include on each iteration of the company site. One thing I've noticed in this job and several previous ones is that the Marketing department is extremely particular about wording and presentation, but has little to no understanding of the actual medium with which they're working - the web. I find that my team is constantly making best guesses for various HTML attributes like image alt text, titles, rel tags, blockquote cite attributes and the like. How reasonable is it to expect that marketing departments have a strong understanding of the purpose of HTML metadata? Should it be the developer's job to remind and inform each time or are marketing departments falling behind the technology they're working with? What could I reasonably expect our marketing department to understand and provide every time with each new work request?

    Read the article

  • Anyone know how to use TValue.AsType<TNotifyEvent> properly?

    - by Mason Wheeler
    I'm trying to use RTTI to add an event handler to a control, that may already have an event handler set. The code looks something like this: var prop: TRttiProperty; val: TValue; begin prop := FContext.GetType(MyControl.ClassInfo).GetProperty('OnChange'); val := prop.GetValue(MyControl); FOldOnChange := val.AsType<TNotifyEvent>; prop.SetValue(MyControl, TValue.From<TNotifyEvent>(self.MyOnChange)); end; I want this so I can do this in MyOnChange: begin if assigned(FOldOnChange) then FOldOnChange(Sender); //additional code here end; Unfortunately, the compiler doesn't seem to like the line FOldOnChange := val.AsType<TNotifyEvent>;. It says E2010 Incompatible types: 'procedure, untyped pointer or untyped parameter' and 'TNotifyEvent' Anyone know why that is or how to fix it? It looks right to me...

    Read the article

  • Can I get a PTypeInfo from a string?

    - by Mason Wheeler
    This is probably going to be a "no", but is there any way I can use Delphi's RTTI, either old-school or the 2010 extended RTTI, to pass in a string containing the name of a type, specifically the name of an enumerated type, and have it give me the PTypeInfo for that type? I've looked through RTTI.pas and TypInfo.pas and I don't see any function that would do that, but I might have missed something. What I'm looking for: var info: PTypeInfo; begin info := GetTypeInfoFromName('TComponentStyle'); end; Or something like that. Thing is, the name of the enumerated type would be passed in; it wouldn't be known at compile time.

    Read the article

  • RegisterClientScriptInclude doesn't work for some reason...

    - by Andrew
    Hey, I've spent at least 2 days trying anything and googling this...but for some reason I can't get RegisterClientScriptInclude to work the way everyone else has it working? First off, I am usting .NET 3.5 Ajax,...and I am including javascript in my partial page refreshes...using this code: ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "MyClientCode", script, true); It works perfectly, my javascript code contained in the script variable is included every partial refresh. The javascript in script is actually quite extensive though, and I would like to store it in a .js file,..so logically I make a .js file and try to include it using RegisterClientScriptInclude ...however i can't for the life of my get this to work. here's the exact code: ScriptManager.RegisterClientScriptInclude(this, typeof(Page), "mytestscript", "/js/testscript.js"); the testscript.js file is only included in FULL page refreshes...ie. when I load the page, or do a full postback....i can't get the file to be included in partial refreshes...have no idea why..when viewing the ajax POST in firebug I don't see a difference whether I include the file or not.... both of the ScriptManager Includes are being ran from the exact same place in "Page_Load"...so they should execute every partial refresh (but only the ScriptBlock does). anyways,..any help or ideas,..or further ways I can trouble shoot this problem, would be appreciated. Thanks, Andrew

    Read the article

  • How do I retrieve an automated report and save it to a database?

    - by Mason Wheeler
    I've got a web server that will take scripts in Python, PHP or Perl. I don't know much about any of those languages, but of the three, Python seems the least scary. It has a MySql database set up, and I know enough SQL to manage it and write queries for it. I also have a program that I want to add automated error reporting to. Something goes wrong, it sends a bug report to my server. What I don't know how to do is write a Python script that will sit on the web server and, when my program sends in a bug report, do the following: Receive the bug report. Parse it out into sections. Insert it into the database. Have the server send me an email. From what little I understand, this seems like it shouldn't be too difficult if I only knew what I was doing. Could someone point me to a site that explains the basic principles I'd need to create a script like this?

    Read the article

  • Is there any way to run "dir" directly?

    - by Mason Wheeler
    In my answer to this question, where the asker needed a fast way to get a directory listing of a folder on a network drive, I suggested using the DOS "dir" command. Unfortunately, it's a command, not a program, so you can't execute it with CreateProcess and so I had to put it in a batch file. I don't really like that solution. It feels like a hack to me. Does anyone know a way to run dir from Delphi instead of from an external batch file?

    Read the article

  • How to merge/crosslink Javadoc?

    - by Tom Wheeler
    If you have the standard Javadoc for a few different projects, how can you process them to create a single unified set of documentation in which everything is cross-linked? Ideally, the result would be similar to the documentation for the various modules in the NetBeans Platform: http://bits.netbeans.org/dev/javadoc/index.html but I've looked at their build scripts and they're predicated on you building everything from source. I'm looking for something which could also handle linking in Javadoc for third-party libraries, so I'd imagine it would need to be a post-processing operation. I can't be the first person to ever want this. Any ideas?

    Read the article

  • CRONTAB doesn't finish svndump

    - by Andrew
    I just discovered that the automated dumps I've been creating of my SVN repository have been getting cut off early and basically only half the dump is there. It's not an emergency, but I hate being in this situation. It defeats the purpose of making automated backups in the first place. The command I'm using is below. If I execute it manually in the terminal, it completes fine; the output.txt file is 16 megs in size with all 335 revisions. But if I leave it to crontab, it bails at the halfway mark, at around 8.1 megs and only the first 169 revisions. # m h dom mon dow command 18 00 * * * svnadmin dump /var/svn/repos/myproject > /home/andrew/output.txt I actually save to a dated gzipped file, and there's no shortage of space on the server, so this is not a disk space issue. It seems to bail after two seconds, so this could be a time issue, but the file size is the same every single time for the past month, so I don't think it's that either. Does crontab execute within a limited memory space?

    Read the article

  • What would be the wisest choice for a new .Net RESTful web service?

    - by Phil.Wheeler
    I want to write my first REST web service using the .Net framework. I've seen fairly passionate comments from various people about which is best and have even found some differing comments from Microsoft. My web service should be fairly simple: I want to expose bus timetable information. I figure the resources I will be concerned about are Fares Timetables (routes, stops) What would be the most appropriate (i.e. not necessarily the easiest, most fun or your personal preference) technology to use out of WCF, ADO.NET Data Services or ASP.Net MVC?

    Read the article

  • Avoiding "variable might not have been initialized"

    - by Mason Wheeler
    I recently ran across a routine that looks something like this: procedure TMyForm.DoSomething(list: TList<TMyObject>; const flag: boolean); var local: integer; begin if flag then //do something else local := ExpensiveFunctionCallThatCalculatesSomething; //do something else for i := 0 to list.Count do if flag then //do something else if list[i].IntValue > local then //WARNING HERE //do something else end; This gives Variable 'local' might not have been initialized even though you can tell by reading the code that you won't hit that line unless the code branch that initializes it has run. Now, I could get rid of this warning by adding a useless local := 0; at the top of the procedure, but I wonder if there might not be a better way to structure this to avoid the issue. Anyone have any ideas?

    Read the article

  • jQuery click event still firing on filtered element

    - by Phil.Wheeler
    I'm trying to filter button events based on whether they have a CSS class assigned to them or not. Assume I have a button like this: <button id="save-button" class="ui-state-default ui-corner-all">Save</button> I want to get jQuery to select all buttons that currently do not have a class of "ui-state-disabled". The selector I'm using looks like this: $('#save-button:not(.ui-state-disabled)').click(function() { ... }); When the button is clicked, I'll call a different function, do some stuff and then add the class 'ui-state-disabled' to the button. However the button still continues to accept click events. I'm guessing this is because of two possible causes: The event binder looks only at the initial state when binding the click event and doesn't recognise that a new class has been added later on My filter ['... :not(.ui-state-disabled)] is not correct Any observations?

    Read the article

  • Under what circumstances is jQuery's document.ready() not required?

    - by Phil.Wheeler
    While John Resig's recommendation is, quite rightly, to declare all events within a jquery.document.ready() function, I know that you don't actually have to put everything in there. In fact, there are cases where it may be more appropriate to deliberately put methods outside of the ready event. But what are those cases? Obviously best practice dictates that all events are declared within the ready event, so what would best practice be for declarations outside that event?

    Read the article

  • Is there a way to programatically check dependencies of an EXE?

    - by Mason Wheeler
    I've got a certain project that I build and distribute to users. I have two build configurations, Debug and Release. Debug, obviously, is for my use in debugging, but there's an additional wrinkle: the Debug configuration uses a special debugging memory manager, with a dependency on an external DLL. There's been a few times when I've accidentally built and distributed an installer package with the Debug configuration, and it's then failed to run once installed because the users don't have the special DLL. I'd like to be able to keep that from happening in the future. I know I can get the dependencies in a program by running Dependency Walker, but I'm looking for a way to do it programatically. Specifically, I have a way to run scripts while creating the installer, and I want something I can put in the installer script to check the program and see if it has a dependency on this DLL, and if so, cause the installer-creation process to fail with an error. I know how to create a simple CLI program that would take two filenames as parameters, and could run a DependsOn function and create output based on the result of it, but I don't know what to put in the DependsOn function. Does anyone know how I'd go about writing it?

    Read the article

  • What would your three most-telling interview questions be for a new hire?

    - by Phil.Wheeler
    I've been asked to interview my company's next junior developer candidate and I want to come up with a couple of questions that will challenge him / her. What are some of the best interview questions you asked a developer candidate that revealed the most about the person's character, ability or nature? These do not necessarily have to be technical questions, but I am after some insight into the person's ability to reason or think fast under pressure or when faced with an unusual problem.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >