Search Results

Search found 2396 results on 96 pages for 'alex nauda'.

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

  • .net mvc2 custom HtmlHelper extension unit testing

    - by alex
    My goal is to be able to unit test some custom HtmlHelper extensions - which use RenderPartial internally. http://ox.no/posts/mocking-htmlhelper-in-asp-net-mvc-2-and-3-using-moq I've tried using the method above to mock the HtmlHelper. However, I'm running into Null value exceptions. "Parameter name: view" Anyone have any idea?? Thanks. Below are the ideas of the code: [TestMethod] public void TestMethod1() { var helper = CreateHtmlHelper(new ViewDataDictionary()); helper.RenderPartial("Test"); // supposingly this line is within a method to be tested Assert.AreEqual("test", helper.ViewContext.Writer.ToString()); } public static HtmlHelper CreateHtmlHelper(ViewDataDictionary vd) { Mock<ViewContext> mockViewContext = new Mock<ViewContext>( new ControllerContext( new Mock<HttpContextBase>().Object, new RouteData(), new Mock<ControllerBase>().Object), new Mock<IView>().Object, vd, new TempDataDictionary(), new StringWriter()); var mockViewDataContainer = new Mock<IViewDataContainer>(); mockViewDataContainer.Setup(v => v.ViewData) .Returns(vd); return new HtmlHelper(mockViewContext.Object, mockViewDataContainer.Object); }

    Read the article

  • Using multiple databases within one application (ASP.NET MVC, LINQ to SQL)

    - by Alex
    I have a web application made for several groups of people not connected with each other. Instead of using one database for all of them, I'm thinking about making separate databases. This will improve the speed of the queries and make me free from checking to what group the user belongs. But since I'm working with LINQ to SQL, my classes are explicitly connected with the databases, so I will have to make separate DataContexts for all of the databases. So how can I solve this problem? Or should I just not bother and use one database only?

    Read the article

  • Does Zend application server provide any sort of pushed-based messaging architecture support?

    - by Alex
    Does Zend application server provide any sort of pushed-based messaging architecture support?I mean some different message-oriented middlewares that can be used for the push-based architecture or email support?There is a need in provision of the non web-based interface for certain users of the website who would get regular messages notifying them of different special offers in their field of interest(it should be push-based)

    Read the article

  • Javascript CSS visability.

    - by Alex
    It seems that javascript only can ready inline css if i want to check if element is display:hidden getting it with: el.style.display But how to check if display:none is placed inside external CSS file?

    Read the article

  • Is there any way to make gcc print offending lines when it emits an error?

    - by Alex
    I have a large codebase that I've been tasked with porting to 64 bits. The code compiles, but it prints a very large amount of incompatible pointer warnings (as is to be expected.) Is there any way I can have gcc print the line on which the error occurs? At this point I'm just using gcc's error messages to try to track down assumptions that need to be modified, and having to look up every one is not fun.

    Read the article

  • Why specifcially in my example does this "too much recursion" error occur in my JavaScript?

    - by alex
    I have been looking into this for a little while now. I have a gallery on my page, that uses Ariel Flesler's scrollTo plugin. It works fine on the home page, but not on the Contact page. In Firefox, I get the error... Too much recursion I have sorted through as much code as possible and set breakpoints in a few places. I am pretty sure it is something to do with the plugin (specifically, when it is called in the click handler). For your convenience, I am using the unpacked versions of jQuery and scrollTo plugin. What on earth am I doing wrong? Thanks for your time.

    Read the article

  • looking for a javascript engine

    - by c0f33.alex
    i'm looking for a js engine to that I can (easily) expose C/C++ functions, classes etc. The API should allow changing exposed values from within C++ (by storing some kind of pointer or reference to an object inside js or so...). I've considered using google's v8 but I'm new to it and don't know whether it will satisfy my requirements. Can someone tell me whether I should stick to v8 or try something else?

    Read the article

  • I'm doing a lot of lists and dictionary sorting...and this is causing memory errors in Python websit

    - by alex
    I retrieved data from the log table in my database. Then I started finding unique users, comparing/sorting lists, etc. In the end I got down to this. stats = {'2010-03-19': {'date': '2010-03-19', 'unique_users': 312, 'queries': 1465}, '2010-03-18': {'date': '2010-03-18', 'unique_users': 329, 'queries': 1659}, '2010-03-17': {'date': '2010-03-17', 'unique_users': 379, 'queries': 1845}, '2010-03-16': {'date': '2010-03-16', 'unique_users': 434, 'queries': 2336}, '2010-03-15': {'date': '2010-03-15', 'unique_users': 390, 'queries': 2138}, '2010-03-14': {'date': '2010-03-14', 'unique_users': 460, 'queries': 2221}, '2010-03-13': {'date': '2010-03-13', 'unique_users': 507, 'queries': 2242}, '2010-03-12': {'date': '2010-03-12', 'unique_users': 629, 'queries': 3523}, '2010-03-11': {'date': '2010-03-11', 'unique_users': 811, 'queries': 4274}, '2010-03-10': {'date': '2010-03-10', 'unique_users': 171, 'queries': 1297}, '2010-03-26': {'date': '2010-03-26', 'unique_users': 299, 'queries': 1617}, '2010-03-27': {'date': '2010-03-27', 'unique_users': 323, 'queries': 1310}, '2010-03-24': {'date': '2010-03-24', 'unique_users': 352, 'queries': 2112}, '2010-03-25': {'date': '2010-03-25', 'unique_users': 330, 'queries': 1290}, '2010-03-22': {'date': '2010-03-22', 'unique_users': 329, 'queries': 1798}, '2010-03-23': {'date': '2010-03-23', 'unique_users': 329, 'queries': 1857}, '2010-03-20': {'date': '2010-03-20', 'unique_users': 368, 'queries': 1693}, '2010-03-21': {'date': '2010-03-21', 'unique_users': 329, 'queries': 1511}, '2010-03-29': {'date': '2010-03-29', 'unique_users': 325, 'queries': 1718}, '2010-03-28': {'date': '2010-03-28', 'unique_users': 340, 'queries': 1815}, '2010-03-30': {'date': '2010-03-30', 'unique_users': 329, 'queries': 1891}} It's not a big dictionary. But when I try to do one last thing...it craps out on me. for k, v in stats: mylist.append(v) too many values to unpack What the heck does that mean??? TOO MANY VALUES TO UNPACK.

    Read the article

  • mysql_affected_rows() returns 0 for UPDATE statement even when an update actually happens

    - by Alex Moore
    I am trying to get the number of rows affected in a simple mysql update query. However, when I run this code below, PHP's mysql_affected_rows() always equals 0. No matter if foo=1 already (in which case the function should correctly return 0, since no rows were changed), or if foo currently equals some other integer (in which case the function should return 1). $updateQuery = "UPDATE myTable SET foo=1 WHERE bar=2"; mysql_query($updateQuery); if (mysql_affected_rows() > 0) { echo "affected!"; } else { echo "not affected"; // always prints not affected } The UPDATE statement itself works. The INT gets changed in my database. I have also double-checked that the database connection isn't being closed beforehand or anything funky. Keep in mind, mysql_affected_rows doesn't necessarily require you to pass a connection link identifier, though I've tried that too. Details on the function: mysql_affected_rows Any ideas? SOLUTION The part I didn't mention turned out to be the cause of my woes here. This PHP file was being called ten times consecutively in an AJAX call, though I was only looking at the value returned on the last call, ie. a big fat 0. My apologies!

    Read the article

  • Why does Perl lose foreign characters on Windows input - can this be fixed (if so, how) or is Perl an outdated dinosaur that just can't handle this?

    - by Alex R
    Note below how ã changes to a This is causing me a huge problem as foreign characters show up in URLs, e.g. http://pt.wikipedia.org/wiki/Cão The OS is Windows 7, 64-bit. The Perl is: This is perl 5, version 12, subversion 2 (v5.12.2) built for MSWin32-x64-multi-thread (with 8 registered patches, see perl -V for more detail) Copyright 1987-2010, Larry Wall Binary build 1202 [293621] provided by ActiveState http://www.ActiveState.com Built Sep 6 2010 22:53:42 Additional update: To get around my particular problem, I tried using File::Find instead of piped input. The issue actually gets worse:

    Read the article

  • 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

  • HTML5 Canvas compositing question (source-in)

    - by Alex Ciarlillo
    I am trying to recreate a page flipping type animation in HTML5 using canvas. The animation is based on ideas from here: hxxp://oreilly.com/javascript/archive/flashhacks.html but thats not really important. The problem I am having is that using the 'source-in' composite operation is not giving me the results I expect and would like clarification as to why. Here is the example: (i think it can only be viewed in chrome, not working in FF 3.6) http://acpound.fylez.com/test/example.html The black rectangle is supposed to act as a 'mask' for the page being turned over. All I want to see is the turning page in the areas where it overlaps the mask. The problem is the entire black rectangle is drawn, not just the area where they overlap. The source is all on the page. I know HTML5 isn't really being used yet, I'm just experimenting for my personal site and curiosity. Any ideas would be greatly appreciated.

    Read the article

  • Form creating sites with output

    - by Alex
    Sites lite faary.com wufoo.com/and theformsite.com help you building forms But the output tables that being created are password protected as far as i know. Are there sites/scripts like the above which can make the output visible to all ? Something like a "guest book" script/form that you can edit the fields and the output will show immediately ? Thank you.

    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

  • 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

  • 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

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