Search Results

Search found 2579 results on 104 pages for 'mike peshka'.

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

  • Show/hide rows with jquery

    - by Mike
    Hi I am using some modified code from another post. Basically I want to switch between showing 10 rows of a table to showing all rows (50 for example). I have got it to show from 10 rows to all, however what I need to do now is code it so that if I click the div again it toggles or resets back to showing 10 rows. <script type="text/javascript"> var numShown = 10; // Initial rows shown & index var numRows = $('tbody').find('tr').length; var numLeft = numRows - numShown; $(document).ready(function(){ // Hide rows and add clickable div $('tbody') .find('tr:gt(' + (numShown - 1) + ')').hide().end() $('#table_wrapper').after('<div id="more">Show all offers <span>(' + numLeft + ' more)</span></div>'); $('#more').click(function(){ numShown = numShown + numRows; // 7 + 1 = 8 $('tbody').find('tr:lt('+numShown+')').show(); $("#more").html("Show top 10 offers"); }) }) </script>

    Read the article

  • How do I efficiently parse a CSV file in Perl?

    - by Mike
    I'm working on a project that involves parsing a large csv formatted file in Perl and am looking to make things more efficient. My approach has been to split() the file by lines first, and then split() each line again by commas to get the fields. But this suboptimal since at least two passes on the data are required. (once to split by lines, then once again for each line). This is a very large file, so cutting processing in half would be a significant improvement to the entire application. My question is, what is the most time efficient means of parsing a large CSV file using only built in tools? note: Each line has a varying number of tokens, so we can't just ignore lines and split by commas only. Also we can assume fields will contain only alphanumeric ascii data (no special characters or other tricks). Also, i don't want to get into parallel processing, although it might work effectively. edit It can only involve built-in tools that ship with Perl 5.8. For bureaucratic reasons, I cannot use any third party modules (even if hosted on cpan) another edit Let's assume that our solution is only allowed to deal with the file data once it is entirely loaded into memory. yet another edit I just grasped how stupid this question is. Sorry for wasting your time. Voting to close.

    Read the article

  • How can one enforce calling a base class function after derived class constructor?

    - by Mike Elkins
    I'm looking for a clean C++ idiom for the following situation: class SomeLibraryClass { public: SomeLibraryClass() { /* start initialization */ } void addFoo() { /* we are a collection of foos */ } void funcToCallAfterAllAddFoos() { /* Making sure this is called is the issue */ } }; class SomeUserClass : public SomeLibraryClass { public: SomeUserClass() { addFoo(); addFoo(); addFoo(); // SomeUserClass has three foos. } }; class SomeUserDerrivedClass : public SomeUserClass { public: SomeUserDerrivedClass() { addFoo(); // This one has four foos. } }; So, what I really want is for SomeLibraryClass to enforce the calling of funcToCallAfterAllAddFoos at the end of the construction process. The user can't put it at the end of SomeUserClass::SomeUserClass(), that would mess up SomeUserDerrivedClass. If he puts it at the end of SomeUserDerrivedClass, then it never gets called for SomeUserClass. To further clarify what I need, imagine that /* start initialization */ acquires a lock, and funcToCallAfterAllAddFoos() releases a lock. The compiler knows when all the initializations for an object are done, but can I get at that information by some nice trick?

    Read the article

  • how to shift windows forms controls?

    - by Mike
    How can i get same functionality in windows forms as in the next example. When i have two links one beneath, and when i click first link a panel is visibleunder it and next link is shifted. When i click again the panel is invisible and second link shifted back. <script type="text/javascript"> function toggleDivState(divName) { var ctl = window.document.getElementById(divName); if (ctl.style.display == "none") ctl.style.display = ""; else ctl.style.display = "none"; } </script> <a href="javascript:toggleDivState('poll<%# Eval("ID") %>');"> <div style="display: none;" id="poll<%# Eval("ID") %>">

    Read the article

  • Is it possible to merge two MySQL databases into one?

    - by Mike L.
    Lets say I have two MySQL databases with some complex table structures. Neither database has the same table name. Lets say these tables contain no rows (they do but I could truncate the tables, the data is not important right now, just testing stuff). Lets say I need these 2 databases merged into one. For instance: DB1: cities states DB2: index subindex posts I want to end up with a single DB that contains: cities states index subindex posts Is this possible?

    Read the article

  • Convert SQL Server Varbinary field to MYSQL, keeping data intact

    - by Mike Sheridan
    I was given the daunting task of converting a ASP website to PHP and SQL Server to MySQL, and I ran into an issue that hopefully somebody can help I have a user table which has a password field with datatype Varbinary(128), are using pwdencrypt to encrypt the password. Is there a way to transfer that over to MySQL, and somehow i need to be able to keep the password intact... how can i go about that? any pointers would be greatly appreciated!

    Read the article

  • How can I refer to a binding converter in another namespace in Silverlight XAML?

    - by Mike Pateras
    Since you apparently can't create a Silverlight DataTemplate in C#, I'm trying to create one in XAML. I have a converter that I need to refer to, that I have defined in C# in another namespace. I've tried doing this: <UserControl.Resources> <DataTemplate x:Key="PriceTemplate"> <TextBlock Text="{Binding Price, Converter={Converters:PriceConverter}}" /> </DataTemplate> </UserControl.Resources> Where Converters is an xmlns that points to the correct namespace. However, I get a compilation error that says: Type 'Converters:PriceConverter' is used like a markup extension but does not derive from MarkupExtension. I tried adding System.Windows.Markup.MarkupExtension as a parent to my converter, but it apparently doesn't exist in Silverlight. How can I refer to my converter in XAML, without having to rewrite it in XAML?

    Read the article

  • Applescript for a Newbie: Copy file to a new folder.

    - by Mike
    Hi there! I've also posted this on the macnn forums, but thought I may get a better response here. I was hoping to find some help with using applescript (something I have never tried before, though I have a good knowledge of php etc) I need to create an applescript that will copy specified files from one folder to a newly created folder. These files need to be specified in the applescript. so something like: start fileToBeMoved = "Desktop/Test Folder 1/test.doc" newfoldername = "Test Folder 2" make newfolder and name it 'newfoldername' copy 'fileToBeMoved' to 'newfolder' end I'm so sorry for the rubbish description! Hope someone can help! Thanks!

    Read the article

  • Comparison question string vs int

    - by Mike
    Can someone explain to me why these comparisons work they way the do. I had a bug in one of my scripts that took me a little bit to work through. I was using read-host and typing a number. It was storing it as a string. Write-Host "(`'2`' -gt 9 ) = " ('2' -gt 9 ) Write-Host "(2 -gt 9 ) = " (2 -gt 9 ) Write-Host "(`'2`' -gt 10 ) = " ('2' -gt 10 ) If you are comparing a string to an Int does it use the Ascii value? If so why does the first one show $false, it should be $true. Then how is it when you chage it to an int of 10 it because $true.

    Read the article

  • Should constant contructor aguments be passed by reference or value?

    - by Mike
    When const values are passed to an object construct should they be passed by reference or value? If you pass by value and the arguments are immediately fed to initializes are two copies being made? Is this something that the compiler will automatically take care of. I have noticed that all textbook examples of constructors and intitializers pass by value but this seems inefficient to me. class Point { public: int x; int y; Point(const int _x, const int _y) : x(_x), y(_y) {} }; int main() { const int a = 1, b = 2; Point p(a,b); Point q(3,5); cout << p.x << "," << p.y << endl; cout << q.x << "," << q.y << endl; } vs. class Point { public: int x; int y; Point(const int& _x, const int& _y) : x(_x), y(_y) {} }; Both compile and do the same thing but which is correct?

    Read the article

  • How can Perl's print add a newline by default?

    - by Mike
    In Perl most of my print statements take the form print "hello." . "\n"; Is there a nice way to avoid keeping all the pesky "\n"s lying around? I know I could make a new function such as myprint that automatically appends \n, but it would be nice if I could override the existing print.

    Read the article

  • jquery ui autcomplete does not disapper with no result

    - by mike
    Hi, I'm using jquery ui autocomplete with the following code: $('#company').autocomplete({ source: function(request, response) { var company_name = $('#company').val(); $.ajax({ type: 'post', url: 'http://new.admin.localhost/client/helper/lookup_company_name', cache: false, data: { company : company_name }, dataType: 'json', success: function(data) { //alert(data); response($.map(data.companies, function(item) { return { label: item.company, value: item.company } })) } }) }, minLength: 2, }); This works as expected... The problem is, if the first few chars match something and then you enter a char that should "break" any match, it just keeps the drop down in place with the results for the last matched char... make sense? Would this be something I needed to change in the script that returns the data or something in the jquery? thanks!

    Read the article

  • Why this code does not do what I mean?

    - by Mike
    $w = 'self-powering'; %h = (self => 'self', power => 'pau?', ); if ($w =~ /(\w+)-(\w+)ing$/ && $1~~%h && $2~~%h && $h{$2}=~/?$/) { $p = $h{$1}.$h{$2}.'ri?'; print "$w:"," [","$p","] "; } I expect the output to be self-powering: selfpau?ri? But what I get is: self-powering: [ri?] My guess is something's wrong with the code $h{$2}=~/?$/ It seems that when I use $h{$2}!~/?$/ Perl will do what I mean but why I can't get "self-powering: selfpau?ri?"? What am I doing wrong? Any ideas? Thanks as always for any comments/suggestions/pointers :)

    Read the article

  • Batch convert Malformed PDFs to TIF on Linux

    - by Mike Driscoll
    I need to convert a multipage PDF to TIF, but it appears to be a malformed PDF provided by our client. I tried using ImageMagick and GhostScript, but they do not convert the file correctly. The result is only about 85-90% correct. The only thing I've found that appears to do the job is GIMP, but I can't find an example to use it via its Batch Processing methods for PDFs. Here are the warnings I get from ImageMagick and GhostScript: **** Warning: Tf refers to an unknown resource name: FORMS$.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: P06BOB.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN308E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: P06BOB.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN308E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: P06BOB.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN308E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN307A.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN104A.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN308E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN208E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN308E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN208E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: HE14BP.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN208E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN106E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN208E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN106E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN208E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: HE08BP.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: HE11BP.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: AR10NP.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN308E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: JIMP2.l Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: HS11C.l Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: FORMS$.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN104A.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN208E.f Assuming it's a font name. **** Warning: Tf refers to an unknown resource name: UN307E.f Assuming it's a font name. **** This file had errors that were repaired or ignored. **** Please notify the author of the software that produced this **** file that it does not conform to Adobe's published PDF **** specification. I'm open to other suggestions too. Thanks!

    Read the article

  • iPad web app: Prevent input focus AFTER ajax call

    - by Mike Barwick
    So I've read around and can't for the life of me figure out of to solve my issue effectively. In short, I have a web app built for the iPad - which works as it should. However, I have an Ajax form which also submits as it should. But, after the callback and I clear/reset my form, the "iPad" automatically focuses on an input and opens the keyboard again. This is far from ideal. I managed to hack my way around it, but it's still not perfect. The code below is run on my ajax callback, which works - except there's still a flash of the keyboard quickly opening and closing. Note, my code won't work unless I use setTimeout. Also, from my understanding, document.activeElement.blur(); only works when there's a click event, so I triggered one via js. IN OTHER WORDS, HOW DO I PREVENT THE KEYBOARD FROM REOPENING AFTER AJAX CALL ON WEB APP? PS: Ajax call works fine and doesn't open the keyboard in Safari on the iPad, just web app mode. Here's my code: hideKeyboard: function () { // iOS web app only, iPad IS_IPAD = navigator.userAgent.match(/iPad/i) != null; if (IS_IPAD) { $(window).one('click', function () { document.activeElement.blur(); }); setTimeout(function () { $(window).trigger('click'); }, 500); } } Maybe it's related to how I'm clearing my forms, so here's that code. Note, all inputs have tabindex="-1" as well. clearForm: function () { // text, textarea, etc $('#campaign-form-wrap > form')[0].reset(); // checkboxes $('input[type="checkbox"]').removeAttr('checked'); $('#campaign-form-wrap > form span.custom.checkbox').removeClass('checked'); // radio inputs $('input[type="radio"]').removeAttr('checked'); $('#campaign-form-wrap > form span.custom.radio').removeClass('checked'); // selects $('form.custom .user-generated-field select').each(function () { var selection = $(this).find('option:first').text(), labelFor = $(this).attr('name'), label = $('[for="' + labelFor + '"]'); label.find('.selection-choice').html(selection); }); optin.hideKeyboard(); }

    Read the article

  • HTML Language question

    - by Mike
    Note my code below. I am trying to figure out why my data is not changing to Spanish. I understand it to be one line of code and that is all within the HTML attribute lang=”es”. Any help would be greatly appreciated. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xlmns="http://www.w3.org/1999/xhtml" lang=”es” xml:lang="en"> <head> <title>JavaJam Coffee House</title> <link href="javajam.css" rel="stylesheet" type="text/css" /> </head> <body bgcolor="brown"> <h1>JavaJam Coffee House</h1> <ul> <li>Specialty Coffee and Tea</li> <li>Bagels, Muffins, and Organic Snacks</li> <li>Music and Poetry Readings</li> <li>Usability Studies</li> <li>Open Mic Night</li> </ul> <br></br> <p>12312 Main Street<br> Mountain Home, CA 93923<br> 1-888-555-5555</br> </p> <p> <em> <small>Copyright &copy; 2008 JavaJam Coffee House</em></p> E-Mail <a href="mailto;[email protected]"> Michael J. Crawley</a> </body> </html>

    Read the article

  • Which PHP framework is closest to Ruby on Rails? CakePHP? CodeIgniter?

    - by Mike Duncan
    I'm going to be switching back and forth between Ruby on Rails projects and some as-of-yet undecided PHP MVC framework projects. Which of the PHP MVC frameworks out there (CakePHP, CodeIgniter?, others?) is most similar to Ruby on Rails in that the most conventions, locations, workflows, etc are preserved? I'm looking for the similarity in the way things are done such as directory structures, conventions, etc, not a pros vs cons in speed, extra features, etc.

    Read the article

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