Search Results

Search found 1440 results on 58 pages for 'josh jay'.

Page 51/58 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • How do I pass a javascript parameter to an asp.net MVCmodel from within a View?

    - by Josh
    Hi everyone! I am having an issue trying to access a list property on a model from within a javascript. My basic situation is this: I have an ArticleController and an ArticleViewModel. An Article has a number of properties, one of which is Text, which is just a string that contains the contents of the article. The ArticleViewModel contains a Pages property, which is just a List of Strings. When the ArticleViewModel constructor is called, I populate the Pages list by dividing up the article text based on some delimeters. I have a View which inherits the ArticleViewModel type. What I want to do is only display one page at a time, and then when the user clicks a page number (from a list at the bottom of the article), I want to use javascript to load that page into the #dynamicContent div. The problem: I can't seem to pass a parameter to the Model.Pages property from within javascript... Is this possible? I get an error stating, "Expression Expected" when I try what I have below. I don't want to have to worry about AJAX calls or anything like that since I already have the entire article... I just need a way to access each individual page from within the javascript function. Alternatively, if there is a better solution for "paginating" an article so that I can load each articlePage without having to refresh the entire html page, I would certainly be open to that as well. Any help would be much appreciated!! Thanks for your time! ArticleView Code: Script at the top of the view: function loadPage(pageNumber) { try { alert(pageNumber); $('#dynamicContent').html('<%=Model.Pages(' + pageNumber + ') %>'); } catch (e) { alert('in here'); alert(e.description); } } HTML for view: [...] <div id="articleBody"> <div id="dynamicContent"> <%=Model.Pages(0)%> </div> </div> [...] Page Links at bottom of page: [...] <div> <ul style="display:block"> <li style="display:inline"> <a href="#articleTitle" onclick="loadPage(0)"> 1 </a> </li> <li style="display:inline"> <a href="#articleTitle" onclick="loadPage(1)"> 2 </a> </li> </ul> </div>

    Read the article

  • heroku - how to see all the logs

    - by josh
    I have a small app on heroku. Whenever I want to see the logs I go to the command line and do heroku logs That only shows me about 100 lines. Is there not a way to see complete logs for our application on heroku?

    Read the article

  • The Cash or Credit problem

    - by Josh K
    If you go to a store and ask "Cash or Credit?" they might simply say "Yes." This doesn't tell you anything as you posed an OR statement. if(cash || credit) With humans it's possible that they might respond "Both" to that question, or "Only {cash | credit}." Is there a way (or operator) to force the a statement to return the TRUE portions of a statement? For example: boolean cash = true; boolean credit = true; boolean cheque = false; if(cash || credit || cheque ) { // In here you would have an array with cash and credit in it because both of those are true }

    Read the article

  • Writing a script with the cmd prompt.

    - by Josh
    I'm trying to make a script that will place a list (in a .csv file) of processes that are running that take up more than 10 mb of RAM and shows the time + date the script was run. My teacher did this during his lecture but I can't remember how he did it. Just trying to figure out how to be better at IT. So my question is, can anyone help me with this? I don't even know where to start.

    Read the article

  • What is the best instance type to use for hosting a website on ec2?

    - by Josh
    Amazon offers two instance types on EC2: 1) On-Demand and 2) Reserved. After reading the docs on these, I don't really understand the difference from an end-user perspective. More specifically, I'd like to know the answer to this question: is one or the other better for web applications? Based on their names and descriptions, it seems as though on-demand instances may get wiped away from the server altogether if they're not in use which means that they need to be restarted when a request finally does come in. That seems like a pretty bad thing for a website. Am I just misinterpreting the docs? Thanks!

    Read the article

  • VB.net Dataset display different column

    - by Josh
    Hello, I am sure this has to a comon thing I just can't find it. I am making a combobox from my data source. Basically, This is a projects form and the user needs to select the the primary contact which is contrained by the customer id (GETbyCustomerID) set in another field. I have it working... mostly except the combobox only displays the contact ID which is completely useless to the user. I need to know how to display the First and Last name (both are seperate columns in the table). Any help? I am just using the designer.

    Read the article

  • What's the quickest way to dump & load a MySQL InnoDB database using mysqldump?

    - by Josh Schwartzman
    I would like to create a copy of a database with approximately 40 InnoDB tables and around 1.5GB of data with mysqldump and MySQL 5.1. What are the best parameters (ie: --single-transaction) that will result in the quickest dump and load of the data? As well, when loading the data into the second DB, is it quicker to: 1) pipe the results directly to the second MySQL server instance and use the --compress option or 2) load it from a text file (ie: mysql < my_sql_dump.sql)

    Read the article

  • Why won't my UITableViewCell deselect and update its text?

    - by Josh
    I have a UITableView with a list of stories and a cell at the bottom that loads more stories. I am trying to make the "More Stories..." cell deselect and change its text to "Loading..." when clicked. I have searched all over the internet and all over stackoverflow and I cant figure out why my code isnt working right. Right now, when the "More Stories..." cell is clicked, it stays selected and doesnt ever change its text. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Navigation logic int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1]; if (storyIndex == [stories count]) { UITableViewCell *moreCell = [tableView dequeueReusableCellWithIdentifier:@"more"]; if (moreCell == nil) { moreCell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"more"] autorelease]; } // Set up the cell moreCell.textLabel.text = @"Loading..."; [tableView deselectRowAtIndexPath:indexPath animated:YES]; [self moreStories]; } else { NSLog(@"%@",[[stories objectAtIndex: storyIndex] objectForKey: @"link"]); webViewController *webController; webController = [[webViewController alloc] initWithURLPassed:[[stories objectAtIndex: storyIndex] objectForKey: @"link"]]; [self.navigationController pushViewController:webController animated:YES]; [webController release]; webController =nil; self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:nil action:nil]; } }

    Read the article

  • Regex for Date DD-MM-YYYY

    - by Josh M
    I have the following expression which will be used as date validation in the HTML5 "pattern" attribute. ?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))-(?:(?:0[1-9]|1[0-2])-(?:19|20)[0-9]{2} I want it to allow only valid dates, using "-" as a separator. This means up to 29th in February if it's a leap year, and 30/31 for other months respectively. Currently, it only allows years starting with 2 (2012) and months up to 12 (December). But it limits the day to 29 regardless of which month. Can anybody help me fix it?

    Read the article

  • How would I add an if statement into MSQLI query?

    - by Josh
    Okay so I'm just learning mysqli and I'm having a little trouble putting this code together. I've posted the mysqli query below and then below that is the code I'm trying to combine with the mysqli query and I can't seem to get it to work. Maybe what I'm doing isn't possible, but the third section below is how I had the query written for mysql and it's working fine. Answers in code are appreciated! Thanks! MYSQLI QUERY: <?php require("../config.php"); if ($stmt = $mysqli->prepare("SELECT firstname,lastname,spousefirst,phonecell,email,date,contacttype,status FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') ORDER BY date DESC")) { $stmt->execute(); $stmt->bind_results($firstname,$lastname,$spousefirst,$phonecell,$email,$date,$contacttype,$status); while ($stmt->fetch()) { echo ''.$firstname.' '." ".' '.$lastname.' '.",".' '.$spousefirst.' '.",".' '.$phonecell.' '.",".' '.$email.' '.",".' '.$date.' '.",".' '.$contacttype.' '.",".' '.$status.'</br>'; } $stmt->close(); } $mysqli->close(); ?> WHAT I'M TRYING TO COMBINE THE ABOVE WITH: if (($_GET['date'] == 'today')) { $sql = "SELECT * FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') AND date = DATE(NOW()) ORDER BY date DESC"; } WHAT I HAD BEFORE WITH MYSQL THAT WORKS: <?php require("../config.php"); $sql = "SELECT * FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') AND status = 'New' ORDER BY date DESC"; if (($_GET['date'] == 'today')) { $sql = "SELECT * FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') AND date = DATE(NOW()) ORDER BY date DESC"; } ?>

    Read the article

  • Javascript auto calculating

    - by Josh
    I have page that automatically calculates a Total by entering digits into the fields or pressing the Plus or Minus buttons. I need to add a second input after the Total that automatically divides the total by 25. Here is the working code with no JavaScript value for the division part of the code: <html> <head> <script language="text/javascript"> function Calc(className){ var elements = document.getElementsByClassName(className); var total = 0; for(var i = 0; i < elements.length; ++i){ total += parseFloat(elements[i].value); } document.form0.total.value = total; } function addone(field) { field.value = Number(field.value) + 1; Calc('add'); } function subtractone(field) { field.value = Number(field.value) - 1; Calc('add'); } </script> </head> <body> <form name="form0" id="form0"> 1: <input type="text" name="box1" id="box1" class="add" value="0" onKeyUp="Calc('add')" onChange="updatesum()" onClick="this.focus();this.select();" /> <input type="button" value=" + " onclick="addone(box1);"> <input type="button" value=" - " onclick="subtractone(box1);"> <br /> 2: <input type="text" name="box2" id="box2" class="add" value="0" onKeyUp="Calc('add')" onClick="this.focus();this.select();" /> <input type="button" value=" + " onclick="addone(box2);"> <input type="button" value=" - " onclick="subtractone(box2);"> <br /> 3: <input type="text" name="box3" id="box3" class="add" value="0" onKeyUp="Calc('add')" onClick="this.focus();this.select();" /> <input type="button" value=" + " onclick="addone(box3);"> <input type="button" value=" - " onclick="subtractone(box3);"> <br /> <br /> Total: <input readonly style="border:0px; font-size:14; color:red;" id="total" name="total"> <br /> Totaly Divided by 25: <input readonly style="border:0px; font-size:14; color:red;" id="divided" name="divided"> </form> </body></html> I have the right details but the formulas I am trying completely break other aspects of the code. I cant figure out how to make the auto adding and auto dividing work at the same time

    Read the article

  • How to get rid of `deprecated conversion from string constant to ‘char*’` warnings in GCC?

    - by Josh Matthews
    So I'm working on an exceedingly large codebase, and recently upgraded to gcc 4.3, which now triggers this warning: warning: deprecated conversion from string constant to ‘char*’ Obviously, the correct way to fix this is to find every declaration like char *s = "constant string"; or function call like void foo(char *s); foo("constant string"); and make them const char pointers. However, that would mean touching 564 files, minimum, which is not a task I wish to perform at this point in time. The problem right now is that I'm running with -werror, so I need some way to stifle these warnings. How can I do that?

    Read the article

  • JQuery - How do I count the number of elements selected by a selector?

    - by Josh
    I am using $().fadeOut() to fade items out in a list ( < li < /li). When the list is empty I wish to hide a parent object. I plan on doing this by checking in my trigger event that fades the list if the count of the objects is 0 then hide the parent element. I can use the fadeOut callback to remove the elements if necessary. The to the point question: How do I select li tags inside a ul and then get the total count of them using jquery?

    Read the article

  • Javascript Function wont submit form..

    - by Josh K
    Here is my function: function processCheck() { var numberClicked = 0; var frm = document.getElementById('form'); for (var i=0; i<form.elements.length; i++) { if (frm.elements[i].checked) numberClicked++; } if(numberClicked != 8) alert('Must choose 8 Teams'); else frm.submit(); } My forms name is 'form', here is my input: echo "<input type='button' name='submit' value='Update' onclick='processCheck()' />"; When i click the button and there is anything but 8 boxes selected it displays the alert, if there is 8 boxes it does nothing (<-- The problem). I have the form action set to another page.

    Read the article

  • Android LVL: Could not bind to service

    - by josh
    Hello, I'm trying to run LVL on my app but I'm getting this error when debugging on my phone: ERROR/LicenseChecker(29924): Could not bind to service. I tried on emulator too and I'm getting the same error, so I decided investigate on LicenseChecker.java and I changed: boolean bindResult = mContext.bindService( new Intent(ILicensingService.class.getName()), this, // ServiceConnection. Context.BIND_AUTO_CREATE); to: boolean bindResult = mContext.bindService( new Intent("com.android.vending.licensing.ILicensingService"), this, // ServiceConnection. Context.BIND_AUTO_CREATE); but same problem occurs. I'm testing with SDK 8, any idea how to solve this problem? Thanks in advance

    Read the article

  • Should Service Depend on Many Repositories, or Break Them Up?

    - by Josh Pollard
    I'm using a repository pattern for my data access. So I basically have a repository per table/class. My UI currently uses service classes to actually get things done, and these service classes wrap, and therefore depend on repositories. In many cases my services are only dependent upon one or two repositories, so things aren't too crazy. Unfortunately, one of my forms in the UI expects the user to enter data that will span five different tables. For this form I made a single service class that depends upon five repositories. Then the methods within the service for saving and loading the data call the appropriate methods on all of the corresponding repositories. As you can imagine, the save and load methods in this service are really big. Also, unit testing this service is getting really difficult because I have to setup so many fake repositories. Would it have been a better choice to break this single service apart into a few smaller services? It would put more code at the UI layer, but would make the services smaller and more testable.

    Read the article

  • What's the difference between starting a process from the dock vs. the command line on OS X

    - by Josh Knauer
    I'm debugging an issue on OS X that only occurs when the application is started from the dock. It does not happen when the app is started from the command line. What is the difference between the two scenarios? The code I'm working with is a c++ based bundled plug-in being loaded in a third party app. I've attached to the process with GDB in both scenarios and the only difference I can see is that a couple of extra dylibs are loaded in the process when running from the command line and that the base address of my library is slightly different in the two scenarios. I've tried changing my linkage to i-prebind and/or -bind_at_load to no avail.

    Read the article

  • jQuery UI Accordion 1.6

    - by Josh
    I'm using the jQuery UI Accordion 1.6 (http://docs.jquery.com/UI/Accordion), I've changed it a bit and made it work as I need and want it to work. There is just a few things off about it, but one of the major ones is something I just simply can't figure out how to make it work. The plugin is working as intended, it actually closes, opens, opens again, closes all together, etc. However, I'm trying to get the "Posted by..." information right underneath the Headline text. Also, I want the AUTHOR and 0 comments part to be a separate link, the problem is that they are inside the A CLASS (which opens the accordion). Maybe this isn't even a issue with the plugin, but I've run up on options. The jQuery is calling "A" here: I've tried switching this A to a div, but it just breaks. I thought, "Oh I have to alter my CSS", but either I'm doing it wrong, or its not even a jQuery issue, but a CSS one...I just can't figure this out rahhh@#$! Any help would be appreciated. Here is the example I'm working with; http://www.notedls.com/demo $.extend($.ui.accordion, { defaults: { selectedClass: "selected", alwaysOpen: true, animated: 'slide', event: "click", header: "a", autoheight: true, running: 0, navigationFilter: function() { return this.href.toLowerCase() == location.href.toLowerCase(); } },

    Read the article

  • slidepanel/hover help

    - by Josh
    I'm trying to create a menu navigation system from the top of the page. I want it so when I hover over the link, it drops down (the link drops down; so it'd be as if there was a whole field being hidden beyond the 0px mark) with the related field. I've gotten it to work, somehow but it still isn't right. A few issues are: when I hover over .drop_slide and then if I choose to close it by hovering back over the .drop_slide it does as it's told, which is "slide, slide". I'm interested in rectifying this issue so it doesn't do that, however I just don't know how. The idea is to have multiple links in the .slide, so I need it to be constantly open while the user mouses over the other links. Should this be created in one field? If so, how would I do that with a drop down in mind? Am I approaching this completely wrong? Lol. Should I be researching into .animate? I've been looking at it actually, but I can't get anything to grow negatively. Say; marginTop: -85px or something. ANY help is appreciated, thanks! $(document).ready(function(){ function slide() { $("#panel").slideToggle("slow"); } $(".drop_slide").hover(slide, stop); $("#panel").hover(stop, slide); });

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >