Search Results

Search found 3484 results on 140 pages for 'chris dubois'.

Page 113/140 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • Ajax page.replace_html problems with partials in Rails

    - by Chris Power
    Hello, I am having a problem with a pretty simple AJAX call in rails. I have a blog-style application and each post has a "like" feature. I want to be able to increment the "like" on each post in the index using AJAX onclick. I got it to work; however, the DOM is a bit tricky here, because no matter what partial its looking at, it will only update the TOP partial. so if I click "like" on post #2, it will update and replace the "likes" on post #1 instead. Code for _post partial: <some code here...> <div id="postcontent"> Posted <%= post.created_at.strftime("%A, %b %d")%> <br /> </div> <div id="postlikes"> <%= link_to_remote 'Like', :url => {:controller => 'posts', :action => 'like_post', :id => post.id}%> <%= post.like %> </div> code for _postlikes partial: <div id="postlikes"> <%= link_to_remote 'Like', :url => {:controller => 'posts', :action => 'like_post', :id => @post.id}%> <%= @post.like %> </div> </div> like_post.rjs code: page.replace_html "postlikes", :partial => "postlikes", :object => @post page.visual_effect :highlight, "postlikes", :duration => 3 So this all works properly for the first "postcontent" div. But this is an index of posts, so if I wanted to updated the second "postcontent" div on the page, it will still replace the html of the first. I understand the problem, I just don't know how to fix it :) Thanks in advance!

    Read the article

  • Why would I use Scala/Lift over Java/Spring?

    - by Chris J
    Hi, I know this question is a bit open but I have been looking at Scala/Lift as an alternative to Java/Spring and I am wonder what are the real advantages that Scala/Lift has over it. From my perspective and experience, Java Annotations and Spring really minimizes the amount of coding that you have to do for an application. Does Scala/Lift improve upon that?

    Read the article

  • Rails: How to to download a file from a http and save it into database

    - by Chris
    Hi, i would like to create a Rails controller that download a serie of jpg files from the web and directly write them into database as binary (I am not trying to do an upload form) Any clue on the way to do that ? Thank you Edit : Here is some code I already wrote using attachment-fu gem : http = Net::HTTP.new('awebsite', 443) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE http.start() { |http| req = Net::HTTP::Get.new("image.jpg") req.basic_auth login, password response = http.request(req) attachment = Attachment.new(:uploaded_data => response.body) attachement.save } And I get an "undefined method `content_type' for #" error

    Read the article

  • What should I do or learn to better prepare myself for a co-op position?

    - by Chris Vinz
    I'm currently taking computer systems in a technical institute and I will start looking for a coop job by next September. Since summer vacation is only a few weeks away, I was wondering what I should learn or do to help me land a job and do well in it. I'm pretty sure I'm ahead of most of my classmates since I got around 1.5 years "head start." For now, I'm planning to learn how to use source control (git - for no reason really) and was actually thinking of learning Scheme through SICP and maybe build something nice with it at the end. On the other hand, I'm wondering if it's better to expand on what I know right now and I'm thinking of C++ since I enjoy it a lot more than others like Java. Can I get advice on this? thanks!

    Read the article

  • Page Entirely Blank Despite Having Source Code! (TinyMCE, FireFox)

    - by Chris Cooper
    Alright guys, here's a tough one... In reference to this page. The page will seemingly randomly not display the output of server when using Firefox (version 3.5). I have not seen this problem occur in Safari or IE. The best way to have the problem occur is just reload the page about 10 times and it ought to have happened by then, and once it does - it'll continue on subsequent refreshes until you change the page. The problem is literally the browser not displaying the output (code). Viewing the source shows all the appropriate code yet the browser displays a blank white page. The web developer and firebug plugins don't show any errors that would indicate the problem. I have tested this on a separate system and OS and it occurs in Firefox on that system as well. The problem did not occur until after TinyMCE (A Rich Text Editor JavaScript library for textareas) was added to the project. TinyMCE works however, where it should. I know this is a confusing problem, but I am completely lost as to what could be causing this significant issue. Thanks in advance. EDIT: If it's any help... I've noticed that if I cause a css file error by changing a stylesheet source to something non-existant (xxx.css), the page will continuously display without a problem (besides whatever related css not showing due to the src change). I've also noticed that causing any simple javascript error with some bad code will cause the page to load properly continuously (besides of course javascript not running on the page). EDIT#2: Moving all <script> tags down at the tail of the <body> 'fixes' (well, hides) this error and the page shows normally. A band-aid.

    Read the article

  • CodeIgniter - Calling a function from inside a view

    - by Chris
    Hey, Is it possible to call a function which is located in a controller from a view. This is what i have in my controller, as an example function checkKeyExists($userid, $key){ } Then inside my view i have the following if(checkKeyExists($row->id, $role->key)){ } But when i run it, it says that checkKeyExists is not defined. If anyone can let me know how i could do this, that would be great. Cheers

    Read the article

  • Start Windows GUI Application Development With C++

    - by Chris
    I'm looking into creating a GUI program for Windows in C++, I have a good knowledge of C++ in the command line and also in game creation. But I'm not sure where to start with GUI application development. I have Visual Studio 2010 and have created new projects with a GUI but these templates are complex and leaves me not understanding whats happening and how to modify it. So I'm asking where do I start? Preferably good websites that you can recommend or tutorials, rather than books being a poor student :)

    Read the article

  • Functioning of Intent.action_pick_activity??

    - by chris
    Hello everybody!! Here is I would like to set up in my application, the function of sharing (facebook, twitter, e-mail) as that of YouTube for example but I get lost little. By looking I saw that apparently it would be necessary to use Intent.action_pick_activity but I do not manage to see how using it on my case. What is that somebody has already implemented this kind of thing? Either what is what somebody knows where I can find examples?? Thanks to all!

    Read the article

  • VHDL Simulation Timing Behaviour

    - by chris
    I'm trying to write some VHDL code that simply feeds sequential bits from a std_logic_vector into a model of an FSM. However, the bits don't seem to be updating correctly. To try figure out the issue, I have the following code, where instead of getting a bit out of a vector, I'm just toggling the signal x (the same place I'd be getting a bit out). clk <= NOT clk after 10 ns; process(clk) begin if count = 8 then assert false report "Simulation ended" severity failure; elsif (clk = '1') then x <= test1(count); count <= count + 1; end if; end process; EDIT: It appears I was confused.I've put it back to trying to take bit by bit out of the vector. This is the output. I would have thought that on when count is 1, x would take on the value of test1(1) which is a 1.

    Read the article

  • form not showing for empty records

    - by Chris Hodges
    I have a relatively simple PHP page called editcustomers with 3 columns. The problem I'm having is that the form will show when there is a record in the database and the fields will be populated with that info. When no such records exists, the form is not even shown, eliminating the possibility to insert a record. My page layout is as follows: Column 1 shows a form containing customer information, allowing it to be edited. Column 2 allows ordering of products and showing how many products were ordered Column 3 shows the total paid so far, and the total owing. The code for the page I have at present: <html> <?php $id = $_GET['id']; require_once('connect.php'); $sth = $dbh->query("SELECT * FROM users where id = '$id';"); $sth->setFetchMode(PDO::FETCH_ASSOC); $eth = $dbh->query("SELECT * FROM purchases where id = '$id';"); $eth->setFetchMode(PDO::FETCH_ASSOC); ?> <div id="main"> <div id="left"> <form name="custInfo" action ="process.php" method ="post" > <input type = "hidden" name ="formType" value="custInfo"/> <?php while($row = $sth->fetch()){ ?> <p><input type = "hidden" name ="id" value="<?php echo $row["id"] ?>"/> <p><input type = "text" name ="firstName" size ="30" value=" <?php echo $row["firstName"]?>"/> <p><input type = "text" name ="lastName" size ="30" value="<?php echo $row["lastName"]?>"/> <p><input type = "text" name ="country" size ="30" value="<?php echo $row["country"]?>"/> <p></p> <input type="submit" value="Update" /> <?php }?> </div> <div id="mid"> <form name="custCosts" action ="process.php" method ="post" > <input type = "hidden" name ="formType" value="custCosts"/> <?php while($row = $eth->fetch()){ ?> <p><input type = "hidden" name ="id" value="<?php echo $row["id"] ?>"/> <p><input type = "text" name ="amountOwed" size ="30" value=" <?php echo $row["amountOwed"]?>"/> <p><input type = "text" name ="numAaa" size ="30" value="<?php echo $row["numAaa"]?>"/> <p><input type = "text" name ="numBbb" size ="30" value="<?php echo $row["numBbb"]?>"/> <p></p> <input type="submit" value="Update" /> <?php }?> </div> <div id="right"> <b>Total Balance</b> <p> Money owed: </p> <p> aaa total: </p> <p> bbb total: </p> <p> Total: </p> <input type = "text" name ="pay" size ="20" /></p> <input type="submit" value="Make Payment" /> </div> <?php $dbh =null; ?> </body> </html> And the code for all the database trickery: <?php require_once 'connect.php'; $formType = $_POST['formType']; $id = $_POST['id']; $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $country = $_POST['country']; $amountOwed = $_POST['amountOwed ']; $numAaa = $_POST['numAaa']; $numBbb = $_POST['numBbb']; if(empty($_POST['id'])) { $sth = $dbh->prepare("INSERT INTO customers (firstName, lastName, country) VALUES ('$firstName', '$lastName', '$country')"); $sth->execute(); } elseif(!empty($_POST['id']) && !isset($_POST['stayCost']) && $_POST['formType'] == 'guestInfo'){ $sth = $dbh->prepare("UPDATE customers SET firstName = '$firstName', lastName = '$lastName', country = '$country' WHERE id = '$id'"); $sth->execute(); }elseif(!empty($_POST['id']) && isset($_POST['stayCost']) && $_POST['formType'] == 'guestInfo'){ $sth = $dbh->prepare("INSERT INTO purchases (id, amountOwed, numAaa, numBbb) VALUES ('$id', '$amountOwed', '$numAaa', '$numBbb'"); $sth->execute(); }elseif(!empty($_POST['id']) && $_POST['formType'] == 'guestCosts'){ $sth = $dbh->prepare("UPDATE purchases SET amountOwed= '$amountOwed', numAaa = '$numAaa', numBbb= '$numBbb' WHERE id = '$id'"); $sth->execute(); } $dbh =null; ?> Why does the form not even display if there is no record? An error or something I might understand....but the form is still in the HTML and should still be being output, from what I can see. Why is this not the case?

    Read the article

  • ASP.Net layered communication

    - by Chris Klepeis
    Hi, We're developing a layered web application. The specs: 3 layers, data layer, business layer, ui layer. Programmed in C# Data Layer uses the entity framework Currently we plan on having the data layer return IEnumerable<T> to the business layer via linq 2 entities, and the business layer will return data to the ui layer. Since the ui layer has no knowledge of the existance of the data layer, how would it handle a result of IEnumerable passed to it from the BLL, where T is defined in the data layer? Are there any GOOD example out there on how to do this. Please note that I'm extremely new to factories / interfaces / abstraction to loosely couple layers. I saw the question here http://stackoverflow.com/questions/917457/passing-data-in-an-ntier-application and it was recommended to have the entity layer shared amongst all layers... however I do not want the other layers to be able to query the database.

    Read the article

  • How do you hide an image tag based on an ajax response?

    - by Chris
    What is the correct jquery statement to replace the "//Needed magic" comments below so that the image tags are hidden or unhidden based on the AJAX responses? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>JQuery</title> <style type="text/css"> .isSolvedImage{ width: 68px; height: 47px; border: 1px solid red; cursor: pointer; } </style> <script src="_js/jquery-1.4.2.min.js" type="text/javascript"> </script> </head> <body> <div id='true1.txt' class='isSolvedImage'> <img src="_images/solved.png"> </div> <div id='false1.txt' class='isSolvedImage'> <img src="_images/solved.png"> </div> <div id='true2.txt' class='isSolvedImage'> <img src="_images/solved.png"> </div> <div id='false2.txt' class='isSolvedImage'> <img src="_images/solved.png"> </div> <script type="text/javascript"> $(function(){ var getDivs = 0; //iterate div with class isSolvedImage $("div.isSolvedImage").each(function() { alert('div id--'+this.id); // send ajax requrest $.get(this.id, function(data) { // check if ajax response is 1 alert('div id--'+this.url+'--ajax response--'+data); if(data == 1){ alert('div id--'+this.url+'--Unhiding image--'); //Needed magic //Show image if data==1 } else{ alert('div id--'+this.url+'--Hiding image--'); //Needed magic //Hide image if data!=1 } }); }); }); </script> </body> </html>

    Read the article

  • SSAS Reporting Services - Set specific language / translation

    - by Chris
    Hi all, in the data warehouse there's a default language for the measures, and I added a translation for German captions. In a Visual Studio Report Server project, when creating a query with my German OS, the cube and its measures are displayed in German language. When dragging measures to the mdx query windows, the default measure name is used. That's what I want and what I expect, since when writing MDX queries I would like to use the default measure names. But when executing the query, the columns created for each measure is translated to German again. This resuls in having German columns names within my dataset, which I dont want. I'd like to have the english column names. I already tried to change the connection string to: Data Source=server;Initial Catalog=DataWarehouse;LocaleIdentifier=1033 But that doesn't help, I still see German translations. Anyone knows how to set a specific translation?

    Read the article

  • Is there a nice way of having static generic parameters is Java?

    - by Chris
    Hello, recently I'm writing some functions that I take from Haskell and translate into Java. One of the main problems I have is I cannot easily create a static property with a generic type. Let me explain by a little example... // An interface to implement functions public interface Func<P, R> { public R apply(P p); } // What I want to do... (incorrect in Java) public class ... { public static <T> Func<T, T> identity = new Func<T, T>() { public T apply(T p) { return p; } } } // What I do right now public class ... { private static Func<Object, Object> identity = new Func<Object, Object>() { public Object apply(Object p) { return p; } } @SuppressWarnings("unchecked") public static <T> Func<T, T> getIdentity() { return (Func<T, T>)identity; } } Are there any easier ways to do something like that? What kind of problems might arise if the syntax I used would be valid?

    Read the article

  • Disable mousewheel scroll on swf files?

    - by Chris
    I am using the scroll in a swf file.. is there anyway to disable the scroll mousewheel on all browsers.. I get it working for IE and FF but Webkit is not working: $(document).ready(function() { $("#ebook").hover( function () { document.onmousewheel = function(){ return false }; console.log('On'); }, function () { console.log('Out'); document.onmousewheel = function() { return true; } } ); });

    Read the article

  • .htaccess file on localhost throwing an error when using a Virtual Host config on my Localhost!!

    - by Chris
    I am trying to set-up my localhost development server. I have everything working but when I try to add an .htaccess it throws this error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. I dont know exactly why this is, this is pretty much the exact same setup as the other developers machine, but when using my .htaccess file I get that error. Here is my .htaccess file (NOTE: They are commented because I left my site with this setup. It only lets me view the index page. Without this .htaccess file, I can navigate.): Options -indexes RewriteEngine On ErrorDocument 404 /404 RewriteRule ^battery/([^/]+)$ /browser/product?sku=BATTERY+$1&type=battery RewriteRule ^vehicles/([^/]+)/([^/]+)/([^/]+)/product([0-9]+)$ /browser/index.php?make=$1&model=$2&id=$3 [L,NC] RewriteRule ^vehicles/([^/]+)/([^/]+)/([^/]+)/([0-9]+)$ /browser/product.php?make=$1&model=$2&year=$3&id=$4 [L,NC] RewriteRule ^vehicles/([^/]+)/([^/]+)/([^/]+)$ /browser/index.php?make=$1&model=$2&year=$3 [L,NC] RewriteRule ^vehicles/([^/]+)/([^/]+)$ /browser/index.php?make=$1&model=$2 [L,NC] RewriteRule ^vehicles/([^/]+)$ /browser/index.php?make=$1 [L,NC] RewriteRule ^vehicles/$ /browser/index.php [L,NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php

    Read the article

  • Including full LaTeX documents within others.

    - by Chris Clarke
    I'm currently finishing off my dissertation, and would like to be able to include some documents within my LaTeX document. The files I'd like to include are weekly reports done in LaTeX to my supervisor. Obviously all documents are page numbered seperately. I would like them to be included in the final document. I could concatenate all the final PDFs using GhostScript or some other tool, but I would like to have consistent numbering throughout the document. I have tried including the LaTeX from each document in the main document, but the preamble etc causes problems and the small title I have in each report takes a whole page... In summary, I'm looking for a way of including a number of 1 or 2 page self-complete LaTeX files in a large report, keeping their original layouts, but changing the page numbering.

    Read the article

  • Kepping object in memory (iPhone SDK)

    - by Chris
    I am trying to create a UIImageView called theImageView in the touchesBegan method that I can then then move to a new location in touchesMoved. Currently I am receiving an "undeclared" error in touchesMoved where I set the new location for theImageView. What can I do to keep theImageView in memory between these two methods? - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { ... UIImageView *theImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]]; theImageView.frame = CGRectMake(263, 228, 193, 300); [theImageView retain]; ... } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { ... theImageView.frame = CGRectMake(300, 300, 193, 300); ... }

    Read the article

  • Array Indexing Properties of A Class

    - by Chris
    I have a class that has several properties: class Person { string Name; int Age; DateTime BirthDate; } Then I have a sort of wrapper class with a List<Person>. Within this wrapper class I want to be able to do something like Wrapper["Name"] that returns a new List<string> using .Select(x=>x.Name). How do I create a wrapper class around an IEnumerable that supports mapping a string to the Property name? Something like the pseudo code below, but obviously it doesn't work. I'm 99.9% sure the solution will have to use Reflection and thats fine. class Wrapper { List<Person> PersonList; List<dynamic> this[string Column] { return PersonList.Select(x => x.[Column]).ToList(); } } This may not seem like a good design, but its a fix to eventually enable the correct design from .NET 2.0 days. As I have it right now, the data is stored in Columns, so there is actually a List of Lists within my class right now. Using the above example there would be three ILists (with a string Title) Name, Age, and Birthdate. Everything is currently predicated on addressing the columns by their "string" name. I'm trying to convert the data structure to row based with an IEnumberable interface to allow Linq eventually while still maintaining the functionality of my current code. Is converting the code to a Row based IEnumberable a good idea?

    Read the article

  • PHPMailer echo's from successful sent email

    - by Chris
    Hello I finally got PHPMailer to work with Google but now I am finding out that I am getting this output to the screen after the message has been sent. SMTP -> FROM SERVER:220 mx.google.com ESMTP f34sm21891943qco.35 SMTP -> FROM SERVER: 250-mx.google.com at your service, [76.28.109.170] 250-SIZE 35651584 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH 250 ENHANCEDSTATUSCODES SMTP -> FROM SERVER:250 2.1.0 OK f34sm21891943qco.35 SMTP -> FROM SERVER:250 2.1.5 OK f34sm21891943qco.35 SMTP -> FROM SERVER:354 Go ahead f34sm21891943qco.35 SMTP -> FROM SERVER:250 2.0.0 OK 1276700936 f34sm21891943qco.35 I was wondering if there was any way to remove this output so the users don't see it?

    Read the article

  • Forcing Reload of View when returning from FlipSideView of Utility Application

    - by Chris McCall
    I've got a Utility Application for iPhone 3.1.3. I have my main view loading fine. I flip over to the flipside view of the utility app and change some settings. How can I call the code I've currently got in viewDidLoad in the main view to refresh it, as settings have changed? Do I create a public method and call it from the viewDidUnload method of the flipside view? Do I call viewDidLoad directly? What's the best way to do this?

    Read the article

  • setter injection guice + wicket

    - by chris-gr
    Hi, I have a Wicket Web Page where I create a new Object of class A: A a = new A(User u); In A I would like to have setter injection, however this is actually not done. I have heard that one must provide an empty constructor but how is it possible to have also a non - empty constructor with setter injection?

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >