Search Results

Search found 2399 results on 96 pages for 'alex gosselin'.

Page 71/96 | < Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >

  • Advanced XPath query

    - by alex
    Hello, I have an XML file that looks like this: <?xml version="1.0" encoding="utf-8" ?> <PrivateSchool> <Teacher id="teacher1"> <Name> teacher1Name </Name> </Teacher> <Teacher id="teacher2"> <Name> teacher2Name </Name> </Teacher> <Student id="student1"> <Name> student1Name </Name> </Student> <Student id="student2"> <Name> student2Name </Name> </Student> <Lesson student="student1" teacher="teacher1" /> <Lesson student="student2" teacher="teacher2" /> <Lesson student="student3" teacher="teacher3" /> <Lesson student="student1" teacher="teacher2" /> <Lesson student="student3" teacher="teacher3" /> <Lesson student="student1" teacher="teacher1" /> <Lesson student="student2" teacher="teacher4" /> <Lesson student="student1" teacher="teacher1" /> </PrivateSchool> There's also a DTD associated with this XML, but I assume it's not much relevant to my question. Let's assume all needed teachers and students are well defined. What is the XPath query that returns the teachers' NAMES, that have at least one student that took more than 10 lessons with them? I was looking at many XPath sites/examples. Nothing seemed advanced enough for this kind of question... Thank you

    Read the article

  • Jquery Resizable Image size issue

    - by alex
    Image size is not automatically detected when using jquery resizable. Both Firefox and IE displays the image much smaller, and chrome show nothing at all. I can't seem to find a direct answer to this issue. How can this be fixed. <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/base/jquery-ui.css" type="text/css" media="all"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"> </script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js" type="text/javascript"> </script> <img src="http://www.carsyouwilldrive.com/wp-content/uploads/2009/06/futurecar1.jpg"> <script type="text/javascript"> $("img").resizable(); </script>

    Read the article

  • How do travel search engines & aggregators get their source data?

    - by Alex
    I'm tossing around a few ideas for travel search engines and I'm wondering how these sites get their source data. Do they scrape all the content from airline homepages? This seems like an enormous job given the number of airlines etc out there. Is there some API or web service standard that every airline conforms too? Am I going to have to negotiate access to the data APIs for every airline I wish to index?

    Read the article

  • What's quicker and better to determine if an array key exists in PHP?

    - by alex
    Consider these 2 examples $key = 'jim'; // example 1 if (isset($array[$key])) { doWhatIWant(); } // example 2 if (array_key_exists($key, $array)) { doWhatIWant(); } I'm interested in knowing if either of these are better. I've always used the first, but have seen a lot of people use the second example on this site. So, which is better? Faster? Clearer intent? Update Thanks for the quality answers. I now understand the difference between the 2. A benchmark states that isset() alone is quicker than array_key_exists(). However, if you want the isset() to behave like array_key_exists() it is slower.

    Read the article

  • Javascript document.open asynchronous?

    - by Alex Schneider
    So on my site there is a Javascript function that will load a new site from the server via XMLHttpRequest. After that it replaces the current page with the new one: var post = new XMLHttpRequest(); post.open('POST', data); post.onload = function() { var do = document.open("text/html", "replace"); do.write(post.responseText); do.close(); goOn(); } function goOn() { console.log($('img:visible')); } Some could assume that after do.close() the document has changed and is ready. But it is not, e.g. if i load very much/big data/responseText the function goOn() only logs an empty result. Obviously goOn() gets in that case called before the DOM is ready to be read! Unfortunately the is no "ready" event fired after write() finished.... How can i be sure it is finished? /EDIT: goOn() logs this to Chrome Console: [prevObject: p.fn.p.init[1], context: #document, selector: "img:visible"] context: #document length: 0 prevObject: p.fn.p.init[1] selector: "img:visible" __proto__: Object[0] But if i right after that type $('img:visible') into console manually it shows me all images....

    Read the article

  • [C#] Running elevated applications on user login with UAC?

    - by Alex
    I need to start a program every time the user logs in, but I cannot do this without being met by a UAC dialog asking for permissions for that application. Is there any way to have an application start up on user login without the user having to answer the UAC prompt? I was thinking about running a service, but this would be a last resort. I saw something about an Application Compatibility Toolkit to disable UAC for certain applications, but I feel this is too big of a hassle - even services would be easier to program. I was just wondering if there is an even easier solution I am missing. Thanks in advance.

    Read the article

  • Is there a true all-in-one solution for PHP Development?

    - by Alex R
    I'm looking for a "SINGLE INSTALLER" solution for PHP Development. Is there anything out there which will give me a nice IDE, Web Server, Debugger, Database, etc, on a single install image (*.msi or *.exe)? This of course would be completely opposite of Eclipse PDT, which requires you to search and locate a bunch of additional components which never quite work together.

    Read the article

  • Condor job using DAG with some jobs needing to run the same host

    - by gurney alex
    I have a computation task which is split in several individual program executions, with dependencies. I'm using Condor 7 as task scheduler (with the Vanilla Universe, due do constraints on the programs beyond my reach, so no checkpointing is involved), so DAG looks like a natural solution. However some of the programs need to run on the same host. I could not find a reference on how to do this in the Condor manuals. Example DAG file: JOB A A.condor JOB B B.condor JOB C C.condor JOB D D.condor PARENT A CHILD B C PARENT B C CHILD D I need to express that B and D need to be run on the same computer node, without breaking the parallel execution of B and C. Thanks for your help.

    Read the article

  • NHibernate does not update entity when repository is passed by constructor

    - by Alex
    Hi everybody, I am developing with NHibernate for the first time in conjunction with ASP.NET MVC and StructureMap. The CodeCampServer serves as a great example for me. I really like the different concepts which were implemented there and I can learn a lot from it. In my controllers I use Constructur Dependency Injection to get an instance of the specific repository needed. My problem is: If I change an attribute of the customer the customer's data is not updated in the database, although Commit() is called on the transaction object (by a HttpModule). public class AccountsController : Controller { private readonly ICustomerRepository repository; public AccountsController(ICustomerRepository repository) { this.repository = repository; } public ActionResult Save(Customer customer) { Customer customerToUpdate = repository .GetById(customer.Id); customerToUpdate.GivenName = "test"; //<-- customer does not get updated in database return View(); } } On the other hand this is working: public class AccountsController : Controller { [LoadCurrentCustomer] public ActionResult Save(Customer customer) { customer.GivenName = "test"; //<-- Customer gets updated return View(); } } public class LoadCurrentCustomer : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { const string parameterName = "Customer"; if (filterContext.ActionParameters.ContainsKey(parameterName)) { if (filterContext.HttpContext.User.Identity.IsAuthenticated) { Customer CurrentCustomer = DependencyResolverFactory .GetDefault() .Resolve<IUserSession>() .GetCurrentUser(); filterContext.ActionParameters[parameterName] = CurrentCustomer; } } base.OnActionExecuting(filterContext); } } public class UserSession : IUserSession { private readonly ICustomerRepository repository; public UserSession(ICustomerRepository customerRepository) { repository = customerRepository; } public Customer GetCurrentUser() { var identity = HttpContext.Current.User.Identity; if (!identity.IsAuthenticated) { return null; } Customer customer = repository.GetByEmailAddress(identity.Name); return customer; } } I also tried to call update on the repository like the following code shows. But this leads to an NHibernateException which says "Illegal attempt to associate a collection with two open sessions". Actually there is only one. public ActionResult Save(Customer customer) { Customer customerToUpdate = repository .GetById(customer.Id); customer.GivenName = "test"; repository.Update(customerToUpdate); return View(); } Does somebody have an idea why the customer is not updated in the first example but is updated in the second example? Why does NHibernate say that there are two open sessions?

    Read the article

  • Python - how to check if weak reference is still available

    - by Alex
    Hi all, I am passing some weakrefs from Python into C++ class, but C++ destructors are actively trying to access the ref when the real object is already dead, obviously it crashes... Is there any Python C/API approach to find out if Python reference is still alive or any other known workaround for this ? Thanks

    Read the article

  • Is there any tips for minimising access to a public page without login?

    - by alex
    I have a page that is just a non interactive display for a shop window. Obviously, I don't link to it, and I'd also like to avoid people stumbling across it (by Google etc). It will always be powered by Chrome. I have thought of... Checking User Agent for Chrome Ensuring resolution is 1920 x 1080 (not that useful as it is a client side check) Banning under robots.txt to keep Google out of it Do you have any more suggestions? Should I not really worry about it?

    Read the article

  • Can Django be used for web services?

    - by alex
    My friend said, "Pylons is so much better for web services." My other friend said, "You can modify Django in a way to do exactly whatever you like." In Django, what is necessary to be modified (urls.py? models classes? settings?) in order to do "web services" with APIs and REST and versioning, etc etc.?

    Read the article

  • C#: Perform Operations on GPU, not CPU (Calculate Pi)

    - by Alex
    Hello, I've recently read a lot about software (mostly scientific/math and encryption related) that moves part of their calculation onto the GPU which causes a 100-1000 (!) fold increase in speed for supported operations. Is there a library, API or other way to run something on the GPU via C#? I'm thinking of simple Pi calculation. I have a GeForce 8800 GTX if that's relevant at all (would prefer card independent solution though). Any hints are appreciated!

    Read the article

  • Page fully re-rendered event?

    - by alex
    I'm altering the DOM tree in plain JS and need to know when the changes get fully rendered on screen (mostly care about document dimensions). window.onload=function(){ ss = document.styleSheets[0]; for(i = 0; i < ss.cssRules.length; i++) { ss.deleteRule(i) }; ss.addRule('p', 'color: red;') // ... many more // call some other function when the page is fully rendered? } TIA.

    Read the article

  • Trying to get focus onto JTextPane after doubleclicking on JList element (Java)

    - by Alex Cheng
    Hi all. Problem: I have the following JList which I add to the textPane, and show it upon the caret moving. However, after double clicking on the Jlist element, the text gets inserted, but the caret is not appearing on the JTextPane. This is the following code: listForSuggestion = new JList(str.toArray()); listForSuggestion.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listForSuggestion.setSelectedIndex(0); listForSuggestion.setVisibleRowCount(visibleRowCount); listScrollPane = new JScrollPane(listForSuggestion); MouseListener mouseListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent mouseEvent) { JList theList = (JList) mouseEvent.getSource(); if (mouseEvent.getClickCount() == 2) { int index = theList.locationToIndex(mouseEvent.getPoint()); if (index >= 0) { Object o = theList.getModel().getElementAt(index); //System.out.println("Double-clicked on: " + o.toString()); //Set the double clicked text to appear on textPane String completion = o.toString(); int num= textPane.getCaretPosition(); textPane.select(num, num); textPane.replaceSelection(completion); textPane.setCaretPosition(num + completion.length()); int pos = textPane.getSelectionEnd(); textPane.select(pos, pos); textPane.replaceSelection(""); textPane.setCaretPosition(pos); textPane.moveCaretPosition(pos); } } theList.clearSelection(); Any idea on how to "de-focus" the selection on the Jlist, or make the caret appear on the JTextPane after the text insertion? I'll elaborate more if this is not clear enough. Please help, thanks!

    Read the article

  • How to create a step by step wizard in C++ (with unmanaged code) in Visual Studio 2010

    - by Alex. S.
    I would like to build a small wizard in C++ with no dependencies on any framework. Apparently, is really simple, but I don't know where to start. Can you point me to good information (tutorials, etc) on it. Should I use MFC Application or a Win32 project? Is there any step by step guide ? I'm using VS 2010. The majority of info I'd found on MFC is really old. It seems like the vast majority of development is going .net.

    Read the article

  • Cast into new Object, Copy values by Property Name

    - by Alex
    Hello, I have the following: Class 1 (Text, State, Level) Class 2 (Text, State, Level, Ident) Is there a way for me to cast an object of Class 2 into into Class 1, and not having to do the usual cast code (Text = c.Text, State = c.State etc.)? Possibly by identifying the property names of each class and copying the value over?

    Read the article

  • Nested <ul><li> navigation menu using a recursive Python function

    - by Alex
    Hi. I want to render this data structure as an unordered list. menu = [ [1, 0], [2, 1], [3, 1], [4, 3], [5, 3], [6, 5], [7,1] ] [n][0] is the key [n][1] references the parent key The desired output is: <ul> <li>Node 1</li> <ul> <li>Node 2</li> <li>Node 3</li> <ul> <li>Node 4</li> <li>Node 5</li> <ul> <li>Node 6</li> </ul> </ul> <li>Node 7</li> </ul> </ul> I could probably do this without recursion but that would be no fun. Unfortunately, I am having problems putting it all together. I don't have much experience with recursion and this is proving to be very difficult for me to build and debug. What is the most efficient way to solve this problem in Python? Thanks!

    Read the article

  • Align child element to bottom with CSS

    - by alex
    I have a form input, and the label spans multiple lines, and I want the corresponding checkbox to appear at the bottom (last line of the label element). Here is what I was playing with CSS .standard-form { width: 500px; border: 1px solid red; } .standard-form .input-row { overflow: hidden; margin-bottom: 0.8em; } .standard-form label { width: 25%; float: left; } .standard-form .input-container { width: 70%; float: right; } .standard-form .checkbox .input-container { display: table-cell; height: 100%; vertical-align: text-bottom; } HTML <form class="standard-form"> <div class="input-row checkbox" id="permission"> <label for="input-permission"> Do I hereby grant you permission to do whatever tasks are neccessary to achieve an ideal outcome? </label> <div class="input-container"> <input type="checkbox" id="input-permission" name="permission" value="true" /> </div> </div> </form> It is also online at JSbin. Is there any way to do this? I notice that div.input-container isn't expanding, which is the old multi column problem with CSS. I thought I could get this going with display: table-cell and vertical-align: bottom but I haven't been able to do it yet. I don't mind that IE6/7 won't render it correctly.

    Read the article

  • Getting text after URL in asp.net / URL Rewriting (sort of!)

    - by alex
    My app is a very simple "one page" type app- It has Default.aspx I'm basically trying to get, for example: www.myappurl.com/this is my text I want to get hold of "this is my text" from the above example. This will be displayed on the page (for now) I didn't really want to have to use any complext url rewriting things for this... (My hosting provider uses IIS6) I tried using a 404 handler, but this is a bit long winded, and i'm using shared hosting, that can't set the "execute url" on custom 404 pages. Any other ideas?

    Read the article

< Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >