Search Results

Search found 118 results on 5 pages for 'rory macdonald'.

Page 4/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • LaTeX - vertical space equivalent of \makebox ?

    - by Rory
    I'm making a LaTeX document and I'm getting success with \makebox, which puts text in an invisible box and will add extra horizontal whitespace to the end to make the whole thing fit within the size you specify. Is there something like that for vertical space? I have a few variable length paragraphs, images, etc. that I want to put in this vertical box. I want LaTeX to put in the right amount of vertical space (at the bottom) so that the whole thing is of the set size that I give it.

    Read the article

  • How to get current datetime on windows command line, in a suitable format for using in a filename?

    - by Rory
    What's a windows command line statement(s) I can use to get the current datetime in a format that I can put into a filename? I want to have a .bat file that zips up a directory into an archive with the current date & time as part of the name, eg "Code_2008-10-14_2257.zip". Is there any easy way I can do this, independent of the regional settings of the machine? I don't really mind about the date format, ideally it'd be yyyy-mm-dd but anything simple is fine. So far I've got this, which on my machine gives me "Tue_10_14_2008_230050_91" rem Get the datetime in a format that can go in a filename. set _my_datetime=%date%_%time% set _my_datetime=%_my_datetime: =_% set _my_datetime=%_my_datetime::=% set _my_datetime=%_my_datetime:/=_% set _my_datetime=%_my_datetime:.=_% rem now use the timestamp by in a new zip file name "d:\Program Files\7-Zip\7z.exe" a -r Code_%_my_datetime%.zip Code I can live with this but it seems a bit clunky. Ideally it'd be briefer and have the format mentioned earlier. I'm using Windows Server 2003 and Win XP Pro. I don't want to install additional utilities to achieve this (although I realise there are some that will do nice date formatting).

    Read the article

  • How do I simulate the usage of a sequence of web pages?

    - by Rory Becker
    I have a simple sequence of web pages written in ASP.Net 3.5 SP1. Page1 - A Logon Form.... txtUsername, txtPassword and cmdLogon Page2 - A Menu (created using DevExpress ASP.Net controls) Page3 - The page redirected to by the server in the event that the user picks the right menu option in Page2 I would like to create a threaded program to simulate many users trying to use this sequence of pages. I have managed to create a host Winforms app which Launches a new thread for each "User" I have further managed to work out the basics of WebRequest enough to perform a request which retrieves the Logon page itself. Dim Request As HttpWebRequest = TryCast(WebRequest.Create("http://MyURL/Logon.aspx"), HttpWebRequest) Dim Response As HttpWebResponse = TryCast(Request.GetResponse(), HttpWebResponse) Dim ResponseStream As StreamReader = New StreamReader(Response.GetResponseStream(), Encoding.GetEncoding(1252)) Dim HTMLResponse As String = ResponseStream.ReadToEnd() Response.Close() ResponseStream.Close() Next I need to simulate the user having entered information into the 2 TextBoxes and pressing logon.... I have a hunch this requires me to add the right sort of "PostData" to the request. before submitting. However I'm also concerned that "ViewState" may be an issue. Am I correct regarding the PostData? How do I add the postData to the request? Do I need to be concerned about Viewstate? Update: While I appreciate that Selenium or similar products are useful for acceptance testing , I find that they are rather clumsy for what amounts to load testing. I would prefer not to load 100 instances of Firefox or IE in order to simulate 100 users hitting my site. This was the reason I was hoping to take the ASPNet HttpWebRequest route.

    Read the article

  • How do I debug into an ILMerged assembly?

    - by Rory Becker
    Summary I want to alter the build process of a 2-assembly solution, such that a call to ILMerge is invoked, and the build results in a single assembly. Further I would like to be able to debug into the resultant assembly. Preparation - A simple example New Solution - ClassLibrary1 Create a static function 'GetMessage' in Class1 which returns the string "Hello world" Create new console app which references the ClassLibrary. Output GetMessage from main() via the console. You now have a 2 assembly app which outputs "Hello World" to the console. So what next..? I would like to alter the Console app build process, to include a post build step which uses ILMerge, to merge the ClassLibrary assembly into the Console assembly After this step I should be able to: Run the Console app directly with no ClassLibrary1.dll present Run the Console app via F5 (or F11) in VS and be able to debug into each of the 2 projects. Limited Success I read this blogpost and managed to achieve the merge I was after with a post-build command of... "$(ProjectDir)ILMerge.bat" "$(TargetDir)" $(ProjectName) ...and an ILMerge.bat file which read... CD %1 Copy %2.exe temp.exe ILMerge.exe /out:%2.exe temp.exe ClassLibrary1.dll Del temp.exe Del ClassLibrary1.* This works fairly well, and does in fact produce an exe which runs outside the VS environment as required. However it does not appear to produce symbols (.pdb file) which VS is able to use in order to debug into the code. I think this is the last piece of the puzzle. Does anyone know how I can make this work? FWIW I am running VS2010 on an x64 Win7 x64 machine.

    Read the article

  • Why does a change of Session State provider lead to an ASPx page yielding garbage?

    - by Rory Becker
    I have an aspnet webapp which has worked very well up until now. I was recently asked to explore ways of making it scale better. I found that seperation of database and Webapp would help. Further I was told that if I changed my session providing mechanism to SQLServer, I would be able to duplicate the Web Stack to several machines which could each call back to the state server allowing the load to be distirbuted better. This sounds logical. So I created an ASPState database using ASPNet_RegSQL.exe as detailed in many locations across the web and changed the web.config on my app from: <sessionState mode="InProc" cookieless="false" timeout="20" /> To: <sessionState mode="SQLServer" sqlConnectionString="Server=SomeSQLServer;user=SomeUser;password=SomePassword" cookieless="false" timeout="20" /> Then I addressed my app, which presented me with its logon screen and I duly logged in. Once in I was presented, not with the page I was expecting, but with: I can change the sessionstate back and forth. This problem goes away and then comes back based on which set of configuration I use. Why is this happening?

    Read the article

  • Testing InlineFormset clean methods

    - by Rory
    I have a Django project, with 2 models, a Structure and Bracket, the Bracket has a ForeignKey to a Structure (i.e. one-to-many, one Structure has many Brackets). I created a TabularInline for the admin site, so that there would be a table of Brackets on the Structure. I added a custom formset with some a custom clean method to do some extra validation, you can't have a Bracket that conflicts with another Bracket on the same Structure etc. The admin looks like this: class BracketInline(admin.TabularInline): model = Bracket formset = BracketInlineFormset class StructureAdmin(admin.ModelAdmin): inlines = [ BracketInline ] admin.site.register(Structure, StructureAdmin) That all works, and the validation works. However now I want to write some unittest to test my complex formset validation logic. My first attempt to validate known-good values is: data = {'form-TOTAL_FORMS': '1', 'form-INITIAL_FORMS': '0', 'form-MAX_NUM_FORMS': '', 'form-0-field1':'good-value', … } formset = BracketInlineFormset(data) self.assertTrue(formset.is_valid()) However that doesn't work and raises the exception: ====================================================================== ERROR: testValid (appname.tests.StructureTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/paht/to/project/tests.py", line 494, in testValid formset = BracketInlineFormset(data) File "/path/to/django/forms/models.py", line 672, in __init__ self.instance = self.fk.rel.to() AttributeError: 'BracketInlineFormset' object has no attribute 'fk' ---------------------------------------------------------------------- The Django documentation (for formset validation) implies one can do this. How come this isn't working? How do I test the custom clean()/validation for my inline formset?

    Read the article

  • Why would LaTeX ignore the font size in the documentclass

    - by Rory
    I have a LaTeX file. I'm experimenting with trying to reduce the font size (this is related to my other question here http://stackoverflow.com/questions/2636647/latex-changing-the-font-size-for-a-document-but-in-the-preamble-not-the-docum ). The LaTeX file is generated from another programme. I have edited it to start with \documentclass[4pt,a4paper,english]{report} i.e. I am trying to make the text really small. However it doesn't work. I change that 4pt to anything and the font size is the same. When running pdflatex on it, I get this message printed out. LaTeX Warning: Unused global option(s): [4pt]. That might explain why the error message is What could be going on here? How do I make it use the font size in the documentclass definition?

    Read the article

  • LaTeX - Changing the font size for a document, but in the preamble, not the document class?

    - by Rory
    I have a LaTeX document. I want to change the font size of all the text, to make it smaller. Normally I would just change the documentclass part. However I am generating LaTeX files from another programme, and it is setting the documentclass, I can't change that. However I can put things in the preamble. Is there anyway to change the font size in the preamble, without touching the documentclass declaration.

    Read the article

  • How to pass associative Array parameter from javascript to ActiveX object?

    - by Rory
    I'd like to pass an associative array (or simply an object with property names & values) to my ActiveXObject. I can't find anyone who has successfully and simply passed complex data from javascript to an ActiveX object. My ActiveX object is being loaded in IE, and it's mine so I can change the method signature & code to whatever will work. I also have control over the structure of the javascript. Without a simple way of doing this I'm thinking of url-encoding the data and sending it as a string. But that does seem a little silly if it's possible just to pass an object. The ActiveX object is coded in C# if that makes any difference...

    Read the article

  • .net example of using client certificates in web service call?

    - by Rory
    I'd like to use client certificates to verify the identity of administrative callers to my web service. Then I can issue certificates only to the people I want to call my web service and be pretty sure noone else can call it. This is in a very controlled scenario where only one or two people will get the client certificate, so distribution isn't a hard problem. This article provides a good example of how to call a web service using a client certificate. But how can I check details of the client certificate from within my web service? This old article talks about configuring IIS to do it, but I'd like to do it programmatically within my app. I think? thanks for any suggestions!

    Read the article

  • How do you manage your sqlserver database projects for new builds and migrations?

    - by Rory
    How do you manage your sql server database build/deploy/migrate for visual studio projects? We have a product that includes a reasonable database part (~100 tables, ~500 procs/functions/views), so we need to be able to deploy new databases of the current version as well as upgrade older databases up to the current version. Currently we maintain separate scripts for creation of new databases and migration between versions. Clearly not ideal, but how is anyone else dealing with this? This is complicated for us by having many customers who each have their own db instance, rather than say just having dev/test/live instances on our own web servers, but the processes around managing dev/test/live for others must be similar.

    Read the article

  • What IPC method should I use between Firefox extension and C# code running on the same machine?

    - by Rory
    I have a question about how to structure communication between a (new) Firefox extension and existing C# code. The firefox extension will use configuration data and will produce other data, so needs to get the config data from somewhere and save it's output somewhere. The data is produced/consumed by existing C# code, so I need to decide how the extension should interact with the C# code. Some pertinent factors: It's only running on windows, in a relatively controlled corporate environment. I have a windows service running on the machine, built in C#. Storing the data in a local datastore (like sqlite) would be useful for other reasons. The volume of data is low, e.g. 10kb of uncompressed xml every few minutes, and isn't very 'chatty'. The data exchange can be asynchronous for the most part if not completely. As with all projects, I have limited resources so want an option that's relatively easy. It doesn't have to be ultra-high performance, but shouldn't add significant overhead. I'm planning on building the extension in javascript (although could be convinced otherwise if really necessary) Some options I'm considering: use an XPCOM to .NET/COM bridge use a sqlite db: the extension would read from and save to it. The c# code would run in the service, populating the db and then processing data created by the service. use TCP sockets to communicate between the extension and the service. Let the service manage a local data store. My problem with (1) is I think this will be tricky and not so easy. But I could be completely wrong? The main problem I see with (2) is the locking of sqlite: only a single process can write data at a time so there'd be some blocking. However, it would be nice generally to have a local datastore so this is an attractive option if the performance impact isn't too great. I don't know whether (3) would be particularly easy or hard ... or what approach to take on the protocol: something custom or http. Any comments on these ideas or other suggestions? UPDATE: I was planning on building the extension in javascript rather than c++

    Read the article

  • Excel macro to change external data query connections - e.g. point from one database to another

    - by Rory
    I'm looking for a macro/vbs to update all the external data query connections to point at a different server or database. This is a pain to do manually and in versions of Excel before 2007 it sometimes seems impossible to do manually. Anyone have a sample? I see there are different types of connections 'OLEDB' and 'ODBC', so I guess I need to deal with different formats of connection strings?

    Read the article

  • how to call a javascript function in the top frame?

    - by Rory
    This seems really simple, but how do I call a javascript function that's defined in the top-level html, from a child frame? top html doc - 1st level frame - 2nd level frame my top html doc has a function called testFn(). In the 2nd level frame I have a button with onclick="top.testFn();" but this doesn't call the testFn(). In Firebug if I use a watch to execute top.testFn(); it says TypeError: testFn() is not a function. Should this all just work - in which case it's a problem with my documents, or is there some other way to call functions in the top-level window?

    Read the article

  • LaTeX - Changing the font sizxe for a document, but in the preamble, not the document class?

    - by Rory
    I have a LaTeX document. I want to change the font size of all the text, to make it smaller. Normally I would just change the documentclass part. However I am generating LaTeX files from another programme, and it is setting the documentclass, I can't change that. However I can put things in the preamble. Is there anyway to change the font size in the preamble, without touching the documentclass declaration.

    Read the article

  • How much effort does it take to spoof an Ip Address in a call to a webservice?

    - by Rory Becker
    I don't want to know how... Just how complicated.... I'm thinking of securing a webservice or 2 based on the incoming client ipaddress of the caller. Is this in any way secure? Surely if the IPaddress was being spoofed then the result would have to be sent back to the address that was being spoofed and therefore not reach the spoofer? Update: Ok so from what I can tell.... I should create a Gettoken() method which checks the IPaddress and passes out a cryptographically significant token with a timeout to any valid IP address. This is then required by any other method before any kind of side effect is allowed. Since an Attacker can't (likely) get the token without having a valid IP, he will be unable to validly call any of my "dangerous" webmethods ?

    Read the article

  • BlackBerry threading model

    - by Rory Fitzpatrick
    I've read a lot of comments mention in passing that the BlackBerry threading model deviates from the Java standard and can cause issues, but no amount of googling has enlightened me on what this means exactly. I've been developing a fairly large business application for the BlackBerry and, although I don't really have any previous experience with Java multi-threaded applications, haven't come across any issue that we've been able to blame on threading, other than what we caused ourselves. Can someone describe exactly how the BlackBerry threading model is different, and how I as a developer should take that into account? Obviously any links on the topic would also be great.

    Read the article

  • jQuery API counter++ pause on hover and then resume

    - by Rory
    I need to have this counter pause {stay on current div) while mouseover or hover and resume counter when mouseout. I have tried many ways but still new to jQuery API. <div id="slide_holder"> <div id="slide1" class="hidden"> <img src="images/crane2.jpg" class="fill"> </div> <div id="slide2" class="hidden"> <img src="images/extend_boom.png" class="fill"> </div> <div id="slide3" class="hidden"> <img src="images/Transformers-Bumblebee.jpg" class="fill"> </div> <script> $(function () { var counter = 0, divs = $('#slide1, #slide2, #slide3'); function showDiv () { divs.hide() // hide all divs .filter(function (index) { return index == counter % 3; }) // figure out correct div to show .fadeIn('slow'); // and show it counter++; }; // function to loop through divs and show correct div showDiv(); // show first div setInterval(function () { showDiv(); // show next div }, 3 * 1000); // do this every 10 seconds }); </script>

    Read the article

  • reStructured Text - Escape a headline?

    - by Rory
    I have a reStructuredText document. rST uses =====, etc. as a heading format. However I need to include some lines that have this text in it, e.g.: some of my text ===== stuff ===== some more of my text And I don't want the ==== to be interpreted as a heading, i.e. I don't want stuff to be a heading. I would rather that those equal signs are just displayed as is. Is this possible in rST?

    Read the article

  • Excel macro to change location of .cub files used by pivot tables? (to allow .xls files that depend

    - by Rory
    I often use Excel with pivot tables based on .cub files for OLAP-type analysis. This is great except when you want to move the xls and you realise internally it's got a non-relative reference to the location of the .cub file. How can we cope with this - ie make it convenient to move around xls files that depend on .cub files? The best answer I could come up with is writing a macro that updates the pivot tables' reference to the .cub file location....so I'll pop that in an answer.

    Read the article

  • Given the lat/lon of 2 close points on earth (<10m), How do I calculate the distance in metres?

    - by Rory
    I have the lat/lon of 2 points on the earth. They are really close together, <10m. Let's assume the earth is flat. How do I calculate the distance between them in metres? I know about tools (PostGIS, etc.) that can do this correctly, however I'm just doing a rough and ready type, and I'm OK with low accuracy. At such small sizes a difference of 1% is only 10cm, which is fine for me. I'm doing this in stock python. I'm OK with a standard Euclidean distance thing.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >