Search Results

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

Page 82/96 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • jquery Iframe src attribute

    - by alex
    Why does x alerts undefined for iframe but works for embed. I'm grabbing the iframe or embed code from a textarea <iframe src="http://www.youtube.com/embed/9kiWvkj2ldWiU?hd=1"></iframe> var textarea = $('#embedModal textarea'), textareaValue = textarea.val(), $embed = $($(textareaValue).find('iframe')), x = $embed.attr('src'); alert(x); //alerts undefined for iframe If you change find('iframe') to find('embed') and you try with the below embed code. then i'm able to get the value of src, but with iframe i get undefined. Seems strange. <embed src="http://www.youtube.com/embed/9kiWvkj2ldWiU?hd=1"></embed>

    Read the article

  • Get home directory in Linux, C++

    - by Alex Farber
    I need a way to get user home directory in C++ program running on Linux. If the same code works on Unix, it would be nice. I don't want to use HOME environment value. AFAIK, root home directory is /root. Is it OK to create some files/folders in this directory, in the case my program is running by root user?

    Read the article

  • Select <a> which is the second <a> on a page that contains some href text?

    - by Alex
    Hello there, I'm working with a page that has several links that contain the same href text, and I need to select the second anchor element on the page that contains said href text. Here's a simplified version of the link structure of the page: <a href="same/link/to/stuff/">same link</a> <a href="same/link/to/stuff/">same link</a> How do I fashion my selector so that it only selects the second anchor in the above example? Thanks!!

    Read the article

  • Contact page MVC workflow

    - by alex
    All my previous projects have had this workflow on Contact pages User submits form Controller gets $_POST details Controller validates details (and sets error messages if necessary) Controller sends email Controller redirects to thanks page Is this the standard workflow? I used to validate everything in controllers, and then did some more reading and they recommended against it. Therefore, should I send the $_POST details to a helper type object and let it do all the work (validation/sending)?

    Read the article

  • jQuery AJAX & an ASP.NET web service works locally but not remotely

    - by Alex
    Interesting one here. I have an ASP.NET 1.1 project that contains a web service in it. I'm using jQuery's AJAX functionality to call some services from the client. This is what my code looks like: $.ajax({ type: "POST", url: 'foo.asmx/functionName', data: 'foo1=' + foo1 + '&foo2=' + foo2, dataType: "xml", success: function(xml) { //do something with my xml data }, error: function(request, error){ //handle my error } }); This works great when I run the site from my IDE on localhost. However, when I deploy this site to any other server I get a parsererror error from jQuery. It does not appear to even call my service as I dropped in some code to write a log file to disk and it's not making it there. The same exact XML should be returned from both my localhost and the server I deployed to. Any ideas?

    Read the article

  • Catch a generic exception in Java?

    - by Alex Baranosky
    We use JUnit 3 at work and there is no ExpectedException annotation. I wanted to add a utility to our code to wrap this: try { someCode(); fail("some error message"); } catch (SomeSpecificExceptionType ex) { } So I tried this: public static class ExpectedExceptionUtility { public static <T extends Exception> void checkForExpectedException(String message, ExpectedExceptionBlock<T> block) { try { block.exceptionThrowingCode(); fail(message); } catch (T ex) { } } } However, Java cannot use generic exception types in a catch block, I think. How can I do something like this, working around the Java limitation? Is there a way to check that the ex variable is of type T?

    Read the article

  • I have data about deadlocks, but I can't understand why they occur (MS SQL/ASP.NET MVC)

    - by Alex
    I am receiving a lot of deadlocks in my big web application. http://stackoverflow.com/questions/2941233/how-to-automatically-re-run-deadlocked-transaction-asp-net-mvc-sql-server Here I wanted to re-run deadlocked transactions, but I was told to get rid of the deadlocks - it's much better, than trying to catch the deadlocks. So I spent the whole day with SQL profiler, setting the tracing keys etc. And this is what I got. There's a Users table. I have a very high usable page with the following query (it's not the only query, but it's the one that causes troubles) UPDATE Users SET views = views + 1 WHERE ID IN (SELECT AuthorID FROM Articles WHERE ArticleID = @ArticleID) And then there's the following query in ALL pages: User = DB.Users.SingleOrDefault(u => u.Password == password && u.Name == username); That's where I get User from cookies. Very often a deadlock occurs and this second LINQ TO SQL query is chosen as a victim, so it's not run, and users of my site see an error screen. I read a lot about deadlocks... And I don't understand why this is causing a deadlock. So obviously both of this queries run very often. At least once a second. Maybe even more often (300-400 users online). So they can be run at the same time very easily, but why does it cause a deadlock? Please help. Thank you

    Read the article

  • Getting all parent rows in one SQL query

    - by Alex
    I have a simple MySQL table thats contains a list of categories, level is determined by parent_id: id name parent_id --------------------------- 1 Home 0 2 About 1 3 Contact 1 4 Legal 2 5 Privacy 4 6 Products 1 7 Support 1 I'm attempting to make a breadcrumb trail. So i have the 'id' of the child, I want to get all available parents (iterating up the chain until we reach 0 "Home"). There could be any number or child rows going to an unlimited depth. Currently I am using an SQL call for each parent, this is messy. Is there a way in SQL to do this all on one query?

    Read the article

  • How do I load a Direct X .x 3D model in iPhone SDK?

    - by Alex
    I have been searching the internet for the last few days trying to figure this out. My goal is to draw a textured and animated .x file exported from a 3D program. I found a tutorial of how to load and draw a .obj file, which I understand, but the tutorial doesn't say how to texture it, and .obj doesn't support animation. The .x file structure is human readable just like .obj, but I have no clue how to texture it, and I might be able to figure out how to animate it, but I would prefer to be instructed on that. Any help would be GREATLY appreciated.

    Read the article

  • OpenID login on local development server for google app engine

    - by Alex Jeffery
    Are you able to use open id to log into the local development server with google app engine sdk version 1.4.1 and python 2.5? When I execute this self.redirect(users.create_login_url(continue_url, None, openid_url)) I get redirected to http://localhost/_ah/login rather than the openid url. The openid url and continue url are valid. My app.yaml looks like this - url: /_ah/login_required script: do_openid_login.py - url: /users/(.*) script: routers/user_router.py login: required If I browse to http://localhost/users/ I am also redirected to http://localhost/_ah/login rather than http://localhost/_ah/login_required Is there a config issue or does openid not work locally?

    Read the article

  • joining two tables and getting aggregate data

    - by alex
    how do i write a query that returns aggregate sales data for California in the past x months. ----------------------- ----------------------- | order | | customer | |-----------------------| |-----------------------| | orderId int | | customerId int | | customerId int | | state varchar | | deposit decimal | ----------------------- | orderDate date | ----------------------- ----------------------- | orderItem | |-----------------------| | orderId int | | itemId int | | qty int | | lineTotal decimal | | itemPrice decimal | -----------------------

    Read the article

  • Object initialization sequence in Objective-C

    - by Alex
    Hello everyone. The Cocoa framework has a convention to always call self = [super init] in the init method of an inherited class, because [super init] may return a new instance. What will happen if I do this? @interface MyClass : NSObject /* or any other class */ { int ivar_; } @end @implementation MyClass - (id)init { ivar_ = 12345; if ((self = [super init])) { NSLog(@"ivar_'s value is %d", ivar_); } return self; } @end In the case when [super init] returns a new instance, what will I see in the console? ivar_'s value is 0? I can't think of a way to check this myself, because I don't know which class may return a new instance from its init method. Also, can't seem to find explicit clarification for this scenario in the docs. Could anyone help me out? Thanks!

    Read the article

  • Just how much do I want to make virtual?

    - by Alex
    I am writing an abstract superclass where literally every method is going to be overridden. There is some default functionality I could implement, but most of the time it's enough to leave the implementation to the subclass writer. Since just about every method is going to be overwritten, how much should I make virtual and how much should I just leave as regular methods? In the current incarnation, everything is virtual, but I still haven't let this loose to anyone to use, so the design is flexible. What advantages/disadvantages are there to virtual functions? Links to good reading material about this would be appreciated.

    Read the article

  • How do I most efficienty check the unique elements in a list?

    - by alex
    let's say I have a list li = [{'q':'apple','code':'2B'}, {'q':'orange','code':'2A'}, {'q':'plum','code':'2A'}] What is the most efficient way to return the count of unique "codes" in this list? In this case, the unique codes is 2, because only 2B and 2A are unique. I could put everything in a list and compare, but is this really efficient?

    Read the article

  • ASP.NET check if LinqToEntities returned something or not.

    - by Alex
    How to make this method return boolean value, depending on query return. False - nothing, True - data exists. Before i just returned int from uniqueQuote.Count() but does not look like great method. Thank you! private bool CheckEnquiryUser(int enquiryId, Guid userId) { int selectedEnquiryId = enquiryId; Guid currentUserId = userId; Entities ctx3 = new Entities(); var uniqueQuote = from quot in ctx3.Enquiries.Include("aspnet_Users") where quot.EnquiryId == selectedEnquiryId && quot.aspnet_Users.UserId == currentUserId select quot; bool exist = uniqueQuote; return exist;

    Read the article

  • multiple threads writting to a same socket problem

    - by alex
    Hi: My program uses sockets for inter-process communication. There is one server listening on a socket port(B) on localhost waiting for a list of TCP clients to connect. And on the other end of the server is another a socket(A) that sends out data to internet. The server is designed to take everything the TCP clients send him and forward to a server on the internet. My question is if two of the TCP clients happened to send data at the same time, is this going to be a problem for the server's outgoing socket(A)? Thanks

    Read the article

  • Problem with underscore(_) in Collections.binarySearch (Java)

    - by Alex Cheng
    Hi all. Problem: I am using Java Tutorials™ sourcecode for this. This is the source code. I tried this: --following with another section of sorted words-- words.add("count"); words.add("cvs"); words.add("dce"); words.add("depth"); --following with another section of sorted words-- and it works perfectly. However when I use this: --just a section of sorted words-- words.add("count"); words.add("cvs"); words.add("dce_iface"); words.add("dce_opnum"); words.add("dce_stub_data"); words.add("depth"); --following with another section of sorted words-- It does show dce_iface when I type dce, but when I type _ then following with o or s it shows me something else like dce_offset where the offset comes from words.add("fragoffset"); somewhere in the list. What can I do to solve this problem? Thank you in advance.

    Read the article

  • Which DB Server should I use?

    - by Alex
    I have to develop a new (desktop) app for a small business. This business currently has an Access database with millions of records. The file size is about 1.5 GB. The boss told me that searching on this DB is very slow. The DB consists of a single table with about 20 fields. I also think the overall DB design isn't great. I thought to use another DB server with a new design to improve both performance and efficiency. Considering this is a relatively small business, I don't want to spend much for a DB license, so I want to ask you what would you do. Continue to use Access, maybe improving and optimizing the DB in some way Buy a DB server license (in this case, which one?) ? (any idea?)

    Read the article

  • Getting input in system() function (Mac)

    - by Alex
    #include <iostream> using namespace std; int main() { short int enterVal; cout << "enter a number to say: " << endl; cin >> enterVal; system("say "%d"") << enterVal; return 0; } Is what I am currently trying. I want the user to enter a number and the system() function says it basically. The code above has an error which says " 'd' was not declared in this scope ". Thanks in advance.

    Read the article

  • How to enable core dump in my Linux C++ program

    - by Alex Farber
    My program is written in C++. compiled with gcc, using -g3 -O0 -ggdb flags. When it crashes, I want to open its core dump. Does it create core dump file, or I need to do something to enable core dump creation, in the program itself, or on computer where it is executed? Where this file is created, and what is its name?

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >