Search Results

Search found 358 results on 15 pages for 'jean philippe emond'.

Page 9/15 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Setting encoding in Grails controller's render method

    - by Philippe
    Hello, I'm trying to build an RSS feed using Grails and Rome. In my controller's rss action, my last command is : render(text: getFeed("rss_2.0"), contentType:"application/rss+xml", encoding:"ISO-8859-1 ") However, when I navigate to my feed's URL, the header is : <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> ... Does anyone have a clue about WHY the encoding is UTF-8 when I set it to ISO-8859-1 in the render method ??? Thanks for your help !

    Read the article

  • Java 1.4 singleton containing a mutable field

    - by Philippe
    Hi, I'm working on a legacy Java 1.4 project, and I have a factory that instantiates a csv file parser as a singleton. In my csv file parser, however, I have a HashSet that will store objects created from each line of my CSV file. All that will be used by a web application, and users will be uploading CSV files, possibly concurrently. Now my question is : what is the best way to prevent my list of objects to be modified by 2 users ? So far, I'm doing the following : final class MyParser { private File csvFile = null; private static Set myObjects = Collections.synchronizedSet(new HashSet); public synchronized void setFile(File file) { this.csvFile = file; } public void parse() FileReader fr = null; try { fr = new FileReader(csvFile); synchronized(myObjects) { myObjects.clear(); while(...) { // foreach line of my CSV, create a "MyObject" myObjects.add(new MyObject(...)); } } } catch (Exception e) { //... } } } Should I leave the lock only on the myObjects Set, or should I declare the whole parse() method as synchronized ? Also, how should I synchronize - both - the setting of the csvFile and the parsing ? I feel like my actual design is broken because threads could modify the csv file several times while a possibly long parse process is running. I hope I'm being clear enough, because myself am a bit confused on those multi-synchronization issues. Thanks ;-)

    Read the article

  • Including a pyd directly in a setup.py file

    - by Philippe Beaudoin
    I have a complex build process to generate a couple of python extension modules (.pyd). I want to include these in my setup.py for use with distutils. The distutils page talks in length about how to add extension modules from source, but I'd want to simply package these precompiled .pyd. What is the best practice to do this? Eventually, I'd also like to freeze everything in an executable with py2exe. Will I be able to do this if I directly specify the .pyd?

    Read the article

  • How to create a database and populate it during setup

    - by Philippe
    I would like to find a way to create and populate a database during asp.net setup. So, what I'm willing to do is: Create the database during the setup Populate the database with some initial data (country codes or something like that) Create the appropriate connection string in the configuration file I'm using .NET 3.5 and Visual Studio 2005, and the Database is SQL Server 2005. Thanks in advance.

    Read the article

  • Making GWT application crawlable by a search engine.

    - by Philippe Beaudoin
    I want to use the #! token to make my GWT application crawlable, as described here: http://code.google.com/web/ajaxcrawling/ There is a GWT sample app available online that uses this, for example: http://gwt.google.com/samples/Showcase/Showcase.html#!CwRadioButton Will serve the following static webpage to the googlebot: http://gwt.google.com/samples/Showcase/Showcase.html?_escaped_fragment_=CwRadioButton I want my GWT app to do something similar. In short, I'd like to serve a different flavor of the page whenever the _escaped_fragment_ parameter is found in the URL. What should I modify in order for the server to serve something else (a static page, or a page dynamically generated through a headless browser like HTML Unit)? I'm guessing it could be the web.xml file, but I'm not sure. (Note: I thought of checking the Showcase app provided with the GWT SDK, but unfortunately it doesn't seem to support serving static files on _escaped_fragment_ and it doesn't use the #! token..)

    Read the article

  • How to join a table in symfony (Propel) and retrieve object from both table with one query

    - by Jean-Philippe
    Hi, I'm trying to get an easy way to fetch data from two joined Mysql table using Propel (inside Symfony) but in one query. Let's say I do this simple thing: $comment = CommentPeer::RetrieveByPk(1); print $comment->getArticle()->getTitle(); //Assuming the Article table is joined to the Comment table Symfony will call 2 queries to get that done. The first one to get the Comment row and the next one to get the Article row linked to the comment one. Now, I am trying to find a way to make all that within one query. I've tried to join them using $c = new Criteria(); $c->addJoin(CommentPeer::ARTICLE_ID, ArticlePeer::ID); $c->add(CommentPeer::ID, 1); $comment = CommentPeer::doSelectOne($c); But when I try to get the Article object using $comment->getArticle() It will still issue the query to get the Article row. I could easily clear all the selected columns and select the columns I need but that would not give me the Propel object I'd like, just an array of the query's raw result. So how can I get a populated propel object of two (or more) joined table with only one query? Thanks, JP

    Read the article

  • How to get rid of Internet Explorer 7 reloading on fragment change

    - by Philippe Beaudoin
    I have an anchor <a href="#!admin">General</a> somewhere in my page. Clicking this in any browser but IE7 (haven't tried IE6) causes no page reload, as expected. However, under IE7 it reloads the page as soon as it's clicked. The strangest thing is that I have the exact same anchor elsewhere in the page and it causes no reload. The only difference I can see between these is a slight difference in style, and the fact that the faulty anchor is deeply nested in divs, where the other is closer to the top. My questions: Is this a known bug with IE7? If so, is there any work around? If not, any clue as to what might be going wrong? Edit: If you want to see this yourself, go to http://filouguestbook.appspot.com/#!main sign-in with a google account and click on the Settings link the the top bar. Switch between the General and Accounts pages, the app will reload. From the Accounts page, click on Settings in the top bar, this will switch tab but not reload!

    Read the article

  • How do I apply a servlet filter when serving an HTML page directly?

    - by Philippe Beaudoin
    First off, I'm using Google AppEngine and Guice, but I suspect my problem is not related to these. When the user connect to my (GWT) webapp, the URL is a direct html page. For example, in development mode, it is: http://127.0.0.1:8888/Puzzlebazar.html?gwt.codesvr=127.0.0.1:9997. Now, I setup my web.xml in the following way: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <display-name>PuzzleBazar</display-name> <!-- Default page to serve --> <welcome-file-list> <welcome-file>Puzzlebazar.html</welcome-file> </welcome-file-list> <filter> <filter-name>guiceFilter</filter-name> <filter-class>com.google.inject.servlet.GuiceFilter</filter-class> </filter> <filter-mapping> <filter-name>guiceFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- This Guice listener hijacks all further filters and servlets. Extra filters and servlets have to be configured in your ServletModule#configureServlets() by calling serve(String).with(Class<? extends HttpServlet>) and filter(String).through(Class<? extends Filter) --> <listener> <listener-class>com.puzzlebazar.server.guice.MyGuiceServletContextListener </listener-class> </listener> </web-app> Since I'm using Guice, I have to configure extra filters in my ServletModule, where I do this: filter("*.html").through( SecurityCookieFilter.class ); But my SecurityCookieFilter.doFilter is never called. I tried things like "*.html*" or <url-pattern>*</url-pattern> but to no avail. Any idea how I should do this?

    Read the article

  • Generating PDF files from .NET by using standard .NET GDI printing classes

    - by Philippe Leybaert
    I'm looking for a way to generate PDF files using the standard PrintDocument and Graphics (GDI) classes in .NET. As far as I know, the only way to do that is by printing to a PDF printer. The problem is that a PDF printer driver always asks for a filename, but I need to control the filename from my code. Using a PDF library like PDFSharp or DynamicPDF is not an option, because they all provide their own API for generating PDF files. I need this for an internal application, so dependencies are not a problem. My question is simple: is there a way to control a printer driver (Adobe Acrobat, PDFCreator, ...) in such a way that a filename can be specified and the user is not prompted for anything?

    Read the article

  • MSCT Certification, Exam 70-536, your advices?

    - by Philippe
    At the beginning of the year, I was proposed by my company to take some MS certification exams. Since then, they generously paid for the Self-Paced Training Kit book. I was promised to have some time to study, but the project is running late (a habit around here). Let's face it, I'll have to study on my own time to get this certification. Anyway, my question is simple: what advices do you have in order to study effectively? I'm halfway trough the book, and I feel like I don't remember anything. Especially when the questions are so precise on classes name and parameters...

    Read the article

  • Does cout need to be terminated with a semicolon ?

    - by Philippe Harewood
    I am reading Bjarne Stroustrup's Programming : Principles and Practice Using C++ In the drill section for Chapter 2 it talks about various ways to look at typing errors when compiling the hello_world program #include "std_lib_facilities.h" int main() //C++ programs start by executing the function main { cout << "Hello, World!\n", // output "Hello, World!" keep_window_open(); // wait for a character to be entered return 0; } In particular this section asks: Think of at least five more errors you might have made typing in your program (e.g. forget keep_window_open(), leave the Caps Lock key on while typing a word, or type a comma instead of a semicolon) and try each to see what happens when you try to compile and run those versions. For the cout line, you can see that there is a comma instead of a semicolon. This compiles and runs (for me). Is it making an assumption ( like in the javascript question: Why use semicolon? ) that the statement has been terminated ? Because when I try for keep_terminal_open(); the compiler informs me of the semicolon exclusion.

    Read the article

  • WPF Binding : Object in a object

    - by Philippe
    I have a form in WPF with 2 textbox : <TextBox Name="txtName" Text="{Binding Contact.Name}"/> <TextBox Name="txtAddressNumber" Text="{Binding Contact.Address.Number}"/> and I have 2 class : public class ContactEntity { public string Name {get;set;} public AddressEntity Address {get;set;} } public class AddressEntity { public int Number {get;set} } The Name property binds fine. But the Number property of the Address object inside the Contact object does not binds. What I'm doing wrong ?

    Read the article

  • How to add condition on multiple-join table

    - by Jean-Philippe
    Hi, I have those two tables: client: id (int) #PK name (varchar) client_category: id (int) #PK client_id (int) category (int) Let's say I have those datas: client: {(1, "JP"), (2, "Simon")} client_category: {(1, 1, 1), (2, 1, 2), (3, 1, 3), (4,2,2)} tl;dr client #1 has category 1, 2, 3 and client #2 has only category 2 I am trying to build a query that would allow me to search multiple categories. For example, I would like to search every clients that has at least category 1 and 2 (would return client #1). How can I achieve that? Thanks!

    Read the article

  • SQL Server many-to-many design recommendation

    - by Jean-Philippe Brabant
    I have a SQL Server database with two table : Users and Achievements. My users can have multiple achievements so it a many-to-many relation. At school we learned to create an associative table for that sort of relation. That mean creating a table with a UserID and an AchivementID. But if I have 500 users and 50 achievements that could lead to 25 000 row. As an alternative, I could add a binary field to my Users table. For example, if that field contained 10010 that would mean that this user unlocked the first and the fourth achievements. Is their other way ? And which one should I use.

    Read the article

  • ADO.NET connection string and password with "=" in it

    - by Philippe Leybaert
    How do I build a connection string which includes a passsword having a "=" in it? (I'm connecting to MySql 5.1) For example, let's say the password is "Ge5f8z=6", what would the connection string look like? I tried: Server=DBSERV;Database=mydb;UID=myuser;PWD="Ge5f8z=6"; and Server=DBSERV;Database=mydb;UID=myuser;PWD=Ge5f8z=6;" Both don't work.

    Read the article

  • Xcode Code Sense horribly broken?

    - by Philippe Leybaert
    Ever since I started using Xcode, I've experienced extremely annoying problems using Xcode and Code Sense. The problem is that when Code Sense kicks in for code completion, sometimes the source code text below the line I'm working on goes "crazy". If I continue typing, the problem gets worse, and after a while the source code is completely screwed up (funny colors, missing lines and characters, ...). Strange enough, the source code itself is unaffected, because when I select another source file and then go back to the one I was working on, everything looks fine again. The problem can be seen in this screencast: http://www.screencast.com/t/OGY3NWE5 Interesting facts: This problem has occurred on 3 different machines, so it's not related to a corrupt installation. Sometimes it's fine for a while (up to one hour) after launching Xcode, but once it starts happening, it's getting worse and worse, until Xcode is restarted. Then it's fine again (for a while) I've searched the web for similar experiences, and I can't find anything. I would think that it is a known problem, since it occurs on 3 different Macs here (both running 10.5 and 10.6). Anyone having the same problems? Or a suggestion for fixing this?

    Read the article

  • Why junit ComparisonFailure is not used by assertEquals(Object, Object) ?

    - by Philippe Blayo
    In Junit 4, do you see any drawback to throw a ComparisonFailure instead of an AssertionError when assertEquals(Object, Object) fails ? assertEquals(Object, Object) throws a ComparisonFailure if both expected and actual are String an AssertionError if either is not a String @Test(expected=ComparisonFailure.class ) public void twoString() { assertEquals("a String", "another String"); } @Test(expected=AssertionError.class ) public void oneString() { assertEquals("a String", new Object()); } The two reasons why I ask the question: ComparisonFailure provide far more readable way to spot the differences in dialog box of eclipse or Intellij IDEA (FEST-Assert throws this exception) Junit 4 already use String.valueOf(Object) to build message "expected ... but was ..." (format method invoqued by Assert.assertEquals(message, Object, Object) in junit-4.8.2): static String format(String message, Object expected, Object actual) { ... String expectedString= String.valueOf(expected); String actualString= String.valueOf(actual); if (expectedString.equals(actualString)) return formatted + "expected: " + formatClassAndValue(expected, expectedString) +" but was: " + formatClassAndValue(actual, actualString); else return formatted +"expected:<"+ expectedString +"> but was:<"+ actualString +">"; Isn't it possible in assertEquals(message, Object, Object) to replace fail(format(message, expected, actual)); by throw new ComparisonFailure(message, formatClassAndValue(expectedObject, expectedString), formatClassAndValue(actualObject, actualString)); Do you see any compatibility issue with other tool, any algorithmic problem with that... ?

    Read the article

  • video player for HTML 5 page not loading

    - by philippe
    I'm using VideoJS to as my video player for a project I've been working on. Basically I have a div, and I wanted to have the video player within that div, however when I load the page nothing happens, and the video is never played. In fact, the video is never loaded nor shown in the page. I basically copied the example from VideoJS' page. Any thoughts? <div class="video-js-box"> <!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody --> <div style="position: absolute; top: 50px; left: 600px; display:none"> <video id="example_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264" poster="http://video-js.zencoder.com/oceans-clip.png" data-setup='{"example_option":true}'> <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'></source> <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm'>></source> <source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg'></source> </video> <!-- Download links provided for devices that can't play video in the browser. --> <p class="vjs-no-video"><strong>Download Video:</strong> <a href="http://video-js.zencoder.com/oceans-clip.mp4">MP4</a>, <a href="http://video-js.zencoder.com/oceans-clip.webm">WebM</a>, <a href="http://video-js.zencoder.com/oceans-clip.ogv">Ogg</a><br> <!-- Support VideoJS by keeping this link. --> <a href="http://videojs.com">HTML5 Video Player</a> by VideoJS </p> </div> <div style="clear:both;"></div> </div><!--main-->

    Read the article

  • regular expression not behaving as expected - Python

    - by philippe
    I have the following function which is supposed to read a .html file and search for <input> tags, and inject a <input type='hidden' > tag into the string to be shown into the page. However, that condition is never met:( e.g the if statement is never executed. ) What's wrong with my regex? def print_choose( params, name ): filename = path + name f = open( filename, 'r' ) records = f.readlines() print "Content-Type: text/html" print page = "" flag = True for record in records: if re.match( '<input*', str(record) ) != None: print record page += record page += "<input type='hidden' name='pagename' value='psychology' />" else: page += record print page Thank you

    Read the article

  • Cannot make sense out a Delphi windows file name

    - by Philippe Watel
    I am trying to copy from a file X to this name C:\RIP2\France Clidat\Les Plus Belles Oeuvres - France Clidat\(01)3_ Un Sospiro.flac I have checked that there is no bad characters, If I force directorires it creates C:\RIP2\France Clidat\Les Plus Belles Oeuvres - France Clidat but it refuses to write the file and I do not understand why a simple test procedure foo(str: string); var f:File; begin Assign(f,str); Rewrite(f); CloseFile(f); end; will crash saying it is not a valid file name but it is! If I remove ALL blank spaces it works I am lost please Help

    Read the article

  • How to add an object to a html string?

    - by Philippe Maes
    I'm trying to load several images by a drop action and than resizing them and adding them as a thumbnail. The resize part is very important because the images can be very large and I want to make the thumbnails small of size. Here is my code: loadingGif(drop); for (var i=0;i<files.length;i++) { var file = files[i]; var reader = new FileReader(); reader.onload = function(e) { var src = e.target.result; var img = document.createElement('img'); img.src = src; var scale = 100/img.height; img.height = 100; img.width = scale*img.width; output.push('<div id="imagecontainer"><div id="image">'+img+'</div><div id="delimage"><img src="img/del.jpg"" /></div></div>'); if(output.length == files.length) { drop.removeChild(drop.lastChild); drop.innerHTML += output.join(''); output.length = 0; } } reader.readAsDataURL(file); } As you can probably tell I insert a loading gif image in my dropzone until all files are loaded (output.length == files.length). When a file is loaded I add html to an array which I will print if the load is complete. The problem is I can't seem to add the img object (I need this object to resize the image) to the html string, which seems obvious as the img is an object... So my question to you guys is: how do I do this? :)

    Read the article

  • nginx reload failing: `object version does not match bootstrap parameter`

    - by Jean Jordaan
    I added a server stanza to my virtual.conf, and now nginx seems to have a problem reloading the config. At this point I don't know what exactly is going wrong or how to debug better. Any help would be most appreciated. The config test succeeds: root@server:~# service nginx configtest nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful I'm tailing the logfile. Upon reload, the following error is logged. As far as I can see, the new config is not used. root@server:~# service nginx reload Reloading nginx: [ OK ] root@server:~# ==> /var/log/nginx/error.log <== nginx object version 0.8.54 does not match bootstrap parameter 1.0.15 at /usr/lib64/perl5/XSLoader.pm line 94. Compilation failed in require. BEGIN failed--compilation aborted. 2012/10/18 12:31:07 [alert] 9620#0: perl_parse() failed: 2 This is the version of nginx I'm running: root@server:~# yum info nginx Loaded plugins: fastestmirror, presto Loading mirror speeds from cached hostfile * base: ftp.udc.es * epel: mirror.nl.leaseweb.net * extras: ftp.udc.es * updates: ftp.cica.es Installed Packages Name : nginx Arch : x86_64 Version : 1.0.15 Release : 2.el6 [...] Server OS: CentOS release 6.3 (Final)

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15  | Next Page >