Search Results

Search found 662 results on 27 pages for 'kyle peyton'.

Page 25/27 | < Previous Page | 21 22 23 24 25 26 27  | Next Page >

  • Boolean comparison of array of strings in Ruby

    - by Kyle Kaitan
    I've got an array in Ruby that essentially represents a square boolean matrix. Dots represent zeroes, while any other character represents ones. Example: irb(main):044:0> g => [".b", "m."] # This grid has two '1' values and two '0' values. I'd like to perform a specified logical operation (say, OR) on this array with another similar array to get a third result. For example, if h is ["q.", "r."], then something akin to g.perform_or(h) should yield a new array ["qb", "r."]. (The choice of r to represent the result of 'm' || 'r' is arbitrary and not relevant; any other non-'.' character can be there.) How might I do this? Edit: I made an error in my example. Apologies!

    Read the article

  • Drupal Views: Render Null Result for Relationship as 0

    - by Kyle S
    I have a View configured in Drupal to return nodes, sorting them by their average vote in descending order. For the purpose of the View, the value of the average votes is a Relationship. I noticed that nodes with no votes are displayed after nodes with a negative average. Nodes with no votes should have an average of 0, but I believe the MySQL JOIN is causing NULL values to be returned (as there are no matching rows in the joined table, since a row is created after the first vote is cast for that item). I discovered that with MySQL it is possible to output all values that are NULL in a column as another value with IFNULL(column_name,'other value'). I feel like I would need to modify the Views module in order to obtain this functionality, but I'm hoping that there is some sort of option that returns NULL values in a relation (a relation doesn't exist for the item) as 0 instead of NULL, so that I can properly sort the nodes. The modules I am using include Views, Voting API, Vote Up/Down, and CTools. Thanks.

    Read the article

  • Is it possible to do an Ajax request for an ICS file?

    - by Kyle
    I am trying to do an Ajax request for an ICS file. Yeah, I know it sounds crazy, but I found the perfect library to parse the iCal data. Any ideas why the data comes up blank when I do this? $.ajax({ success:function(data){ alert(data); }, url:"http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=15714&cat=98&platform=osx&method=sa/Swiss32Holidays.ics" }); It makes the request fine, but the data still comes up blank.

    Read the article

  • My textarea won't accept any width attributes.

    - by Kyle Sevenoaks
    Hi, for some odd reason the text area I have in my site won't accept the width I tell it to, I've tried to select it three times in the CSS just to make sure! Here is a jsfiddle example that shows what I want, and here is the page where it doesn't want to work. I have searched through the CSS to find any conflicting textarea properties, but there are none. Thanks for the help!

    Read the article

  • Smarty/PHP loop not being passed to IE(Pc) or Chrome/FF(Mac)

    - by Kyle Sevenoaks
    Hi, I've been working on a site that has a lot of PHP/Smarty involved, I've been asked to re-skin a webstore checkout process, but during this we've discovered this issue. This particular quirk is one part of a tax calculation that doesn't get sent to the browser in IE for PC and Chrome/FF for the Mac. It's NOT in the output source in the browsers, but is in FF, Chrome and Opera on the PC. Here is the code that doesn't "work:" {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} It's not a CSS issue as if you go all the way through the checkout process and then back to the order page (Not using the back button, using the on-site links) it works. There is another calculation on the last page of the process that does the same thing: {foreach from=$order.taxes.$currency item="tax"} <tr> <td colspan="{$colspan}" class="tax">{$tax.name_lang}:</td> <td>{$tax.formattedAmount}</td> </tr> {/foreach} I guess my question is what could cause this to not be read (Parsed?) in IE and the mac but other browsers do it fine on the PC. Thanks.

    Read the article

  • Hibernate (JPA) Entity with Static collection as a member

    - by Kyle Partridge
    Is it possible to have a static collection as a member of a hibernate entity? Say I have an object Question: public class Question { private String category; ... } Would it be possible to populate a static Set<String> that is a distinct set of all categories in the Database? I know I could just query this, but I was wondering if there was a more elegant solution, as it seems like something that other people may have come across.

    Read the article

  • PHP variable question

    - by Kyle Parisi
    This works: $customerBox = mysql_query("MY SQL STATEMENT HERE"); $boxRow = mysql_fetch_array($customerBox); $customerBox = mysql_query("MY SQL STATEMENT AGAIN"); while($item = mysql_fetch_assoc($customerBox)) { foreach ($item as $columnName = $value) { if (empty($value)) { print $columnName; } } } This does not: $customerBox = mysql_query("MY SQL STATEMENT HERE"); $boxRow = mysql_fetch_array($customerBox); while($item = mysql_fetch_assoc($customerBox)) { foreach ($item as $columnName = $value) { if (empty($value)) { print $columnName; } } } Why? I guess I don't understand how variables work yet.

    Read the article

  • jQuery noob: $("this").parent().attr("id",newId); troubles.

    - by Kyle Sevenoaks
    Hi, I have this code which I am trying to change the ID of on.hover. <span id="slidingProd"> <a href="{link controller=order action=addToCart id=$product.ID returnPath=true}" rel="nofollow" class="addToCart" title="Bestill" onclick="addToBasket(); return false;" id="fly_to_basket">&nbsp;</a> </span> I tried to use this jQuery, but it doesn't change the ID. $(function() { $("#fly_to_basket").hover(function() { $(this).parent().attr("id",slidingprod(1)); }); $("#fly_to_basket").hover(function() { $(this).attr("onclick",addToBasket(1)); }); What am I doing wrong? Thanks :)

    Read the article

  • How to set css to "label for="email""

    - by Kyle Sevenoaks
    Code: <label for="email">{t _your_email}:</label> CSS: label { display: block; width: 156px; cursor: pointer; padding-right: 6px; padding-bottom: 1px; } I want to make a new CSS for the email label as it's not meant to be that wide.. Just can't think right now :P Thanks.

    Read the article

  • Is Appfogs pricing model sustainable?

    - by Kyle Finley
    I was looking at AppFog's Pricing and they appear to be giving 2GB of ram away for free, to nonpaying customers. This seems unprecedented for PAAS provodes--providers like Heroku and App Engine remove the app from memory if it has been inactive for certain amount of time. Does cloudfoundry work similarly? Am I wrong in assuming that in a few years appfog servers will be filled with inactive non paying applications?

    Read the article

  • Change Default Winform Icon Across Entire App

    - by Kyle Gagnet
    Can I change the default icon used on a Winform? Most of my forms have their icon property set to a custom icon. For the few forms that slip through the cracks, I don't want the generic "hey look, he made this in visual studio" icon. One solution is to tediously check every one of my forms to make sure they either have a custom icon set or have ShowIcon set to False. Another solution is to have every one of my forms inherit from a base class that sets a custom icon in the constructor. Aside from those solutions, what other options do I have? EDIT: I was hoping there would be a way to replace the source of the stock icon with my own. Is it in a resource file somewhere? Or is it embedded in a .NET dll that I can't (or really, really shouldn't) modify? BOUNTY EDIT: Is there a way to accomplish this without editing or writing a single line of code? I don't care how impractical, complicated, waste-of-time the solution is... I just want to know if it's possible. I need to satisfy my curiosity.

    Read the article

  • PHP coding - A class for each view or one class to rule them all?

    - by Kyle
    I am starting my first "programming" project in PHP making some sort of web application that give the linux program, Motion, a decent web interface. Anyways, I was curious as to how when real applications are programmed, do y'all go for a class for each view or one single class for the application altogether? I know this is more of a preference thing, I was just curious as to how it happens in real software.

    Read the article

  • Scholarships for open-source code? [closed]

    - by Kyle
    So I'm attending college in the fall, thus my dad won't be quiet about the scholarship thing. I've wrote two wordpress plugin and a jQuery plugin, so I was wondering if there are any legit scholarships I could enter because of these? Thanks for any advice =D

    Read the article

  • Why doesn't this work?

    - by Kyle W
    take = raw_input('Please enter the string of numbers that compose code\n\n\t') y = str(take) l = [] for i in xrange(0, len(y), 3):         l.append(str(y[i:i+3])) b = len(l) a = 0 while(a!=b):         c = l[a].replace('444', ' ')         c = l[a].replace('111', 'a')         c = l[a].replace('112', 'b')         c = l[a].replace('113', 'c')         c = l[a].replace('114', 'd')         c = l[a].replace('115', 'e')         etc...         a = a + 1 filename = 'decmes.txt' file = open(filename, 'w') file.write(c) file.close() I can enter anything, just 111 for example and it gives me back the same thing I put in. Maybe it's something dumb, but I can't figure it out.

    Read the article

  • absolutely positioned divs that don't move when page is scrolled...

    - by Kyle
    I've done this in the past using a method similar to this: http://javascriptkit.com/javatutors/static3.shtml but I don't like the "flicker" effect as the page is scrolled and the div needs to move with the scrolling. Lately I've seen a lot of site that have an element (a div or the like I presume) that don't move when the page is scrolled but it's seemless...they're just there and it's a beautiful thing. Unfortunately I can't seem to recall where I've seen it lately to view the source and try to figure it out so I figured I'd turn here and see what all of you experts can provide as far as assistance / suggestions. TIA

    Read the article

  • Firefox running infinitely even after condition met in jquery function

    - by Kyle
    The following function is called with setTimeout(function () { get_progress(fileID,fileName)},8000); upon a form submit. The purpose of the function is to get read_file.php to read a txt file that stores the file upload status from a form (in percentage). Upon reaching 80%, my Firefox seems to run infinitely even when HEAD returns an error. Am I have too many recursions or have I used a wrong condition that's causing get_progress to run repeatedly even when filename does not exist in the folder ? function get_progress( fileID, filename) { $.ajax({ url: filename, type: 'HEAD', success: function() { $.ajax({ type: 'POST', url: 'read_file.php', data: 'filename=' +filename, success: function(html) { document.getElementById(fileID).innerHTML = html + ' <img src="images/loading.gif" />' setInterval(function() {get_progress(fileID,filename)},4000); } }); } });}

    Read the article

  • jQuery change id!

    - by Kyle Sevenoaks
    I am a jQuery noobie, and have been trying to add a script to change the id of a div onClick. Here is a jsfiddle example. $(function accept() { $("div:scrollwrap").attr('scrollwrap','highlight'); });? Thanks :)

    Read the article

  • loading data into each textbox line by line

    - by Kyle
    private void sessionText() { try { System.IO.TextReader r = new System.IO.StreamReader("saved.txt"); this.textBox1.Text = r.ReadLine(); r.Close(); } catch (Exception x) { MessageBox.Show("Exception " +x); } } It reads the line into textBox1 but now I'm expanding my application. I added 5 more textBoxes and now I'm trying to load the data in each one saved line by line. How can I load each line into the next textbox? Line 0 -> textBox1 Line 1 -> textBox2 Line 2 -> textBox3

    Read the article

  • Replacing characters in Ruby string according to some rule

    - by Kyle Kaitan
    In Ruby, I have a string of identical characters -- let's say they're all exclamation points, as in !!!!. I would like to replace the characters at certain indices with '*' if the integer corresponding to that index meets some criteria. For example, let's say I want to replace all the characters whose indices are even numbers and are greater than 3. In the string !!!!!!!! (8 characters long), that results in !!!!*!*! (indices 4 and 6 have been replaced). What's the most compact way to do this?

    Read the article

  • how a thread can signal when it's finished?

    - by Kyle
    #include <iostream> #include <boost/thread.hpp> using std::endl; using std::cout; using namespace boost; mutex running_mutex; struct dostuff { volatile bool running; dostuff() : running(true) {} void operator()(int x) { cout << "dostuff beginning " << x << endl; this_thread::sleep(posix_time::seconds(2)); cout << "dostuff is done doing stuff" << endl; mutex::scoped_lock running_lock(running_mutex); running = false; } }; bool is_running(dostuff& doer) { mutex::scoped_lock running_lock(running_mutex); return doer.running; } int main() { cout << "Begin.." << endl; dostuff doer; thread t(doer, 4); if (is_running(doer)) cout << "Cool, it's running.\n"; this_thread::sleep(posix_time::seconds(3)); if (!is_running(doer)) cout << "Cool, it's done now.\n"; else cout << "still running? why\n"; // This happens! :( return 0; } Why is the output of the above program: Begin.. Cool, it's running. dostuff beginning 4 dostuff is done doing stuff still running? why How can dostuff correctly flag when it is done? I do not want to sit around waiting for it, I just want to be notified when it's done.

    Read the article

  • Why don't paid for systems work properly? [closed]

    - by Kyle Sevenoaks
    Why when you buy a online store system that's advertised as Easy for you to manage and allows to change and tweak the look of store pages with unseen ease is it exactly the opposite? When you're offered six months free support do you never get an answer and finally when you make layout changes to one page, does a completely unrelated business logic completely break down? So really two questions: Why do authors of such systems put them up for sale before they're completed? How to exact revenge on said author? Thanks.

    Read the article

  • jQuery .noconflict with prototype not working in (you guessed it) IE.

    - by Kyle Sevenoaks
    On my new customer page, I have successfully implemented a jQuery show/hide toggle alongside a Prototype script using jQuery's .noconflict. (Thanks to all for answers!) But as the world of the net is, IE's not playing ball. {literal} <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"> </script> <script type="text/javascript"> var $j = jQuery.noConflict(); $j(function() { $j("#button1").click(function() { $j("#show-hide").toggle("slow"); }); });? </script> {/literal} As you all must know by now, I'm just newly coming to all this jQuery stuff, so I have no idea what could cause it. Thanks for any help.

    Read the article

< Previous Page | 21 22 23 24 25 26 27  | Next Page >