Search Results

Search found 1008 results on 41 pages for 'kevin cupp'.

Page 30/41 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Combining XmlWriter objects?

    - by Kevin
    The way my application is structured, each component generates output as XML and returns an XmlWriter object. Before rendering the final output to the page, I combine all XML and perform an XSL transformation on that object. Below, is a simplified code sample of the application structure. Does it make sense to combine XmlWriter objects like this? Is there a better way to structure my application? The optimal solution would be one where I didn't have to pass a single XmlWriter instance as a parameter to each component. function page1Xml() { $content = new XmlWriter(); $content->openMemory(); $content->startElement('content'); $content->text('Sample content'); $content->endElement(); return $content; } function generateSiteMap() { $sitemap = new XmlWriter(); $sitemap->openMemory(); $sitemap->startElement('sitemap'); $sitemap->startElement('page'); $sitemap->writeAttribute('href', 'page1.php'); $sitemap->text('Page 1'); $sitemap->endElement(); $sitemap->endElement(); return $sitemap; } function output($content) { $doc = new XmlWriter(); $doc->openMemory(); $doc->writePi('xml-stylesheet', 'type="text/xsl" href="template.xsl"'); $doc->startElement('document'); $doc->writeRaw( generateSiteMap()->outputMemory() ); $doc->writeRaw( $content->outputMemory() ); $doc->endElement(); $doc->endDocument(); $output = xslTransform($doc); return $output; } $content = page1Xml(); echo output($content); Update: I may abandon XmlWriter altogether and use DomDocument instead. It is more flexible and it also seemed to perform better (at least on the crude tests I created).

    Read the article

  • Customizing the Stars Image for Ajaxful_Rating RoR plugin

    - by Kevin
    I'm trying to come up with my own star image that's slightly smaller and different style than the one provided in the gem/plugin, but Ajaxful_rating doesn't have an easy way to do this. Here's what I've figured out so far: The stars.png in the public folder is three 25x25 pixel tiles stacked vertically, ordered empty star, normal star, and hover star. I'm assuming as long as you keep the above constraints, you should be fine without modifying any other files. But what if you want to change the image size of the stars to larger or smaller? I've found where you can change the height in the stylesheets/ajaxful_rating.css .ajaxful-rating{ position: relative; /*width: 125px; this is setted dynamically */ height: 25px; overflow: hidden; list-style: none; margin: 0; padding: 0; background-position: left top; } .ajaxful-rating li{ display: inline; } .ajaxful-rating a, .ajaxful-rating span, .ajaxful-rating .show-value{ position: absolute; top: 0; left: 0; text-indent: -1000em; height: 25px; line-height: 25px; outline: none; overflow: hidden; border: none; } You just need to change every place that says "25px" above to whatever height your new star image is. This works fine but doesn't display the horizontal part correctly. Anyone know where I would look to set the horizontal part as well? (I'm assuming it's in an .rb file somewhere based upon how many stars you specified in your ajaxful_rating setup)

    Read the article

  • Microsoft SQL Server 2005 Function, passing list of start and end times

    - by Kevin
    I'd like to do had a dynamic number of one start/end time pairs passed to a function as an input parameter. The function would then use the list instead of just one start, and one end time in a select statement. CREATE FUNCTION [dbo].[GetData] ( @StartTime datetime, @EndTime datetime ) RETURNS int AS BEGIN SELECT @EndTime = CASE WHEN @EndTime > CURRENT_TIMESTAMP THEN CURRENT_TIMESTAMP ELSE @EndTime END DECLARE @TempStates TABLE (StartTime datetime NOT NULL , EndTime datetime NOT NULL , StateIdentity int NOT NULL ) INSERT INTO @TempStates SELECT StartTime , EndTime , StateIdentity FROM State WHERE StartTime <= @EndTime AND EndTime >= @StartTime RETURN 0 END

    Read the article

  • Having problems creating an array from XML data in Acrobat Javascript, please help if you can

    - by Kevin Minke
    I have a manually created array that already works example below: var PartsData = { 179: { ref:"", partNum: "201-2007-C00-00", descript: "System Monitor Card (Tracewell Only)", cage: "39764", qty: "1", SMR: "XBOZZ", UOC: "A" }}; Now this array above is is just one value in the array and it works fine. Here is the XML that I am trying to use to dynamically change the values. <?xml version="1.0" encoding="utf-8"?> <partsTables> <partsList> <part sheetNum="ta1"> <breakDownIndexNo>-1 </breakDownIndexNo> <referenceDesg/> <indent>20534220P01 </indent> <description/> <cage>TAC RI, GRADE-A SHOCK (TEC RACK), ALT P/N 72304-1</cage> <qtyPerAssy>23991 </qtyPerAssy> <smr>1 </smr> <uoc>ADODD </uoc> <blank/> </part> </partsList> </partsTables> I have this parsing just fine in Acrobat. Now I want to make the array work for me in using these values. if I have the following below it will work. Where part.item(i).indent.value equals the value of the indent node, etc. newArr = { 179: { ref: part.item(i).referenceDesg.value, partNum: part.item(i).indent.value, descript: part.item(i).cage.value, cage: part.item(i).qtyPerAssy.value, qty: part.item(i).smr.value, SMR: part.item(i).uoc.value, UOC: part.item(i).blank.value}}; As soon as I try to make the 179 value, which is in the breakDownIndexNo node, dynamic by using the direct part.item(i).breakDownIndexNo.value it will not compile. Acrobat is using javascript so I'm not sure why I can not get this to parse. I have tried to create a variable out of the breakDownIndexNo node and typed it to both a String and an Integer. this will let it create the array but it will not let me output from the array. newArr[indexNum].partNum gives me "no properties" where newArr[179].partNum if I were to manually set the index number to 179 will print out the value of part.item(i).indent.value. If any of you have an idea or an answer please let me know.

    Read the article

  • Load page for validation but do not display it to user in ASP.NET

    - by Kevin
    We have a site requiring users pay $2 to view the details of a record. We occasionally get complaints because we send them to the payment page, and once they pay it turns out the record isn't valid, or it was lost, or the data couldn't be generated. So we want to add in a check to ensure the page constructs properly before the user is required to pay for it. However, we don't want the user to have access to the page until they pay for it. Is there anything in ASP.NET 3.5 or just general web design that would allow something like this? The data on the record is real time and computed on a backend server before sent to the client. Occasionally this computation fails for whatever reason. Our alternative is to call all of the loading methods and validate the data, then redirect them to the payment page. The problem is A) this will be a relatively involved process rewriting all of these methods to return validation information, and B) it still doesn't guarentee us the page will load properly. Any thoughts?

    Read the article

  • Why is the dictionary debug visualizer less useful in Visual Studio 2010 for Silverlight debugging?

    - by Kevin
    I was debugging in Visual Studio 2010, which we just installed and trying to look at a dictionary in the quick watch window. I see Keys and Values, but drilling into those shows the Count and Non-Public members, Non-Public members continues the trail and I never see the values in the dictionary. I can run test.Take(10) and see the values, but why should I have to do that. I don't have VS 2008 installed anymore to compare, but it seems that I could debug a dictionary much easier. Why is it this way now? Is it just a setting I set somehow on my machine? Test code: Dictionary<string, string> test = new Dictionary<string, string>(); test.Add("a", "b"); EDIT: I've just tried the same debug in a Console app and it works as expected. The other project is a Silverlight 4 application, why are they different? Console Debug Screen Shot Silverlight 4 Debug Screen Shot:

    Read the article

  • One-liner javascript to collect values from object graph?

    - by Kevin Pauli
    Given the following object graph: { "children": [ { "child": { "pets": [ { "pet": { "name": "fido" } }, { "pet": { "name": "fluffy" } } ] } }, { "child": { "pets": [ { "pet": { "name": "spike" } } ] } } ] } What would be a nice one-liner (or two) to collect the names of my grandchildren's pets? The result should be ["fido", "fluffy", "spike"] I don't want to write custom methods for this... I'm looking for something like the way jQuery works in selecting dom nodes, where you can just give it a CSS-like path and it collects them up for you. I would expect the expression path to look something like "children child pets pet name"

    Read the article

  • Learning rails and AJAX. How do I load a div via ajax and then toggle hiding/showing it?

    - by Kevin L.
    I'm doing my first Ruby on Rails project. I am working on a project where the user can add a new message. Then they can add updates to this message like a thread. I've got it all written and now I'm going back and applying some AJAX. I want to show just the main message when the page first loads. Then when I click a link I want an AJAX event to fire that populates a div with all the updates to the message. Then I want this same link to toggle hiding and showing the div. I've made a submit button to fire the ajax and get back the updates using form_remote_tag. I've also created a separate link to toggle the hiding using $(div_id).toggle();. But now I'm stuck on how to combine these two things into one all purpose link. Thanks.

    Read the article

  • Problems with Ruby "||" "or"?

    - by Kevin
    Beginning Ruby Question: I'm trying to see if a string variable's contents is either "personal" "email" or "password". I'm trying: if params[:action] == "password" || "email" || "personal" foo else don't foo end But that doesn't work and returns strange results, and using IRB to play around with "or" statements I have no idea why the following happens: irb(main):040:0> a = "email" => "email" irb(main):041:0> a == "password" || "email" => "email" irb(main):042:0> a == "email" || "password" => true I just want something that if any of the 3 variables are true no matter what order they are in it returns true, if not it returns false. Anyone want to help this n00b out?

    Read the article

  • Permutation on Rails Routes

    - by Kevin Sylvestre
    I currently have an application that for a set of parameters (location, category, budget, ...) a user can enter a "pretty" URL like: /location/canada/ontario /category/primary /budget/small Resulting in the respective parameters: params[:country] == 'canada' and params[:region] == 'ontario' params[:category] == 'primary' params[:budget] == 'small' I want to allow users to perform searches on multiple parameters at once (with each parameter optional). For example: /location/canada/ontario/category/primary/budget/small I understand that this can be achieved using URL parameters, but for SEO reasons I prefer to add the "pretty" parameters. Is this at all possible without listing all possible combination of routes (I have a large number of search-able fields)? I understand that route "globbing" maybe play a roll, but I am not sure how. Thanks.

    Read the article

  • Why isn't this simple test class's method inherited in Ruby?

    - by Kevin Bannister
    Consider this very simple logging class: class MockLog def self.log_stub_method(*args) args.each do |a| define_method "#{a}" do |msg| t = Time.now.strftime("%Y-%m-%d %H:%M:%S") $stderr.puts "[#{a.upcase}] \u00bb [#{t}] #{msg}" end end end log_stub_method :fatal, :error, :warn, :info, :debug end Let's add logging to all our classes: class Module def has_logging() class_eval { @log = MockLog.new def log self.class.instance_variable_get :@log end } end end Now, why doesn't this work? class Foo has_logging end Foo.new.log.nil? # => false, as expected class Bar < Foo end Bar.new.log.nil? # => true?! Why wasn't the `log` method inherited?

    Read the article

  • Auto fit iframe

    - by kevin
    I have a difficulty on design a web page layout. This is my layout structure. <style> #left { float:left; width:600px; min-height:400px; } #right { float:right; width:200px; min-height:400px; } </style> <body> <center> <div id="page"> <div id="left"> <iframe /> </div> <div id="right">right panel</div> <div id="footer">footer</div> </center> </div> </body> How can i make the both left & right div grow when the right div's child increase more than the min height? How can i make the both left & right div grow when the content in the iframe is longer than the min height?

    Read the article

  • Does HttpWebRequest automatically take care of certificate validation?

    - by Kevin Pang
    I'm using an HttpWebRequest object to access a web service via an HTTP POST. Part of the requirement is that I: Verify that the URL in the certificate matches the URL I'm posting to Verify that the certificate is valid and trusted Verify that the certificate has not expired Does HttpWebRequest automatically handle that for me? I'd assume that if any of these conditions came up, I'd get the standard "could not establish trust relationship for the SSL/TLS secure channel" exception.

    Read the article

  • Viable development for iPhone after 3.3.1 change?

    - by Kevin
    With the latest changes to the developer agreement by Apple, how inherant is the risk of using any kind of framework to develop Apps for devices now? Should shops risk using things like MonoTouch, Three20, Appcelerator since this change? How are some iPhone/iPad developers here handling it? http://www.pcworld.com/article/193916/apples_new_iphone_app_policy_unreasonable_and_unjustifiable.html http://www.wired.com/gadgetlab/2010/04/iphone-flash-policy-steve-jobs/ http://37signals.com/svn/posts/2273-five-rational-arguments-against-apples-331-policy

    Read the article

  • Weird margin in a list

    - by kevin
    I'm trying to style a menu, but I keep running into this weird margin that's appearing in both FF4 and IE. This is the only affecting css: #header ul { display: inline; } #header ul li { list-style-type: none; background: #000; display: inline; margin: 0; padding: 0; } #header ul li a { color: #fff; text-decoration: none; display: inline-block; width: 100px; text-align: center; } And this is the HTML: <div id="header"> <ul id="toplinks"> <li><a href="#">Hello</a></li> <li><a href="#">Herp</a></li> <li><a href="#">Derp</a></li> </ul> </div> As you can see, there's a margin appearing on both sides, and I'd like it so it would have no margin (or maybe 1px would be okay)...

    Read the article

  • How do I put all the types matching a particular C# interface in an IDictionary?

    - by Kevin Brassen
    I have a number of classes all in the same interface, all in the same assembly, all conforming to the same generic interface: public class AppleFactory : IFactory<Apple> { ... } public class BananaFactory : IFactory<Banana> { ... } // ... It's safe to assume that if we have an IFactory<T> for a particular T that it's the only one of that kind. (That is, there aren't two things that implement IFactory<Apple>.) I'd like to use reflection to get all these types, and then store them all in an IDictionary, where the key is typeof(T) and the value is the corresponding IFactory<T>. I imagine eventually we would wind up with something like this: _map = new Dictionary<Type, object>(); foreach(Type t in [...]) { object factoryForType = System.Reflection.[???](t); _map[t] = factoryForType; } What's the best way to do that? I'm having trouble seeing how I'd do that with the System.Reflection interfaces.

    Read the article

  • Preloading Image Bug in IE6-8

    - by Kevin C.
    Page in question: http://phwsinc.com/our-work/one-rincon-hill.asp In IE6-8, when you click the left-most thumbnail in the gallery, the image never loads. If you click the thumbnail a second time, then it will load. I'm using jQuery, and here's my code that's powering the gallery: $(document).ready(function() { // PROJECT PHOTO GALLERY var thumbs = $('.thumbs li a'); var photoWrapper = $('div.photoWrapper'); if (thumbs.length) { thumbs.click( function(){ photoWrapper.addClass('loading'); var img_src = $(this).attr('href'); // The two lines below are what cause the bug in IE. They make the gallery run much faster in other browsers, though. var new_img = new Image(); new_img.src = img_src; var photo = $('#photo'); photo.fadeOut('slow', function() { photo.attr('src', img_src); photo.load(function() { photoWrapper.removeClass('loading'); photo.fadeIn('slow'); }); }); return false; }); } }); A coworker told me that he's always had problems with the js Image() object, and advised me to just append an <img /> element inside of a div set to display:none;, but that's a little messy for my tastes--I liked using the Image() object, it kept things nice and clean, no unnecessary added HTML markup. Any help would be appreciated. It still works without the image preloading, so if all else fails I'll just wrap the preloading in an if !($.browser.msie){ } and call it a day.

    Read the article

  • Knowing which annotation is selected and accessing properties of it.

    - by kevin Mendoza
    So far my program can display a database of custom annotation views. Eventually I want my program to be able to display extra information after a button on the annotation bubble is clicked. Each element in the database has a unique entry Number, so I thought it would be a good idea to add this entry number as a property of the custom annotation. The problem I am having is that after the button is clicked and the program switches to a new view I am unable to retrieve the entry number of the annotation I selected. Below is the code that assigns the entry Number property to the annotation: for (id mine in mines) { workingCoordinate.latitude = [[mine latitudeInitial] doubleValue]; workingCoordinate.longitude = [[mine longitudeInitial] doubleValue]; iProspectAnnotation *tempMine = [[iProspectAnnotation alloc] initWithCoordinate:workingCoordinate]; [tempMine setTitle:[mine mineName]]; [tempMine setAnnotationEntryNumber:[mine entryNumber]]; } [mines dealloc]; When the button on an annotation is selected, this is the code that initializes the new view: - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { mineInformationController *controller = [[mineInformationController alloc] initWithNibName:@"mineInformationController" bundle:nil]; controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:controller animated:YES]; [controller release]; } and lastly is my attempt at retrieving the entryNumber property from the new view so that I can compare it to the mines database and retrieve more information on the array element. iProspectFresno_LiteAppDelegate *appDelegate = (iProspectFresno_LiteAppDelegate *)[[UIApplication sharedApplication] delegate]; NSMutableArray* mines = [[NSMutableArray alloc] initWithArray:(NSMutableArray *)appDelegate.mines]; for(id mine in mines) { if ([[mine entryNumber] isEqualToNumber: /*the entry Number of the selected annotation*/]) { /* display the information in the mine object */ } } So how do I access this entry number property in this new view controller?

    Read the article

  • floating a div with jquery/offset - ignores href hashtag

    - by Kevin Crawley
    <script type="text/javascript"> $(document).ready(function () { var top = $('#rt_outer').offset().top - parseFloat($('#rt_outer').css('marginTop').replace(/auto/, 0)); $(window).scroll(function (event) { // what the y position of the scroll is var y = $(this).scrollTop(); // whether that's below the form if (y >= top) { // if so, ad the fixed class $('#rt_outer').addClass('fixed'); } else { // otherwise remove it $('#rt_outer').removeClass('fixed'); } }); }); </script> The problem is fairly straight forward. If I use a header redirect to a new location in the page (say half way down, I jump to #halfway after processing a php script using header("somepage.php#halfway") the div container which is handled by this script won't jump down until the page is scrolled in either direction. I know there is a solution to this, I just don't know what.

    Read the article

  • Learning PHP - start out using a framework or no?

    - by Kevin Torrent
    I've noticed a lot of jobs in my area for PHP. I've never used PHP before, and figure if I can get more opportunities if I pick it up then it might be a good idea. The problem is that PHP without any framework is ugly and 99% of the time really bad code. All the tutorials and books I've seen are really lousy - it never shows any kind of good programming practice but always the quick and dirty kind of way of doing things. I'm afraid that trying to learn PHP this way will just imprint these bad practices in my head and make me waste time later trying to unlearn them. I've used C# in the past so I'm familiar with OOP and software design patterns and similar. Should I be trying to learn PHP by using one of the better known frameworks for it? I've looked at CakePHP, Symfony and the Zend Framework so far; Zend seems to be the most flexible without being too constraining like Cake and Symfony (although Symfony seemed less constraining than CakePHP which is trying too hard to be Ruby on Rails), but many tutorials for Zend I've seen assume you already know PHP and want to learn to use the framework. What would be my best opportunity for learning PHP, but learning GOOD PHP that uses real software engineering techniques instead of spaghetti code? It seems all the PHP books and resources either assume you are just using raw PHP and therefore showcase bade practices, or that you already know PHP and therefore don't even touch on parts of the language.

    Read the article

  • Registering Drupal Menu Paths?

    - by Kevin
    If I am making a module, and want to have two custom paths: path/path/path/index.htm (calls drupal_get_form) and post to path/path/path/result.htm How do you do that? I get a 404 on the second path. I get the form and what I want with the first path easily enough. All I want to do is theme the form results as a drupal table and display it here.

    Read the article

  • how do I get the program to Know which annotation is selected and be able to access properties of it

    - by kevin Mendoza
    So far my program can display a database of custom annotation views. Eventually I want my program to be able to display extra information after a button on the annotation bubble is clicked. Each element in the database has a unique entry Number, so I thought it would be a good idea to add this entry number as a property of the custom annotation. The problem I am having is that after the button is clicked and the program switches to a new view I am unable to retrieve the entry number of the annotation I selected. Below is the code that assigns the entry Number property to the annotation: for (id mine in mines) { workingCoordinate.latitude = [[mine latitudeInitial] doubleValue]; workingCoordinate.longitude = [[mine longitudeInitial] doubleValue]; iProspectAnnotation *tempMine = [[iProspectAnnotation alloc] initWithCoordinate:workingCoordinate]; [tempMine setTitle:[mine mineName]]; [tempMine setAnnotationEntryNumber:[mine entryNumber]]; } [mines dealloc]; When the button on an annotation is selected, this is the code that initializes the new view: - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { mineInformationController *controller = [[mineInformationController alloc] initWithNibName:@"mineInformationController" bundle:nil]; controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:controller animated:YES]; [controller release]; } and lastly is my attempt at retrieving the entryNumber property from the new view so that I can compare it to the mines database and retrieve more information on the array element. iProspectFresno_LiteAppDelegate *appDelegate = (iProspectFresno_LiteAppDelegate *)[[UIApplication sharedApplication] delegate]; NSMutableArray* mines = [[NSMutableArray alloc] initWithArray:(NSMutableArray *)appDelegate.mines]; for(id mine in mines) { if ([[mine entryNumber] isEqualToNumber: /*the entry Number of the selected annotation*/]) { /* display the information in the mine object */ } } So how do I access this entry number property in this new view controller?

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >