Search Results

Search found 745 results on 30 pages for 'kyle clarke'.

Page 21/30 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Struts2 Converting Enum Array fills array with single null value

    - by Kyle Partridge
    For a simple action class with these member variables: ... private TestConverterEnum test; private TestConverterEnum[] tests; private List<TestConverterEnum> tList; ... And a simple enum: public enum TestConverterEnum { A, B, C; } Using the default struts2 enum conversion, when I send the request like so: TestConterter.action?test=&tests=&tList=&b=asdf For test I get a null value, which is expected. For the Array and List, however, I get and Array (or list) with one null element. Is this what is expected? Is there a way to prevent this. We recently upgraded our struts2 version, and we had our own converters, which also don't work in this case, so I was hoping to use the default conversion method. We already have code that is validating these arrays for null and length, and I don't want to have to add another condition to these branches. Is there a way to prevent this bevavior?

    Read the article

  • Stata Nearest neighbor of percentile

    - by Kyle Billings
    This has probably already been answered, but I must just be searching for the wrong terms. Suppose I am using the built in Stata data set auto: sysuse auto, clear and say for example I am working with 1 independent and 1 dependent variable and I want to essentially compress down to the IQR elements, min, p(25), median, p(75), max... so I use command, keep weight mpg sum weight, detail return list local min=r(min) local lqr=r(p25) local med = r(p50) local uqr = r(p75) local max = r(max) keep if weight==`min' | weight==`max' | weight==`med' | weight==`lqr' | weight==`uqr' Hence, I want to compress the data set down to only those 5 observations, and for example in this situation the median is not actually an element of the weight vector. there is an observation above and an observation below (due to the definition of median this is no surprise). is there a way that I can tell stata to look for the nearest neighbor above the percentile. ie. if r(p50) is not an element of weight then search above that value for the next observation? The end result is I am trying to get the data down to 2 vectors, say weight and mpg such that for each of the 5 elements of weight in the IQR have their matching response in mpg. Any thoughts?

    Read the article

  • awk - Remove line if field is duplicate

    - by Kyle
    Looking for an awk (or sed) one-liner to remove lines from the output if the first field matches. An example for removing duplicate lines I've seen is: awk 'a !~ $0; {a=$0}' Tried using it for a basis with no luck (I thought changing the $0's to $1's would do the trick, but didn't seem to work).

    Read the article

  • How would you compare jQuery objects?

    - by Kyle
    So I'm trying to figure out how to compare two jQuery objects, to see if the parent element is the body of a page. here's what I got: if ( $(this).parent() === $('body') ) ... I know this is wrong, but if anybody understands what I'm getting at, could they point me towards the correct way of doing this?

    Read the article

  • Foo f = Foo(); // no matching function for call to 'Foo::Foo(Foo)' ... huh?!

    - by Kyle
    class Foo { public: explicit Foo() {} explicit Foo(Foo&) {} }; Foo d = Foo(); error: no matching function for call to 'Foo::Foo(Foo)' I tried changing Foo(Foo&) to Foo(Foo) as the error suggests, which AFAIK is not a valid constructor, and sure enough I get: error: invalid constructor; you probably meant ‘Foo (const Foo&)’ What gives? How do I resolve this? (This is on GCC by the way)

    Read the article

  • avoiding the tedium of optional parameters

    - by Kyle
    If I have a constructor with say 2 required parameters and 4 optional parameters, how can I avoid writing 16 constructors or even the 10 or so constructors I'd have to write if I used default parameters (which I don't like because it's poor self-documentation)? Are there any idioms or methods using templates I can use to make it less tedious? (And easier to maintain?)

    Read the article

  • Onclick event; If and Else

    - by Kyle Gagnon
    All right so I am doing a javascript code for a login type form and it will lead you to a new page. Here it is: function submit1() { var x=document.getElementById("username"); var y=document.getElementById("password"); if (x.value=="username" && y.value=="password") { window.location="Example.php"; } else { window.alert=("The information you have submitted is incorrect and needs to be submitted again!"); } } When ever I am hitting the submit button it takes me straight to the page instead of checking to see if it right. Please help! Thank you in advanced! To let you know this is not a permanet login page!

    Read the article

  • php.ini not being read with windows 7 installation

    - by Kyle
    I have installed php successfully on a Windows 7 machine but I can not for the life of me get it to read the php.ini file. I have uncommented out the line for php to use mysql and when I run phpinfo(), it never shows up. I have checked to make sure there is only one php.ini file on my entire c:\ drive and it's sitting in my c:\windows folder. has anyone else run into this and know of a solution to get php to read the .ini so that I can enable some extensions (mysql etc)?

    Read the article

  • Does the JPQL avg aggregate function work with Integers?

    - by Kyle Renfro
    I have a JPA 2 Entity named Surgery. It has a member named transfusionUnits that is an Integer. There are two entries in the database. Executing this JPQL statement: Select s.transfusionUnits from Surgery s produces the expected result: 2 3 The following statement produces the expected answer of 5: Select sum(s.transfusionUnits) from Surgery s I expect the answer of the following statement to be 2.5, but it returns 2.0 instead. Select avg(s.transfusionUnits) from Surgery s If I execute the statement on a different (Float) member, the result is correct. Any ideas on why this is happening? Do I need to do some sort of cast in JPQL? Is this even possible? Surely I am missing something trivial here.

    Read the article

  • WPF MenuItem Content "Name"...

    - by Kyle
    Hi, I have a LOT of MenuItem(s), and I want to be able to change their "Content" so that it displays in the program. When I load up the program, their "Content Name" is set in a Setter I created.. but the only problem is that I have almost a hundred MenuItem objects, and I need their display names in the program to be different (not the setter's default). I could just create over 100 different "Setter"'s and change one line in them.. but that is very time consuming. Is there a simpler approach? I want to be able to do this in the XAML where I am declaring them. Is there a way to do this? I've been searching and trying different attempts, but nothing so far.. perhaps someone knows? Thanks

    Read the article

  • Python Tkinter comparing PhotoImage objects

    - by Kyle Schmidt
    In a simple LightsOut game, when I click on a light I need to toggle the image on a button. I'm doing this with Tkinter, so I thought I'd just check and see what image is currently on the button (either 'on.gif' or 'off.gif') and set it to the other one, like this: def click(self,x,y): if self.buttons[x][y].image == self.on: self.buttons[x][y].config(image=self.off) self.buttons[x][y].image == self.off else: self.buttons[x][y].config(image=self.on) self.buttons[x][y].image == self.on This ends up always being True - I can turn a lgiht off, but never turn it back on. Did some research, realized that I should probably be using cmp: def click(self,x,y): if cmp(self.buttons[x][y].image,self.on) == 0: self.buttons[x][y].config(image=self.off) self.buttons[x][y].image == self.off else: self.buttons[x][y].config(image=self.on) self.buttons[x][y].image == self.on But that gave me the exact same result. Both self.on and self.off are PhotoImage objects. Aside from keeping a separate set of lists which tracks what type of light is in each position and redrawing them every click, is there a way to directly compare two PhotoImage objects like this?

    Read the article

  • This PHP/Smarty doesn't work in IE

    - by Kyle Sevenoaks
    I'm starting to get sick of IE's random problems. Page link. (Add things to the cart with the kjøp button and handlevogn) I have this little tiny code here, {foreach $cart.taxes.$currency as $tax} <div id="subTotalCaption2"><p style="width:100px;">{$tax.name_lang}:</p></div> <div id="taxAmount2"><p>{$tax.formattedAmount}</p></div> {/foreach} That's meant to display the amount of total tax for each of the items in the basket. (MVA 25%) This works in every other browser but not IE. Why? Why not? Just why? Any help at all would be very much appreciated.

    Read the article

  • Two part question about submitting bluetooth-enabled apps for the iPhone

    - by Kyle
    I have a couple questions about submitting blue-tooth enabled apps on the iPhone. I want to first say that bluetooth is merely an option in the application. The application does not completely rely on bluetooth as there are many modes the user can go in. First, do they require you to have the "peer-peer" key set in UIRequiredDeviceCapabilities even if bluetooth interface options can be disabled or hidden for non-bluetooth enabled devices? Basically, it's just an OPTION in the game and there are many other modes the player can play.. Does Apple not allow you to do that? I'm just curious, because it seems like something they would do. Adding to that, how do you check for it's functionality at runtime? In essence, how do you check UIRequiredDeviceCapabilities at runtime. I'm aware of checking iPhone device types, so would that be a proper way of going about it? I'm also sort of unaware which devices can run bluetooth gamekit, there doesn't seem to be a proper reference at the SDK site, or I'm unable to find it. Thanks for reading! [edit] I can confirm the existance of somebody rejected for submitting a bluetooth enabled app which didn't work on a iPhone 2G.. Of course, they didn't say if that was the MAIN function of the app, though.

    Read the article

  • Trying to convert a 2D image into 3D objects in Java

    - by Kyle
    Hey, I'm trying to take a simple image, something like a black background with colored blocks representing walls. I'm trying to figure out how to go about starting on something like this. Do I need to parse the image and look at each pixel or is there an easier way to do it? I'm using Java3D but it doesn't seem to have any sort of built in support for that...

    Read the article

  • jquery hide all open divs and toggle

    - by Kyle
    I have 2 links and depending on which one they click on want to close all others and show only the information for that link. Example: <div class="shipping-container"> <a href="#" class="ups">Show UPS info</a> <a href="#" class="fedex">Show Fedex info</a> <div class="ups info" style="display:none">the info for ups</div> <div class="fedex info" style="display:none">the info for fedex</div> </div> Any ideas how I can do this with Jquery toggle for clicking one of the links and hide all others if there open. I only want to show info for one shipping method at a time. Also I would like an option for the user to click showall and all of them are displayed, if possible. Thanks in advance....

    Read the article

  • How to accomplish covariant return types when returning a shared_ptr?

    - by Kyle
    using namespace boost; class A {}; class B : public A {}; class X { virtual shared_ptr<A> foo(); }; class Y : public X { virtual shared_ptr<B> foo(); }; The return types aren't covariant (nor are they, therefore, legal), but they would be if I was using raw pointers instead. What's the commonly accepted idiom to work around this, if there is one?

    Read the article

  • WCF Web/ServiceHost - Singletons and initialisation

    - by Kyle
    I have some Service class which is defined as InstanceContextMode.Single, and is well known in the hosting application. (The host creates an instance, and passes that to the WebServiceHost) Hosting app:WebServiceHost host = null; SomeService serviceInstance = new SomeService("text", "more text"); host = new WebServiceHost(serviceInstance, baseUri); Problem: When I go to use the variables initialised when the service is created (ie, when a call is made to the service), they are either null or empty... Am I wrong in assuming that as the instance being initialised in the hosting application is used for each request to the WebServiceHost? Any pointers here would be great.

    Read the article

  • jQuery noobie can't make a checked checkbox show an alert.

    - by Kyle Sevenoaks
    I found this answer before, to fire an alert if the button is pressed but the checkbox isn't checked. Why won't this work? <input value="1" type="checkbox" name="salgsvilkar" ID="checkbox2" style="float:left;" onclick="document.getElementById('scrollwrap').style.cssText='border-color:#85c222; background-color:#E5F7C7;';" /><label for="checkbox2" class="akslabel">Salgs og leveringsvilkår er lest og akseptert</label> </span> {literal} <script type="text/javascript"> $(function() { //checkbox $("#checkbox2").click(function(){ //if this... //alert("this")... if($("#checkbox2").is(':checked')) { alert("im checked"); } }); //button $("#fullfor_btn").click(function(e){ if(!$("#checkbox2").is(':checked')) { alert("you did not check the agree to terms..."); e.preventDefault(); } }); } </script> {/literal} This on another .tpl: <label></label> <button type="submit" class="submit" name="{$method}" id="fullfor_btn" title="Fullfør bestillingen nå" value="">&nbsp;</button> What could be going wrong? The jQuery doesn't fire anything at all.

    Read the article

  • awk/sed/bash to merge/concatenate data

    - by Kyle
    Trying to merge some data that I have. The input would look like so: foo bar foo baz boo abc def abc ghi And I would like the output to look like: foo bar baz boo abc def ghi I have some ideas using some arrays in a shell script, but I was looking for a more elegant or quicker solution.

    Read the article

  • Tooltips problem, making this javascript work with my smarty foreach loop, help pelase!

    - by Kyle Sevenoaks
    I am using an example of tooltips from http://www.dynamicdrive.com/dynamicindex5/stickytooltip.htm on www.euroworker.no/order I have this code here to work with, but it just doesn't seem to work correctly, I've tried everything I can think of (not a lot of things) Here's the code. {foreach from=$cart.cartItems item="item" name="cart"} <div class="{zebra loop="cart"}"> <div id="sgproductview"> <div id="cart2Varekode"> <p> {if $product.sku} <span class="param">{$item.product.sku}</span> {else} <span>{img src=$item.Product.DefaultImage.paths.1 alt=$item.Product.name_lang|escape}</span> {/if} </p> </div> <div id="cart2Produkt"> <p>{if $item.Product.ID} <a href="{productUrl product=$item.Product}" data-tooltip="sticky{$smarty.foreach.cart.iteration}" target="_blank">{$item.Product.name_lang|truncate:20}</a> {else} <span>{$item.Product.name_lang|truncate:20}</span> </a> {/if} </p> <p> {include file="order/itemVariations.tpl"} {include file="order/block/itemOptions.tpl"} {if $multi} {include file="order/selectItemAddress.tpl" item=$item} {/if} </p> </div> {if $item.Product.DefaultImage.paths.3} <div id="mystickytooltip" class="stickytooltip"> <div style="padding:5px;"> <div id="sticky1" class="atip" style="width:200px;"> <img src="{$item.Product.DefaultImage.paths.3}" alt="{$item.Product.name_lang|escape}"><br> {$item.Product.name_lang} </div> <div id="sticky2" class="atip" style="width:200px;"> <img src={$item.Product.DefaultImage.paths.3} alt="{$item.Product.name_lang|escape}"><br> {$item.formattedPrice} </div> <div id="sticky3" class="atip" style="width:200px;"> <img src="{$item.Product.DefaultImage.paths.3}" alt="{$item.Product.name_lang|escape}"><br> {$item.Product.name_lang}PRODUCT 3 </div> <div id="sticky4" class="atip" style="width:200px;"> <img src="{$item.Product.DefaultImage.paths.3}" alt="{$item.Product.name_lang|escape}"><br> {$item.Product.name_lang} </div> </div> </div> {/if} <div id="cart2Price"> <p class="actualPrice"> {$item.formattedPrice} </p> </div> <div id="salg"></div> <div id="cart2Salg"> <p></p> </div> <div id="antallbox"> <p class="cartQuant"> {textfield name="item_`$item.ID`" class="text"} </p> </div> <div id="cart2Total"> <p> {if $item.count == 1} <span class="basePrice">{$item.formattedBasePrice}</span><span class="actualPrice">{$item.formattedPrice}</span> {else} {$item.formattedDisplaySubTotal} <div class="subTotalCalc"> {$item.count} x <span class="basePrice">{$item.formattedBasePrice}</span><span class="actualPrice">{$item.formattedPrice}</span> </div> {/if} </p> </div> <div id="delete"> {if 'ENABLE_WISHLISTS'|config} <a href="{link controller=order action=moveToWishList id=$item.ID query="return=`$return`"}">{t _move_to_wishlist}</a> {/if} <a id="slett" href="{link controller=order action=delete id=$item.ID query="return=`$return`"}" title="Slett"><!--{t _remove}--></a> </div> </div> </div> {/foreach} Anyone can help? {html_image} doesn't work, by the way and all the extensions are present and correct.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >