Search Results

Search found 34813 results on 1393 pages for 'im fine'.

Page 11/1393 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Javascript fine grain performance tweaking

    - by thermal7
    I have been writing my first jQuery plugin and struggling to find a means to time how long different pieces of code take to run. I can use firebug and console.time/profile. However, it seems that because my code executes so fast I get no results with profile and with time it spits out 0ms. (http://stackoverflow.com/questions/2690697/firebug-profiling-issue-no-activity-to-profile/2690846#2690846) Is there a way to get the time at a greater level of detail that milliseconds in javascript?

    Read the article

  • Curvey Redraw tabs working fine on Firefox , problem with IE

    - by Rohit
    Hi, I have used curvey redraw library from google code(http://code.google.com/p/curvycorners/) & it has solved my purpose, though now as per new req i am struggling with IE. I want to have two tab rows each containing 2 tabs. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>curvyCorners - Tab demo</title> <style type="text/css">/*<![CDATA[*/ /* tab styles */ #tabrow { margin:0; padding-left:1ex; min-width:800px; font-size:small; letter-spacing:0.3pt; line-height:1; height:24px; } #tabrow ul { margin:0; padding:0; list-style:none; position:absolute; z-index:2; } #tabrow li { float:left; background-color:#E0DFE3; color:#000; margin-right:5px; padding:5px; -webkit-border-top-left-radius:5px; -webkit-border-top-right-radius:5px; -moz-border-radius-topleft:5px; -moz-border-radius-topright:5px; border-top:solid #9B9B9B 1px; border-left:solid #9B9B9B 1px; border-right:solid #9B9B9B 1px; border-bottom-width:0; border-bottom-color:transparent; cursor:pointer; font-family:verdana;font-weight:bold;font-style:italic } #tabrow li.select { background-color:#ffffff; color:#2470c4; height:14px; } /* page styles */ #midbox { width:220px; height:305px; -webkit-border-radius: 5px; -moz-border-radius: 5px; } #midbox { border: solid #9b9b9b 1px; background-color:#ffffff; } #midbox p { margin:0; padding-bottom:1ex; } h1, #topbox h2 { margin:0 15pt; padding: 5pt 0; } div.subpage { padding:1em; } /*]]>*/ </style> <script type="text/javascript" src="curvs.js"> </script> <script type="text/javascript">//<![CDATA[ var selectedTab = 0; function tabclick(n) { if (n === selectedTab) return; // nothing to do. var li = document.getElementById('tab' + selectedTab); curvyCorners.adjust(li, 'className', ''); // Remove the 'select' style li = document.getElementById('page' + selectedTab); li.style.display = 'none'; // hide the currently selected sub-page li = document.getElementById('page' + n); li.style.display = 'block'; // show the new sub-page li = document.getElementById('tab' + n); // get the new (clicked) tab curvyCorners.adjust(li, 'className', 'select'); // and update its style curvyCorners.redraw(); // Redraw all elements with className curvyRedraw selectedTab = n; // store for future reference } var selectedTab1 = 2; function tabclick1(n) { if (n === selectedTab1) return; // nothing to do. var li = document.getElementById('tab' + selectedTab1); curvyCorners.adjust(li, 'className', ''); // Remove the 'select' style li = document.getElementById('page' + selectedTab1); li.style.display = 'none'; // hide the currently selected sub-page li = document.getElementById('page' + n); li.style.display = 'block'; // show the new sub-page li = document.getElementById('tab' + n); // get the new (clicked) tab curvyCorners.adjust(li, 'className', 'select'); // and update its style curvyCorners.redraw(); // Redraw all elements with className curvyRedraw selectedTab1 = n; // store for future reference } //]]> </script> </head> <body> <div id="tabrow"> <ul> <li id="tab0" onclick="tabclick(0);" class="select curvyRedraw">Categories</li> <li id="tab1" onclick="tabclick(1);" class="curvyRedraw">Services</li> </ul> </div> <div id="midbox" class="curvyRedraw"> <div id="page0" class="subpage"> Category details </div> <div id="page1" class="subpage" style="display:none"> Service details </div> </div> <br/><br/> <div id="tabrow"> <ul> <li id="tab2" onclick="tabclick1(2);" class="select curvyRedraw">Recent Activiites</li> <li id="tab3" onclick="tabclick1(3);" class="curvyRedraw">News</li> </ul> </div> <div id="midbox" class="curvyRedraw"> <div id="page2" class="subpage"> Activities </div> <div id="page3" class="subpage" style="display:none"> News </div> </div> </body> </html> Can you please help me out in this? Thanks, Rohit.

    Read the article

  • Javascript errors on internet explorer with jQuery but working fine on Firefox

    - by user994319
    A quick question I'm hoping someone can help me out with. On firefox our jQuery slider is working perfectly, however on viewing with internet explorer there are some javascript errors occurring. The website is http://foscam-uk.com/index.php Hoping there is a possible solution to this. Kind Regards and Thank You! Errors: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3) Timestamp: Wed, 6 Jun 2012 22:36:43 UTC Message: Object doesn't support this property or method Line: 5653 Char: 9 Code: 0 URI: http://foscam-uk.com/js/prototype/prototype.js Message: Object doesn't support this property or method Line: 5988 Char: 5 Code: 0 URI: http://foscam-uk.com/js/prototype/prototype.js Message: Object doesn't support this property or method Line: 2 Char: 5 Code: 0 URI: http://foscam-uk.com/skin/frontend/default/theme316/js/scripts.js Message: Object doesn't support this property or method Line: 5736 Char: 7 Code: 0 URI: http://foscam-uk.com/js/prototype/prototype.js Message: Object doesn't support this property or method Line: 5988 Char: 5 Code: 0 URI: http://foscam-uk.com/js/prototype/prototype.js Message: Object doesn't support this property or method Line: 73 Char: 11 Code: 0 URI: http://foscam-uk.com/index.php

    Read the article

  • How to fine tune FluentNHibernate's auto mapper?

    - by Venemo
    Okay, so yesterday I managed to get the latest trunk builds of NHibernate and FluentNHibernate to work with my latest little project. (I'm working on a bug tracking application.) I created a nice data access layer using the Repository pattern. I decided that my entities are nothing special, and also that with the current maturity of ORMs, I don't want to hand-craft the database. So, I chose to use FluentNHibernate's auto mapping feature with NHibernate's "hbm2ddl.auto" property set to "create". It really works like a charm. I put the NHibernate configuration in my app domain's config file, set it up, and started playing with it. (For the time being, I created some unit tests only.) It created all tables in the database, and everything I need for it. It even mapped my many-to-many relationships correctly. However, there are a few small glitches: All of the columns created in the DB allow null. I understand that it can't predict which properties should allow null and which shouldn't, but at least I'd like to tell it that it should allow null only for those types for which null makes sense in .NET (eg. non-nullable value types shouldn't allow null). All of the nvarchar and varbinary columns it created, have a default length of 255. I would prefer to have them on max instead of that. Is there a way to tell the auto mapper about the two simple rules above? If the answer is no, will it work correctly if I modify the tables it created? (So, if I set some columns not to allow null, and change the allowed length for some other, will it correctly work with them?) EDIT: I managed to achieve the above by using Fluent NHibernate's convention API. Thanks to everyone who helped! However, there is one more thing: after checking out the convention API, I really would like my IDs to be calld "ID", not "Id", but it seems to me that the PrimaryKey.Name.Is(x => "ID") is not working at all. If I add it to the conventions collection and rewrite my entities' properties to "ID" instead of "Id", it throws an exception that there is no primary key mapped. Any thoughts on this?

    Read the article

  • Chrome not sending POST requests on localhost, Firefox works fine

    - by AP257
    I have copied the simple Django forms example exactly, running on localhost. The basic contact form example should submit a POST request when you click the Submit button. I'm running Chrome on Mac Snow Leopard, and whenever I submit the form, the page simply reloads with an empty form: I can see from the runserver output that it's not sending a POST - instead it's sending a GET request. If I open the same page in Firefox on Mac Snow Leopard, and submit the form, I can see it's sending a POST request (as it should be). Looking at the source in Chrome, the form definitely says method="post". <form action="/contact/" method="post"> <p><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" /></p> <p><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" /></p> <p><label for="id_sender">Sender:</label> <input type="text" name="sender" id="id_sender" /></p> <p><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself" /></p> <input type="submit" value="Submit" /> </form> External sites with POST forms seem to work OK in Chrome. In addition, if I fill the form in incorrectly, in Chrome the page just reloads, with a GET request, as before; in Firefox the form gets validated, as it should. I've tried with other POST forms on localhost and got the same result. I know Chrome for Mac has its quirks, but what on earth is going on?

    Read the article

  • Applying fine-grained security to an existing application

    - by Mark
    I've inherited a reasonably large and complex ASP.NET MVC3 web application using EF Code First on SQL Server. It uses ASP.NET Membership roles with database authentication. The controller actions are secured with attributes derived from AuthorizeAttribute that map roles to actions. There are extension methods for the finer points, such as showing a particular widget to particular roles. This is works great and I have a good understanding of the current security model. I've been asked to provide finer grained security at the data level. For example a 'Customer' user can only see data (throughout the database) associated with themselves and not other Customers. The problem is that 'Customer' is only 1 of 5 different types with their own specific restrictions (each of the 9 roles is one of these 5 types). The best thing I can think of is to go through all the data repositories and extend each and every LINQ statements/query with a filter for every user type. Even if I had time for that it doesn't seem like the most elegant way. Any suggestions? I really don't know where to start with this so anything could be helpful. Many thanks.

    Read the article

  • jQuery is not defined on my staging server but works fine on my local

    - by Tony
    If you pop open this page with your javascript console, you'll notice a bunch of JS errors. I don't get these errors in my local environment and it seems like it is happening because $ is not defined. I have tried to mimic my local environment exactly on staging by using the same environment.rb file and removing all JS caching but it is making no difference. Can anyone tell why jQuery is crapping out? It might be something really stupid, but I need a second pair of eyes.

    Read the article

  • How to control dojo widget classes, or how to get fine-grained control of style

    - by djna
    I am creating a UI with dojo that is emulting some aspects of an existing thick client application. I need to programatically put two different menu bars on the same page. I have successfully created the two menu bars using new dijit.Menu(); new dijit.MenuItem(); and so on. Now I want to give them slightly different presentation styles. As I'm going to have quite a few pages of this sort my first thought is to use different CSS style classes. And that's the problem: when I create the Menu and it's items we get quite a set of HTML objects, each with CSS classes specified by dojo, and the classes are the same for the items associated with either menu. How can I best get specific control for any one menu? I could determine the dojo-generated ids for each item, and specify styles by ids, but that seems like hard work. Is there an sensible way to control the classes defined by dojo, or a nice CSS way to select only the items associated with one menu bar?

    Read the article

  • ASP.NEt MVC 2 application error on IIS7 works fine on local machine

    - by aspCoolguy
    My ASP.NET MVC2 application is developed using 1. VS 2010 2. Linq To SQL for Models Here is Call controller code: namespace CallTrackMVC.Controllers { public class CallController : Controller { private CallTrackRepository repository; public CallController():this(new CallTrackRepository()) { } public CallController(CallTrackRepository newRepository) { repository = newRepository; } } } Error on IIS7 when browsing the Call Create page is NullReferenceException: Object reference not set to an instance of an object.] CallTrackMVC.Models.ExecOfficeDataContext..ctor() in C:\ClearCase\rartadi_view\STS_Dev_TEST\CallTrackMVC\Models\ExecOffice.designer.cs:71 CallTrackMVC.Controllers.CallController..ctor() in C:\ClearCase\rartadi_view\STS_Dev_TEST\CallTrackMVC\Controllers\CallController.cs:16 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +117 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +247 System.Activator.CreateInstance(Type type, Boolean nonPublic) +106 System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +102 [InvalidOperationException: **An error occurred when trying to create a controller of type 'CallTrackMVC.Controllers.CallController'. Make sure that the controller has a parameterless public constructor.**] System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +541 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +85 System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +165 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +80 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +389 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371 Code in Global.asax is protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); } Any suggestion would be a great help.

    Read the article

  • Firefox 3.5.9 pushes down input:text when all other browsers render it fine

    - by Ad Taylor
    Hi, I have run into a really odd bug with FF3.5.9 (and potentially lower) where it is moving the input:text below the input:submit. The strangest thing with this is that it is working on IE6/7/8, Chrome, Safari and Firefox 3.6. Here is a test page so you can see how it is marked up: http://paste-it.net/public/s6479e6/ I can fix the issue for FF3.5.9 by adding padding-bottom (15px) but this then puts the other browsers out of action. Has anyone else had a similar issue and found a fix? Seems like such a minor issue but I just can't find a fix for it and I am not really into having to absolute position the inputs as that seems too hacky! Thanks for your time, Ad

    Read the article

  • Magento: Attribute always returns default value in catalog view, works fine in product view

    - by colinodell
    I've created a new Yes/No attribute for products. I've extended the Product model to do some custom logic and the custom functions are working everywhere. When I initially tried getting the custom attribute value, I ran into some issue. Magento wasn't loading it for me, so calls to $product-getMyAttributeName() did nothing. In the product views, I got it working with this additional function: public function getAttrVal($attr_name) { return $this->getResource()->getAttribute($attr_name)->getFrontend()->getValue($this); } So that worked great when viewing a product on the frontend. It would fetch the assigned value if set, or the default if not. When I view any Category (grid of all products in that category), the same exact code is being executed. But my getAttrVal() function always returns the default value, even if I've explicitly set this value for my product. I can't, for the life of me, figure out why the attribute loads correctly in the Product view but the Category view always grabs the default value, despite running the same exact code. Any thoughts?

    Read the article

  • jquery mouse events masked by img in IE8 - all other platforms/browsers work fine

    - by Bruce
    Using the jQuery mouse events for mouseenter, mouseleave or hover all work swimmingly on all Mac or Windows browsers except for IE8/Windows. I am using mouseenter and mouseleave to test for hot rectangles (absolutely positioned and dimensioned divs that have no content) over an image used as hotspots to make visible the navigation buttons when different regions of the main enclosing rectangle (image) are touched by the cursor. Windows/IE jQuery never sends notifications (mouseenter our mouseleave) as the cursor enters or exits one of the target divs. If I turn off the visibility of the image everything works as expected (like it does in every other browser), so the image is effectively blocking all messages (the intention was for the image to be a background and all the divs float above it, where they can be clicked on). I understand that there's a z-index gotcha (so explicitly specifying z-index for each absolute positioned div does not work), but unclear as to how to nest or order multiple divs to allow a single set of jQuery rules to support all browsers. The image tag seems to trump all other divs and always appear in front of them... BTW: I could not use i m g as a tag in this text so it is spelled image in the following, so the input editor does not think that I am trying to pull a fast one on stackoverflow... How used? "mainview" is the background image, "zoneleft" and "zoneright" are the active areas where when the cursor enters the nav buttons "leftarrow" and rightarrow" are supposed to appear. Javascript $("div#zoneleft").bind("mouseenter",function () // enters left zone see left arrow { arrowVisibility("left"); document.getElementById("leftarrow").style.display="block"; }).bind("mouseleave",function () { document.getElementById("leftarrow").style.visibility="hidden"; document.getElementById("rightarrow").style.visibility="hidden"; }); HTML <div id="zoneleft" style="position:absolute; top:44px; left:0px; width:355px; height:372px; z-index:40;"> <div id="leftarrow" style="position:absolute; top:158px; left:0px; z-index:50;"><img src="images/newleft.png" width="59" height="56"/></div></div> <div id="zoneright" style="position:absolute; top:44px; left:355px; width:355px; height:372px; z-index:40;"> <div id="rightarrow" style="position:absolute; top:158px; left:296px; z-index:50;"> (tag named changed so that I could include it here) <image src="images/newright.png" width="59" height="56" /></div></div> </div><!-- navbuttons --> <image id="mainview" style="z-index:-1;" src="images/projectPhotos/photo1.jpg" width:710px; height:372px; /> (tag named changed so that I could include it here) </div><!--photo-->

    Read the article

  • RegQueryValueEx not working with a Release version but working fine with Debug

    - by Nux
    Hi. I'm trying to read some ODBC details form a registry and for that I use RegQueryValueEx. The problem is when I compile the release version it simply cannot read any registry values. The code is: CString odbcFuns::getOpenedKeyRegValue(HKEY hKey, CString valName) { CString retStr; char *strTmp = (char*)malloc(MAX_DSN_STR_LENGTH * sizeof(char)); memset(strTmp, 0, MAX_DSN_STR_LENGTH); DWORD cbData; long rret = RegQueryValueEx(hKey, valName, NULL, NULL, (LPBYTE)strTmp, &cbData); if (rret != ERROR_SUCCESS) { free(strTmp); return CString("?"); } strTmp[cbData] = '\0'; retStr.Format(_T("%s"), strTmp); free(strTmp); return retStr; } I've found a workaround for this - I disabled Optimization (/Od), but it seems strange that I needed to do that. Is there some other way? I use Visual Studio 2005. Maybe it's a bug in VS? Almost forgot - the error code is 2 (as the key wouldn't be found).

    Read the article

  • function working fine in IE but the same funtion is not working for mozilla 3.6

    - by anand-juventus
    function VisibleDiv(obj) { if (obj == BaseLog) { var objStyle = document.getElementById('DivCalls').style; if (objStyle.display == "block") objStyle.display = "none"; else objStyle.display = "block"; } else if (obj == ViewReports) { var objStyle = document.getElementById('DivReports').style; if (objStyle.display == "block") objStyle.display = "none"; else objStyle.display = "block"; } else if (obj ==Management) { var objStyle = document.getElementById('DivManage').style; if (objStyle.display == "block") objStyle.display = "none"; else objStyle.display = "block"; } <a href="#" id="BaseLog" class="TextHeader" onclick="VisibleDiv(this)">Base Log </a> in the above code is working in IE but not working in mozilla 3.6. I have checked that obj==BaseLog is not working in the above code. I have tried many options like event.srcelement window.event.srcelement but all in vain. when I debug the code ,I found that obj is having complete value for IE but the same obj is having all the names .ie. the name of tag,id and class for "Base Log" seperated by #. i.e a#BaseLog#TextHeader# Please suggest what shoud I do?

    Read the article

  • jquery.ui.tabs.js doesn't load tab data in IE9, Chrome - works perfectly fine in firefox

    - by Salma Khan
    I have few issues that I am facing on my site and I have no idea how to fix those. Please go to http://link.zambeel.ca/index.php/component/obituary/detail/52 and click on Photos tab, it doesn't load images promptly in IE9 and Chrome. I have made it work in firefox with the following code: var loadNextTab = function() { if (indexesToLoad.length == 0) return; var index = indexesToLoad.shift(); $("#tabs-1").tabs("load",index); }; $("#tabs-1").tabs({ cache: true, load: loadNextTab }); Please help me resolve this matter as soon as possible. Just to let you guys know, I am not a programmer by any means.

    Read the article

  • Tiny MCE (jquery plugin version) not showing toolbar in IE (works fine in other browsers)

    - by I am Wonder
    I had an implementation working well but for some reason IE decided it was tired of playing nice. I have an advanced implementation of TinyMCE (the jquery plugin version - see http://tinymce.moxiecode.com/examples/example_23.php for details). It still works great in all browsers but IE. In IE it shows the drop-down options for Format, Font family, and Font size, but only as text.. not as a drop down normally looks. All other buttons on the toolbar are missing. (I've tried IE8 and IE8 Compatibility Mode) I get a javascript error: Syntax error Line 36 Char 1. Unfortunately the javascript is being loaded dynamically so this doesn't help me. Here is my implementation code for the TinyMCE editor: $(function () { $('#InputStuffHere').tinymce({ // General options theme: "advanced", plugins: "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,inlinepopups,preview,media,searchreplace,contextmenu,paste,fullscreen,noneditable,visualchars,nonbreaking,template", // Theme options theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect,|,hr,removeformat", theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,image,|,forecolor,backcolor,|,spellchecker", theme_advanced_buttons3 : "", theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_statusbar_location: "bottom", theme_advanced_resizing: true, // Drop lists for link/image/media/template dialogs template_external_list_url: "lists/template_list.js", external_link_list_url: "lists/link_list.js", external_image_list_url: "lists/image_list.js", media_external_list_url: "lists/media_list.js", //initialization callback init_instance_callback: "TinyMCEReady", add_form_submit_trigger : false }); }); So... anyone seen anything like this or have any ideas for me? Thank you so much everyone!

    Read the article

  • Computer/Application having trouble and getting slow while accessing Sql server through LAN, Network is fine

    - by user614297
    Hi, I have an web project in asp.net in one of my computers which are connected internally through LAN. The database is in Sql Server kept in another computer. The LAN is connected well. There is no connection error in my programming also. But sometimes in this particular system the page is taking long time to be open, sometime it is showing some exceptions(not everytime again and again). What can be the problem? How can it be solved? The same project is running good in other computers as well. My network seems ok, as I can acccess the computer hosting SQL server.

    Read the article

  • method works fine, until it is called in a function, then UnboundLocalError

    - by user1776100
    I define a method called dist, to calculate the distance between two points which I does it correctly when directly using the method. However, when I get a function to call it to calculate the distance between two points, I get UnboundLocalError: local variable 'minkowski_distance' referenced before assignment edit sorry, I just realised, this function does work. However I have another method calling it that doesn't. I put the last method at the bottom This is the method: class MinkowskiDistance(Distance): def __init__(self, dist_funct_name_str = 'Minkowski distance', p=2): self.p = p def dist(self, obj_a, obj_b): distance_to_power_p=0 p=self.p for i in range(len(obj_a)): distance_to_power_p += abs((obj_a[i]-obj_b[i]))**(p) minkowski_distance = (distance_to_power_p)**(1/p) return minkowski_distance and this is the function: (it basically splits the tuples x and y into their number and string components and calculates the distance between the numeric part of x and y and then the distance between the string parts, then adds them. def total_dist(x, y, p=2, q=2): jacard = QGramDistance(q=q) minkowski = MinkowskiDistance(p=p) x_num = [] x_str = [] y_num = [] y_str = [] #I am spliting each vector into its numerical parts and its string parts so that the distances #of each part can be found, then summed together. for i in range(len(x)): if type(x[i]) == float or type(x[i]) == int: x_num.append(x[i]) y_num.append(y[i]) else: x_str.append(x[i]) y_str.append(y[i]) num_dist = minkowski.dist(x_num,y_num) str_dist = I find using some more steps #I am simply adding the two types of distance to get the total distance: return num_dist + str_dist class NearestNeighbourClustering(Clustering): def __init__(self, data_file, clust_algo_name_str='', strip_header = "no", remove = -1): self.data_file= data_file self.header_strip = strip_header self.remove_column = remove def run_clustering(self, max_dist, p=2, q=2): K = {} #dictionary of clusters data_points = self.read_data_file() K[0]=[data_points[0]] k=0 #I added the first point in the data to the 0th cluster #k = number of clusters minus 1 n = len(data_points) for i in range(1,n): data_point_in_a_cluster = "no" for c in range(k+1): distances_from_i = [total_dist(data_points[i],K[c][j], p=p, q=q) for j in range(len(K[c]))] d = min(distances_from_i) if d <= max_dist: K[c].append(data_points[i]) data_point_in_a_cluster = "yes" if data_point_in_a_cluster == "no": k += 1 K[k]=[data_points[i]] return K

    Read the article

  • This code works fine in Chrome, Firefox but not in IE.

    - by Jeddizero
    Hi, I'm trying to make a jquery tooltip that appears when a user mouses over a link. In my case the link is using display:block style so that it covers a large area. It works perfectly in Chrome and Firefox but in Internet Explorer it doesn't work at all. The tooltip doesn't show, the browsers own tooltip shows etc... IE!!!! http://pastebin.com/1kBaMujV Any ideas? Got to love internet explorer...

    Read the article

  • Xubuntu 12.4 upgraded fine but there are everywhere pale grey windows/menus with white fonts!

    - by Costa
    I upgraded to Xubuntu 12.4 through the update manager. Everything works fine except that many windows and menus (Ubuntu Software Center,Transmission properties etc) apear in pale grey with white fonts. For examle, it's impossible to read n change properties on Transmission. Titles apear excellently, the rest is really hard to read: white text on allmost white background ... I have tried already:rebooting, changing theme/apearance photo1 http://en.zimagez.com/zimage/-26042012-102025.php When login as guest everything works fine. I created a new account, all is fine photo2 http://en.zimagez.com/zimage/-26042012-103258.php But I still want my initiall user-account which i had so well tuned...

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >