Search Results

Search found 2769 results on 111 pages for 'mike murphy'.

Page 77/111 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • How is this Perl code selecting two different elements from an array?

    - by Mike
    I have inherited some code from a guy whose favorite past time was to shorten every line to its absolute minimum (and sometimes only to make it look cool). His code is hard to understand but I managed to understand (and rewrite) most of it. Now I have stumbled on a piece of code which, no matter how hard I try, I cannot understand. my @heads = grep {s/\.txt$//} OSA::Fast::IO::Ls->ls($SysKey,'fo','osr/tiparlo',qr{^\d+\.txt$}) || (); my @selected_heads = (); for my $i (0..1) { $selected_heads[$i] = int rand scalar @heads; for my $j (0..@heads-1) { last if (!grep $j eq $_, @selected_heads[0..$i-1]); $selected_heads[$i] = ($selected_heads[$i] + 1) % @heads; #WTF? } my $head_nr = sprintf "%04d", $i; OSA::Fast::IO::Cp->cp($SysKey,'',"osr/tiparlo/$heads[$selected_heads[$i]].txt","$recdir/heads/$head_nr.txt"); OSA::Fast::IO::Cp->cp($SysKey,'',"osr/tiparlo/$heads[$selected_heads[$i]].cache","$recdir/heads/$head_nr.cache"); } From what I can understand, this is supposed to be some kind of randomizer, but I never saw a more complex way to achieve randomness. Or are my assumptions wrong? At least, that's what this code is supposed to do. Select 2 random files and copy them. === NOTES === The OSA Framework is a Framework of our own. They are named after their UNIX counterparts and do some basic testing so that the application does not need to bother with that.

    Read the article

  • Combining 2 Linq queries into 1

    - by Mike Fielden
    Given the following information, how can I combine these 2 linq queries into 1. Having a bit of trouble with the join statement. 'projectDetails' is just a list of ProjectDetails ProjectDetails (1 to many) PCardAuthorizations ProjectDetails (1 to many) ExpenditureDetails Notice I am grouping by the same information and selecting the same type of information var pCardAccount = from c in PCardAuthorizations where projectDetails.Contains(c.ProjectDetail) && c.RequestStatusId == 2 group c by new { c.ProjectDetail, c.ProgramFund } into g select new { Key = g.Key, Sum = g.Sum(x => x.Amount) }; var expenditures = from d in ExpenditureDetails where projectDetails.Contains(d.ProjectDetails) && d.Expenditures.ExpenditureTypeEnum == 0 group d by new { d.ProjectDetails, d.ProgramFunds } into g select new { Key = g.Key, Sum = g.Sum(y => y.ExpenditureAmounts.FirstOrDefault(a => a.IsCurrent && !a.RequiresAudit).CommittedMonthlyRecords.ProjectedEac) };

    Read the article

  • Google Chrome Printing Page Breaks

    - by Mike Valstar
    I'm trying to get google chrome to do page breaks. I've been told via a bunch of websites that page-break-after: always; is valid in chrome but I can not seem to get it to work even with a very simple example. is there any way to force a page break when printing in chrome?

    Read the article

  • Visual Studio keeps running the old build

    - by Mike Pike
    Hello. I have a simple Silverlight program that displays a bunch of images. I modified it do display more images, but it when I hit "run without debugging" is keeps running the old build with fewer images. When I copy the code into a new project and run it, it works fine for the first time, but then each subsequent change is not displayed. What could be the problem? I'm using Visual Web Developer 2008 Express.

    Read the article

  • How to get site context/information during the PreapplicationStartMethod

    - by Mike
    When you run the same web based application as a multi-tenant application for different clients is there a way during the PreapplicationStartMethod to gain some kind of context to the site that is being started? More specifically I'd like to get the host header information (the "bindingInformation" attribute value from the applicationHost.config); I have found ways to get this information at the time of a specific request long after the application has started. Is there a way to get the information during the application startup process? This is an MVC 3 application and IIS 7.5.

    Read the article

  • How to call a method withgin a vector?

    - by Mike Dooley
    Hi! How do I call a method of an object which is stored within a vector? The following code fails... ClassA* class_derived_a = new ClassDerivedA; ClassA* class_another_a = new ClassAnotherDerivedA; vector<ClassA*> test_vector; test_vector.push_back(class_derived_a); test_vector.push_back(class_another_a); for (vector<ClassA*>::iterator it = test_vector.begin(); it != test_vector.end(); it++) it->printOutput(); The code retrieves the following error: test3.cpp:47: error: request for member ‘printOutput’ in ‘* it.__gnu_cxx::__normal_iterator<_Iterator, _Container::operator- with _Iterator = ClassA**, _Container = std::vector ’, which is of non-class type ‘ClassA*’ The problem seems to be it->printOutput(); but at the moment I don't know how to call the method properly, does anyone know? regards mikey

    Read the article

  • Creating a Linq->HQL provider

    - by Mike Q
    Hi all, I have a client application that connects to a server. The server uses hibernate for persistence and querying so it has a set of annotated hibernate objects for persistence. The client sends HQL queries to the server and gets responses back. The client has an auto-generated set of objects that match the server hibernate objects for query results and basic persistence. I would like to support using Linq to query as well as Hql as it makes the queries typesafe and quicker to build (no more typos in HQL string queries). I've looked around at the following but I can't see how to get them to fit with what I have. NHibernate's Linq provider - requires using NHibernate ISession and ISessionFactory, which I don't have LinqExtender - requires a lot of annotations on the objects and extending a base type, too invasive What I really want is something that will generate give me a nice easy to process structure to build the HQL queries from. I've read most of a 15 page article written by one of the C# developers on how to create custom providers and it's pretty fraught, mainly because of the complexity of the expression tree. Can anyone suggest an approach for implementing Linq - HQL translation? Perhaps a library that will the cleanup of the expression tree into something more SQL/HQLish. I would like to support select/from/where/group by/order by/joins. Not too worried about subqueries.

    Read the article

  • WiX: .Net 3.5 prerequisite

    - by Mike Pateras
    I have a WiX installer that I would like to check for .Net 3.5, and install it if it does not exist. I have the following lines in my wixproj file: <BootstrapperFile Include="Microsoft.Net.Framework.3.5"> <ProductName>.NET Framework 3.5</ProductName> </BootstrapperFile> <BootstrapperFile Include="Microsoft.Windows.Installer.3.1"> <ProductName>WIndows Installer 3.1</ProductName> </BootstrapperFile> When I create the installer, a DotNetFX35 folder is created, and in it are 4 different versions of .Net (including 3.5), and an installer file. I have two questions: How do I have it only bring in version 3.5 (so that the user doesn't have to install 100+ MB of files)? How do I tell WiX to package these files up into the MSI file, so that the user only has to download 1 file?

    Read the article

  • Infinite loop in haskell? (newbie)

    - by Mike
    I'm just learning Haskell. I thought this would produce a factorial function... (within ghci) Prelude let ft 0 = 1 Prelude let ft n = n * ft (n - 1) Prelude ft 5 (hangs indefinitely, until ^C). Can someone point me in the right direction? Thanks!

    Read the article

  • Why Instruments report a leak?

    - by mike
    Hi, I am developing an iphone app. Instruments reported a leaked object ServiceTypes. Below is the relevant code. Does anyone have any ideas? Thanks a lot for your help. ServiceTypes *serviceTypes = [[ServiceTypes alloc] init]; if ([userConnection getServiceTypes:serviceTypes]) { if ([serviceTypes.types length] 0) { NSArray *array = [[NSArray alloc] initWithArray:[serviceTypes.types componentsSeparatedByString: SERVICE_TYPE_DELIMITOR]]; serviceRequestTypes = [[NSMutableArray alloc] initWithArray:array]; [array release]; } } [[self typesTableView] reloadData]; [serviceTypes release];

    Read the article

  • Updating only .dll of a reference in my ASP.NET Application

    - by Mike C.
    Hello, I have a deployed web application project that references my Utility.dll class library. I want to make a change to the Utlity.dll and roll only that .dll out. The problem is that when I do that, I get the following error when I try to launch my site: Could not load file or assembly 'Utility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3766481cef20a9d1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Is there a setting I can change so I don't have to roll out the entire web application project - only the Utlity.dll? Thanks!

    Read the article

  • Perl, dereference array of references

    - by Mike
    In the following Perl code, I would expect to be referencing an array reference inside an array #!/usr/bin/perl use strict; use warnings; my @a=([1,2],[3,4]); my @b = @$a[0]; print $b[0]; However it doesn't seem to work. I would expect it to output 1. @a is an array of references @b is $a[1] dereferenced (I think) So what's the problem?

    Read the article

  • How do set default values in django for an HttpRequest.GET?

    - by Mike
    I have a webpage that displays data based on a default date. The user can then change their view of the data by slecting a date with a date picker and clicking a submit button. I already have a variable set so that if no date is chosen, a default date is used.... so what's the problem? The problem comes if the user trys to type in the url page without a parameter... like so: http://mywebpage/viewdata (example A) instead of http://mywebpage/viewdata?date= (example B) I tried using: if request.method == 'GET': but apparently, even example A still returns true. I'm sure I'm doing some obvious beginner's mistake but I'll ask anyway... Is there a simpler way to handle example A other than passing the url to a string and checking the string for "?date="?

    Read the article

  • Set height of Flex Accordion to height of tallest child

    - by Mike Deck
    By default the height of an Flex Accordion container is the height of the initially selected child. I'd like to be able to set the height to the tallest child so that no resizing or scrolling is necessary when other children are selected. I do not want to use the resizeToContent property. I want the size of the container to stay constant no matter what child is selected. My current thought is to extend the accordion class setting the creation policy to "all" and then override the measure function to loop through all the children and find the tallest one and use that for the height. This seems a little kludgy though, so I'd like to know if there is a better approach. Ultimately my question is: is there a way to set the size of an accordion container such that the container never resizes and scoll bars are never necessary to display any of the children?

    Read the article

  • UIScrollView - with paging enabled, can I "change" the page width?

    - by Mike McMaster
    What's the simplest way to have a scroll view (with pagingEnabled set to YES) have a page width set to something other than the scroll view's bounds? Let me give an example. Suppose I have a scroll view with 10 items, each 150 pixels wide, and my scroll view is 300 pixels wide. If I start with views 1 and 2 visible and scroll horizontally to the right, I want the next "page" to show items 2 and 3. If I scroll one more page to the right, I would see items 3 and 4. Has anyone done this? If not, what strategy would you use?

    Read the article

  • How to rotate a drawable with anti-aliasing enabled

    - by Mike
    I need to rotate an ImageView by a few degrees. I'm doing this by subclassing ImageView and overloading onDraw() @Override protected void onDraw(Canvas canvas) { canvas.save(); canvas.scale(0.92f,0.92f); canvas.translate(14, 0); canvas.rotate(1,0,0); super.onDraw(canvas); canvas.restore(); } The problem is that the image that results shows a bunch of jaggies. How can I antialias an ImageView that I need to rotate in order to eliminate jaggies? Is there a better way to do this?

    Read the article

  • Codebase for making a Flash-based interactive map with SVG vector data?

    - by Mike
    I'm looking for a way to take SVG path info (basically a string of coordinates) and dynamically draw it with Actionscript. Icing on the cake would be if those shapes could detect mouse events to trigger JS and dynamically change their appearance (fill, stroke, etc...). I'm currently trying something similar to this (http://raphaeljs.com/australia.html) using SVG but it's just too slow in IE. I've also tried Google's SVG Web (http://code.google.com/p/svgweb/) which basically does exactly what I'm looking for (it converts SVG to Flash in IE) but again, it's sloooooow - which is why I'm considering doing the whole shebang in Flash. Anyone know of some links to point me in the right direction?

    Read the article

  • How do I export a package symbol to a namespace in Perl?

    - by Mike
    I'm having trouble understanding how to export a package symbol to a namespace. I've followed the documentation almost identically, but it seems to not know about any of the exporting symbols. mod.pm #!/usr/bin/perl package mod; use strict; use warnings; require Exporter; @ISA = qw(Exporter); @EXPORT=qw($a); our $a=(1); 1; test.pl $ cat test.pl #!/usr/bin/perl use mod; print($a); This is the result of running it $ ./test.pl Global symbol "@ISA" requires explicit package name at mod.pm line 10. Global symbol "@EXPORT" requires explicit package name at mod.pm line 11. Compilation failed in require at ./test.pl line 3. BEGIN failed--compilation aborted at ./test.pl line 3. $ perl -version This is perl, v5.8.4 built for sun4-solaris-64int

    Read the article

  • unix shell, redirect output but keep on stdin

    - by Mike
    I'd like to have a shell script redirect stdout of a child process in the following manner Redirect stdout to a file Display the output of the process in real time I know I could do something like #!/bin/sh ./child > file cat file But that would not display stdout in real time. For instance, if the child was #!/bin/sh echo 1 sleep 1 echo 2 The user would see "1" and "2" printed at the same time

    Read the article

  • How can I tell Phusion Passenger which python to use?

    - by Mike
    I'm using Phusion Passenger with a ruby app and I'd also like to set it up to work with an django appengine app I'm working on. Googling for "passenger_wsgi.py" I was able to get the following very simple non-django app working on passenger: passenger_wsgi.py: def application(environ, start_response): response_headers = [('Content-type','text/plain')] start_response('200 OK', response_headers) return ['Hello World!\n'] However, if I add the line import django.core.handlers.wsgi into the mix, I get 'An error occurred importing your passenger_wsgi.py'. By printing out the sys.path I've discovered that at least part of the reason is because Passenger is using the wrong python installation on my machine. How can I configure Passenger (on apache) to use /opt/local/bin/python2.5 instead of the system default python?

    Read the article

  • Javascript parent and child window functions

    - by Mike Thornley
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Lab 9-3</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function myFunction(){ myWin = open("","","width=200,height=200"); with(myWin.document){ open(); write("<HTML><HEAD><TITLE>Child Window</TITLE>"); write("<SCRIPT>function myTest(){"); write("alert('This function is defined in the child window "); write("and is called from the parent window.'); this.focus();}"); write("</SCRIPT></HEAD><BODY><H3>Child Window</H3><HR>"); write("<FORM><INPUT TYPE='button' VALUE='parent window function' "); // Use opener property write("onClick='opener.winFunction();'>"); write("<P><INPUT TYPE='button' VALUE='close window' "); write("onClick='window.close();'>"); write("</FORM></BODY></HTML>"); close(); } } function winFunction(){ alert("This function is defined in the parent window\n" + "and is called from the child window."); myWin.focus(); } //--> </SCRIPT> </HEAD> <BODY> <H3>CIW Web Languages</H3> <HR> <FORM NAME="myForm"> <INPUT TYPE="button" VALUE="open new window" onClick="myFunction();"> <!-- Invoke child window function --> <input type="button" value="Click to open child window" onclick="javascript:void(myWin.myTest());"/> </FORM> <P> </BODY> </HTML> To explain further what my initial query was, the code above, should open the child window (myWin) with the second button, the 'Open child window' button without the need to open the window with the first button or do anything else. It should simply call the myWin.myTest()function The child window will open when the second button is pressed but needs to have the child window open first (first button push) before it'll work. This is not the intended purpose, the 'Open child window' button should work without anything else needing to be done. For some reason the parent window isn't communicating with the myWin window and myTest fucntion. It's not homework, it's part of a certification course lab and is coded in the manner I have been shown to understand as correct. DTD isn't included as the focus is the JavaScript. I code correctly with regards to that and other W3C requirements.

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >