Search Results

Search found 4651 results on 187 pages for 'john varghese'.

Page 118/187 | < Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >

  • How deep are your unit tests?

    - by John Nolan
    The thing I've found about TDD is that its takes time to get your tests set up and being naturally lazy I always want to write as little code as possible. The first thing I seem do is test my constructor has set all the properties but is this overkill? My question is to what level of granularity do you write you unit tests at? ..and is there a case of testing too much?

    Read the article

  • Objective-C++ visibility question

    - by John Smith
    I have linked a library with my program. It works fine. The only problem is that there visibility errors/warnings (thousands of them). They are all of the form: newlib::method() has different visibility (default) in newlib.a and (hidden) in AppDelegate.o It is always with AppDelegate.o. I have tried to set the visibility for both the library and the main app in several ways: the visibility checkmark in XCode, and -fvisibility. Non seem to have worked. Is there somethin special about AppDelegate.mm?

    Read the article

  • How easy would it be to refactor a small JSP/Servlet/JDBC project to SpringMVC/Hibernate

    - by John
    With reference to this post, I am considering starting a new web-based Java project. Since I don't know Spring/Hibernate I was concerned if it's a bad plan to start learning them while creating a new project, especially since it will slow down the early development. One idea I had was to write a prototype using tech I do know, namely JSP/Servlets/JDBC, since I can get this running much quicker with my current knowledge. I could then throw the whole thing away and start over with Spring, etc, but I'd like to consider how easy it would be to refactor a smallish project from JSP/Servlets/JDB to SpringMVC/Hibernate? My DB could of course be re-used but what about other code... would I expect to save most of it plugged into an MVC framework, or is the paradigm shift big enough this would cause more trouble than it avoids? Please use the other question for more general advice on choosing technologies

    Read the article

  • Handling a Long Running jsp request on the server using Ajax and threads

    - by John Blue
    I am trying to implement a solution for a long running process on the server where it is taking about 10 min to process a pdf generation request. The browser bored/timesout at the 5 mins. I was thinking to deal with this using a Ajax and threads. I am using regular javascript for ajax. But I am stuck with it. I have reached till the point where it sends the request to the servlet and the servlet starts the thread.Please see the below code public class HelloServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("POST request!!"); LongProcess longProcess = new LongProcess(); longProcess.setDaemon(true); longProcess.start(); request.getSession().setAttribute("longProcess", longProcess); request.getRequestDispatcher("index.jsp").forward(request, response); } } class LongProcess extends Thread { public void run() { System.out.println("Thread Started!!"); while (progress < 10) { try { sleep(2000); } catch (InterruptedException ignore) {} progress++; } } } Here is my AJax call <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>My Title</title> <script language="JavaScript" > function getXMLObject() //XML OBJECT { var xmlHttp = false; xmlHttp = new XMLHttpRequest(); //For Mozilla, Opera Browsers return xmlHttp; // Mandatory Statement returning the ajax object created } var xmlhttp = new getXMLObject(); //xmlhttp holds the ajax object function ajaxFunction() { xmlhttp.open("GET","HelloServlet" ,true); xmlhttp.onreadystatechange = handleServerResponse; xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send(null); } function handleServerResponse() { if (xmlhttp.readyState == 4) { if(xmlhttp.status == 200) { document.forms[0].myDiv.value = xmlhttp.responseText; setTimeout(ajaxFunction(), 2000); } else { alert("Error during AJAX call. Please try again"); } } } function openPDF() { document.forms[0].method = "POST"; document.forms[0].action = "HelloServlet"; document.forms[0].submit(); } function stopAjax(){ clearInterval(intervalID); } </script> </head> <body><form name="myForm"> <table><tr><td> <INPUT TYPE="BUTTON" NAME="Download" VALUE="Download Queue ( PDF )" onclick="openPDF();"> </td></tr> <tr><td> Current status: <div id="myDiv"></div>% </td></tr></table> </form></body></html> But I dont know how to proceed further like how will the thread communicate the browser that the process has complete and how should the ajax call me made and check the status of the request. Please let me know if I am missing some pieces. Any suggestion if helpful.

    Read the article

  • Do most web 'programmers' (not designers) use WYSIWYG editors or hand code their HTML?

    - by John MacIntyre
    When I started programming web pages, it became immediately obvious that the WYSIWYG editors sucked. The HTML output was difficult to maintain, did things in ways you may not have agreed with, completely messed up existing pages if opened, couldn't handle code in the page, and was polluted with dead or irrelevant code like <font ...></font>. At that time, I didn't know a single programmer with more than 6 months experience who didn't hand code their HTML. Even now, most of the developers I know hand code their HTML. But, I also realize this was a decade ago, WYSIWYG editors have improved, and I may be seriously underproductive hand coding my HTML. Do you, as a web programmer, use WYSIWYG editors for your HTML? PS-I'm kind of thinking we can just vote either YES or NO, and put comments below.

    Read the article

  • Efficiently using position to control actions

    - by John Ashmore
    I want to use position (returned from a gridview for e.g.) or a similar numeric integer to do various things, e.g. create a sprite, or in any command that wants something other than a number, e.g. I want to use something like: sprites.add(createSprite(R.drawable.image(position)); , where createSprite creates a sprite using the image supplied, instead of: if (position == 1) {sprites.add(createSprite(R.drawable.image1);} if (position == 2) {sprites.add(createSprite(R.drawable.image2);} ...etc There is an easy solution for strings: Most efficient method to use position to open a .java but what about for situations like this one?

    Read the article

  • Winforms - How to allow user to increase font size of listview with hidden controls?

    - by John M
    I am creating an winform application that will run on a tablet PC. One form for this app will have a listview control. I would like to allow the user to change the font size based on preference (ie did they remember their glasses today). A few ways that I can think of would be a numeric-up-down or +/- button controls. Both of these ways require screen real estate that is very limited. Is there a control or technique that would allow font size changes with a hidden-when-not-used control?

    Read the article

  • SQL developer here -- Nesting with select * finicky in Oracle 10g?

    - by John Sullivan
    I am writing a simple diagnostic query I will execute in my Oracle 10g scratchpad. I am trying to do this as part of a step to build the query. In the SQL Scratchpad for Oracle 10g Enterprise Manager Console, this statement runs fine. SELECT * FROM v$session sess, v$sql sql WHERE sql.sql_id(+) = sess.sql_id and sql.sql_text <> ' ' If I try to wrap that up in Select * from () tb2 I get an error, "ORA-00918: Column Ambiguously Defined". I didn't think that could ever happen with this kind of statement so I am a bit confused. select * from (SELECT * FROM v$session sess, v$sql sql WHERE sql.sql_id(+) = sess.sql_id and sql.sql_text <> ' ') tb2 You should always be able to select * from the result set of another select * statement using this structure as far as I'm aware... right? Is Oracle/10g/the scratchpad trying to force me to accept a certain syntactic structure to prevent excessive nesting? Is this a bug in scratchpad or something about how oracle works?

    Read the article

  • WPF WrapPanel - all items should have the same width

    - by John
    I have a ListBox whose ItemsPanel I have replaces with a WrapPanel. The WrapPanel now hosts the databound ListboxItems. Each item has a variable sized text in it, giving each item a different width. However, I want the width to be constant so that all items have the same width as the item with the longest text. Is that possible?

    Read the article

  • How to understand other people's CSS architectures?

    - by John
    I am reasonably good with CSS. However, when working with someone else's CSS, it's difficult for me to see the "bigger picture" in their architecture (but i have no problem when working with a CSS sheet I wrote myself). For example, I have no problems using Firebug to isolate and fix cross browser compatibility issues, or fixing a floating issue, or changing the height on a particular element. But if I'm asked to do something drastic such as, "I want the right sidebars of pages A, B, C and D to have a red border. I want the right side bars of pages E, F and G to have a blue border if and only if the user mouses over", then it takes me time a long time to map out all the CSS inheritance rules to see the "bigger picture". For some reason, I don't encounter the same difficulty with backend code. After a quick debriefing of how a feature works, and a quick inspection of the controller and model code, I will feel comfortable with the architecture. I will think, "it's reasonable to assume that there will be an Employee class that inherits from the Person Class that's used by a Department controller". If I discover inconvenient details that aren't consistent with overall architectural style, I am confident that I can hammer things back in place. With someone else's CSS work, it's much harder for me to see the "relationships" between different classes, and when and how the classes are used. When there are many inheritance rules, I feel overwhelmed. I'm having trouble articulating my question and issues... All I want to know is, why is it so much harder for me to see the bigger picture in someone else's CSS architecture than compared to someone else's business logic layer? **Does it have any thing to do with CSS being a relatively new technology, and there aren't many popular design patterns?

    Read the article

  • Ruby - Writing Hpricot data to a file

    - by John
    Hey everyone, I am currently doing some XML parsing and I've chosen to use Hpricot because of it's ease of use and syntax, however I am running into some problems. I need to write a piece of XML data that I have found out to another file. However, when I do this the format is not preserved. For example, if the content should look like this: <dict> <key>item1</key><value>12345</value> <key>item2</key><value>67890</value> <key>item3</key><value>23456</value> </dict> And assuming that there are many entries like this in the document. I am iterating through the 'dict' items by using hpricot_element = Hpricot(xml_document_body) f = File.new('some_new_file.xml') (hpricot_element/:dict).each { |dict| f.write( dict.to_original_html ) } After using the above code, I would expect that the output look like the following exactly like the XML shown above. However to my surprise, the output of the file looks more like this: <dict>\n", " <key>item1</key><value>12345</value>\n", " <key>item2</key><value>67890</value>\n", " <key>item3</key><value>23456</value\n", " </dict> I've tried splitting at the "\n" characters and writing to the file one line at a time, but that didn't seem to work either as it did not recognize the "\n" characters. Any help is greatly appreciated. It might be a very simple solution, but I am having troubling finding it. Thanks!

    Read the article

  • TSQL - compare tables

    - by Rya
    I want to create a stored procedure that compares the results of two queries. If the results of the 2nd table can be found in the first, print 'YES', otherwise, print 'No'. Table 1: SELECT dbo.Roles.RoleName, dbo.UserRoles.RoleID FROM dbo.Roles LEFT OUTER JOIN dbo.UserRoles ON dbo.Roles.RoleID = dbo.UserRoles.RoleID WHERE (dbo.Roles.PortalID = 0) AND (dbo.UserRoles.UserID = 2) Table 2: Declare @RowData as nvarchar(2000) Set @RowData = ( SELECT EditPermissions FROM vw_XMP_DMS_Documents where DocumentID = 2) Select Data from dbo.split(@RowData, ',') For example. Table 1: John Jack James Table 2: John Sally Jane Print 'YES' Is this possible??? Thank you all very much. -R

    Read the article

  • how to define div or table cell height depending on the height of other divs or cells

    - by John
    I want to have a web page that contains 3 parts: A header at the top of the page , a footer (both of which having specific height in px)and the main part of the page which should be a div or table cell with the appropriate height attribute in order to take all the available space between them. I want the page to take 100% of the browser window height, trying to avoid scrollbars. The problems I have are the following: USING DIVs a) If I set the maindiv height to 100%, the page overflows and I get a vertical scrolbar. (the maindiv's height is set to the 100% of the browser window) <!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=utf-8" /> <title>Untitled Document</title> </head> <style type="text/css"> <!-- body, html{ height: 100%; max-height:100%; width: 100%; margin:0; padding:0; } div{padding:0;margin:0;} #containerdiv{height:100%;width:100%;background-color:#FF9;border:0;} #headerdiv{height:150px;width:100%;background-color:#0F0;border:0;} #footerdiv{height:50px;width:100%;background-color:#00F;border:0; } #maindiv{ background-color:#F00; height:100%; } div{border:#000 medium solid;border:0;} </style> <body> <div id="containerdiv"> <div id="headerdiv">headerdiv</div> <div id="maindiv">maindiv</div> <div id="footerdiv">footerdiv</div> </div> </body> </html> b) If I set the maindiv height to auto, the maindiv height is depending on it's content, which is not what I want. USING tables a) If I set the main cell height to 100% it works fine with Firefox but in Internet Explorer 8 I get a vertical scrollbar (you can use the next code block using th style="height:100%" instead of "auto" to see this.) b) If I set the main cell to auto it seems to be working both in IE and FF but then I have the problem that anything I put inside the maincell (table or div) cannot get maincell's full height in IE. <!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=utf-8" /> <title>Untitled Document</title> </head> <style type="text/css"> <!-- body, html, table{ height: 100%; width: 100%; margin:0; padding:0; } table{border:#000 0px solid} </style> <body> <table style="background:#063" cellpadding="0" cellspacing="0" border="0"> <tr><th style="height:150px;background-color:#FF0"></th></tr> <tr> <th style="height:auto"><table style="background:#0FF;" cellpadding="0" cellspacing="0" border="0"><tr><th style="height:auto">nested cell</th></tr></table> </th> </tr> <tr><th style="height:50px;background-color:#FF0"></th></tr> </table> </body> </html> </html> Any ideas? Maybe there is an easier way to define the size of the main part of the page in px using javascript? (my javascript skills are pretty poor so any help with this is welcome!)

    Read the article

  • ASP.net MVC support for URL's with hyphens

    - by John
    Is there an easy way to get the MvcRouteHandler to convert all hyphens in the action and controller sections of an incoming URL to underscores as hyphens are not supported in method or class names. This would be so that I could support such structures as sample.com/test-page/edit-details mapping to Action edit_details and Controller test_pagecontroller while continuing to use MapRoute method. I understand I can specify an action name attribute and support hyphens in controller names which out manually adding routes to achieve this however I am looking for an automated way so save errors when adding new controllers and actions.

    Read the article

  • Linux file names & file globbing

    - by John Lelos
    I have a list of files named: file000 file001 file002 file003 ... file1100 How can I match all files that have a number greater than 800 but less than 1000 ? I am using linux bash Thank you Edit Actually, my files are named like: ab869.enc cp936.enc g122345.enc x2022.enc abc8859-14.enc aax5601.enc cp936-1.enc so the first solution dont match the correct files :( How can I match files that have number between 800-999 ?

    Read the article

  • File structure for PHP-based website.

    - by John Berryman
    I'm building a PHP-based web app for the first time and I haven't found anything to pattern it after. At this point I'm mostly curious about how the files should be arranged into directories so that development of the website can be manageable. This includes javascript scripts, images, stylesheets, cgi scripts, html files, pure php files that define common functions, etc. Question: Can someone point me to an explanation about how such a website is typically organized on the server?

    Read the article

  • How can I detect when the .NET Framework feature is "turned off" in Windows 7 / Vista?

    - by John Myczek
    My application requires the .NET Framework version 3.5. I recently ran into a customer that had the .NET Framework installed but turned off on Windows Vista (also applies to Windows 7). In this case, my installer (InstallShield 2009) does not prompt the user to install the Framework (because it is already installed) and when my application runs it crashes immediately. I tried another .NET application and it also crashes immediately. Is there any way to detect this situation and handle it more gracefully? Just detecting this during install is not ideal since the .NET Framework can be turned off at any time. Ideally, the application would be able to check and display a friendly message to the user telling them they need to turn on the .NET Framework. EDIT: "Turning off" the .NET Framework in Windows Vista or Windows 7 is not the same as uninstalling it. The Framework can be simply turned back on without reinstalling: http://windows.microsoft.com/en-US/windows-vista/Turn-Windows-features-on-or-off

    Read the article

  • [Visual C++]Forcing memory alignment of variables/data-structures

    - by John
    I'm looking at using SSE and I gather aligning data on 16byte boundaries is recommended. There are two cases to consider: float data[4]; struct myystruct { float x,y,z,w; }; I'm not sure the first case can be done explicitly, though there's perhaps a compiler option I could use? In the second case I remember being able to control packing in old versions of GCC several years back, is this still possible?

    Read the article

  • Django Problem - trying to access data entered into a form and feed it through a different page

    - by John Hoke
    OK, so let me give you an overview first. I have this site and in it there is a form section. When you access that section you can view or start a new project. Each project has 3-5 different forms. My problem is that I don't want viewers to have to go through all 3-5 pages to see the relevant information they need. Instead I want to give each project a main page where all the essential data entered into the forms is shown as non-editable data. I hope this makes sense. So I need to find a way to access all that data from the different forms for each project and to feed that data into the new page I'll be calling "Main". Each project will have a separate main page for itself. I'm pretty much clueless as to how I should do this, so any help at all would be appreciated. Thanks

    Read the article

  • Web app implementation question.

    - by John Berryman
    I would like to create a web app similar to Stack Overflow in that the users will have different "point" levels and that their capabilities within the web app will be different based upon their point level. Question: How can this best be implemented? How can it be implemented in a way that is un-hackable (i.e. accessing capabilities that should not be available)? I figure there are two ways to do this: server-side and client-side. For the server-side solution, for each page request you check who the user is and have the CGI rewrite the page so that the client only gets a web page with the intended capabilities. For the client-side solution, the server gives the client the fully capable app and it is the client's job to check the point level and to handicap the app appropriately. It seems like the client-side solution would be easier on the server, (which is really important for my app), but more susceptible to someone hacking and using capabilities unwarranted by their point level.

    Read the article

< Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >