Daily Archives

Articles indexed Wednesday April 7 2010

Page 25/131 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Linear Regression and Java Dates

    - by Smithers
    I am trying to find the linear trend line for a set of data. The set contains pairs of dates (x values) and scores (y values). I am using a version of this code as the basis of my algorithm. The results I am getting are off by a few orders of magnitude. I assume that there is some problem with round off error or overflow because I am using Date's getTime method which gives you a huge number of milliseconds. Does anyone have a suggestion on how to minimize the errors and compute the correct results?

    Read the article

  • port allocation in remoting

    - by user158182
    in remoting is it possible to connect a particular port(client) to a remote server, i can specify the server port,is there any posibilitis to specify a client port example if server runs in x machine and server port is 8085 and client runs in y where itconnects the server exactly with the specified port ,but the client is connected using a random port(can ispecify a client port),ican do it in basic sockets

    Read the article

  • Does removing admin rights really mitigate 90% of Critical Windows 7 vulnerabilities found to date?

    - by Jordan Weinstein
    Beyondtrust.com published a report, somewhat recently, claiming among other quite compelling things, "90% of Critical Microsoft Windows 7 Vulnerabilities are Mitigated by Eliminating Admin Rights" Other interesting 'facts' they provide say that these are also mitigated by NOT running as a local admin: 100% of Microsoft Office vulnerabilities reported in 2009 94% of Internet Explorer and 100% of IE 8 vulnerabilities reported in 2009 BUT, reading the first page or so of the report I saw this line: A vulnerability is considered mitigated by removing administrator rights if the following sentence is located in the Security Bulletin’s Mitigating Factors section, ?Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights. could be sounds pretty weak to me so and I wondered how valid all this really is. I'm NOT trying to say it's not safer to run without admin rights, I think that is well known. I just wonder if these stats are something you would use as ammo in an argument, or use to sell a change like that (removing users as local admins) to business side? Thoughts? Link to the report (pdf) [should this supposed to be a community wiki?]

    Read the article

  • Ruby Abstract Class Design

    - by MattDiPasquale
    I'm creating a video game. It has Characters & Items. Since I want Characters & Items to each have a name, should I make another class called NamedObjects with just a name field and have Characters & Items extend that? Or is that going overboard?

    Read the article

  • How does one search/poll all modal info in a frame automatically?

    - by user310631
    As you'll no-doubt be able to tell momentarily, I have little knowledge of the programming world. That being said, here goes.... In this scenario, there's a Java-based game that has a map of the game world oriented in an X, Y coordinate tile system. Some of the grid tiles are player cities, some are non-player locations. The game runs inside a frame in the browser, the X, Y coordinate map feature is one optional view, and the entire map is not available to view at any one time. Each grid tile has an "Onclick" event and an "Onmouseover" event. The mouseover event is a tooltip, the click event is something called a "modal" that has information specific to that tile. What I'd like to find out is: How can I poll all the grid tiles' "modal" information using some kind of script or other auto-running polling feature?

    Read the article

  • Changing the style of a Combo-Box in WPF (in Blend preferably)

    - by George Sealy
    I'm having some issues trying to change the look / style of a combo box in Expression Blend / WPF. While there are tutorials out there describing setting styles for buttons, there seem to be a few wrinkles with ComboBox controls. Can anyone offer any advice, or point me towards good tutorials that cover re-styling something more complex than a button?

    Read the article

  • Good suggestions for learning OOP PHP

    - by Doug
    I've been trying to learn PHP OOP and have looked at multiple articles, but have yet to find a good resource for learning. I want to learn from the user of setters and getters, $this-, constructors, and so on...! Can anyone please suggest me something? I noticed MOST teachings leave out the explanation of $this-. I want to learn magic methods, decorators, encapsulation, etc... Feel free to suggest something that I haven't explicitly listed.

    Read the article

  • Scipy Negative Distance? What?

    - by disappearedng
    I have a input file which are all floating point numbers to 4 decimal place. i.e. 13359 0.0000 0.0000 0.0001 0.0001 0.0002` 0.0003 0.0007 ... (the first is the id). My class uses the loadVectorsFromFile method which multiplies it by 10000 and then int() these numbers. On top of that, I also loop through each vector to ensure that there are no negative values inside. However, when I perform _hclustering, I am continually seeing the error, "Linkage Z contains negative values". I seriously think this is a bug because: I checked my values, the values are no where small enough or big enough to approach the limits of the floating point numbers and the formula that I used to derive the values in the file uses absolute value (my input is DEFINITELY right). Can someone enligten me as to why I am seeing this weird error? What is going on that is causing this negative distance error? ===== def loadVectorsFromFile(self, limit, loc, assertAllPositive=True, inflate=True): """Inflate to prevent "negative" distance, we use 4 decimal points, so *10000 """ vectors = {} self.winfo("Each vector is set to have %d limit in length" % limit) with open( loc ) as inf: for line in filter(None, inf.read().split('\n')): l = line.split('\t') if limit: scores = map(float, l[1:limit+1]) else: scores = map(float, l[1:]) if inflate: vectors[ l[0]] = map( lambda x: int(x*10000), scores) #int might save space else: vectors[ l[0]] = scores if assertAllPositive: #Assert that it has no negative value for dirID, l in vectors.iteritems(): if reduce(operator.or_, map( lambda x: x < 0, l)): self.werror( "Vector %s has negative values!" % dirID) return vectors def main( self, inputDir, outputDir, limit=0, inFname="data.vectors.all", mappingFname='all.id.features.group.intermediate'): """ Loads vector from a file and start clustering INPUT vectors is { featureID: tfidfVector (list), } """ IDFeatureDic = loadIdFeatureGroupDicFromIntermediate( pjoin(self.configDir, mappingFname)) if not os.path.exists(outputDir): os.makedirs(outputDir) vectors = self.loadVectorsFromFile( limit, pjoin( inputDir, inFname)) for threshold in map( lambda x:float(x)/30, range(20,30)): clusters = self._hclustering(threshold, vectors) if clusters: outputLoc = pjoin(outputDir, "threshold.%s.result" % str(threshold)) with open(outputLoc, 'w') as outf: for clusterNo, cluster in clusters.iteritems(): outf.write('%s\n' % str(clusterNo)) for featureID in cluster: feature, group = IDFeatureDic[featureID] outline = "%s\t%s\n" % (feature, group) outf.write(outline.encode('utf-8')) outf.write("\n") else: continue def _hclustering(self, threshold, vectors): """function which you should call to vary the threshold vectors: { featureID: [ tfidf scores, tfidf score, .. ] """ clusters = defaultdict(list) if len(vectors) > 1: try: results = hierarchy.fclusterdata( vectors.values(), threshold, metric='cosine') except ValueError, e: self.werror("_hclustering: %s" % str(e)) return False for i, featureID in enumerate( vectors.keys()):

    Read the article

  • Jquery - dynamic DIV onclick binding

    - by Murtaza RC
    I have a main page from where I am making a call to "load" and intermediate page's HTML and on the completion of the load I am massaging the returned HTML to add a few DIVs etc, when I try to bind an onclick event for the dynamic Divs (added by me after the HTML returned from the intermediate page) it does not seem to work at all !: LOAD : $j(".loader").load(myURLtoIntermediatePage, '', function() { var HTML= '<div id="abcd">test</div>'; ... $j(".pageDIV").append(HTML); } DOCUMENT READY Function $j(document).ready(function() { $j('#abcd').onclick(function() { alert($j(this)); }); });

    Read the article

  • Applying to a international programming jobs

    - by Shawn Mclean
    If this question is not suited at stackoverflow, could you tell me in comments and suggest a site that I can ask this question and I'll close this. I'm located in Jamaica and in my final semester of a bsc computer science degree. I would like to apply to programming jobs abroad. How do I go about this? What is the sequence to follow and documents needed? Thanks.

    Read the article

  • Appending data to NSFetchedResultsController during find or create loop

    - by Justin Williams
    I have a table view that is managed by an NSFetchedResultsController. I am having an issue with a find-or-create operation, however. When the user hits the bottom of my table view, I am querying my server for another batch of content. If it doesn't exist in the local cache, we create it and store it. If it does exist, however, I want to append that data to the fetched results controller and display it. I can't quite figure that part out. Here's what I'm doing thus far: Passing the returned array of values from my server to an NSOperation to process. In the operation, create a new managed object context to work with. In the operation, I iterate through the array and execute a fetch request to see if the object exists (based on its server id). If the object doesn't exist, we create it and insert it into the operations' managed object context. After the iteration completes, we save the managed object context, which triggers a merge notification on my main thread. At this point, any objects that weren't locally cached in my Core Data store before will appear, but the ones that previously existed do not come along for the ride. I feel like it's something simple I'm missing, and could use a nudge in the right direction.

    Read the article

  • Handling close-to-impossible collisions on should-be-unique values

    - by balpha
    There are many systems that depend on the uniqueness of some particular value. Anything that uses GUIDs comes to mind (eg. the Windows registry or other databases), but also things that create a hash from an object to identify it and thus need this hash to be unique. A hash table usually doesn't mind if two objects have the same hash because the hashing is just used to break down the objects into categories, so that on lookup, not all objects in the table, but only those objects in the same category (bucket) have to be compared for identity to the searched object. Other implementations however (seem to) depend on the uniqueness. My example (that's what lead me to asking this) is Mercurial's revision IDs. An entry on the Mercurial mailing list correctly states The odds of the changeset hash colliding by accident in your first billion commits is basically zero. But we will notice if it happens. And you'll get to be famous as the guy who broke SHA1 by accident. But even the tiniest probability doesn't mean impossible. Now, I don't want an explanation of why it's totally okay to rely on the uniqueness (this has been discussed here for example). This is very clear to me. Rather, I'd like to know (maybe by means of examples from your own work): Are there any best practices as to covering these improbable cases anyway? Should they be ignored, because it's more likely that particularly strong solar winds lead to faulty hard disk reads? Should they at least be tested for, if only to fail with a "I give up, you have done the impossible" message to the user? Or should even these cases get handled gracefully? For me, especially the following are interesting, although they are somewhat touchy-feely: If you don't handle these cases, what do you do against gut feelings that don't listen to probabilities? If you do handle them, how do you justify this work (to yourself and others), considering there are more probable cases you don't handle, like a supernonva?

    Read the article

  • how to add classes to build path in eclipse

    - by akshay
    I have used the folllowing steps to add classes to my build path still i am geting errors as import not resolved.I had followed the following steps. Select Create New Folder and name it TpmWebUIClasses. Click the Advanced button and select the Link to folder in the file system check box. Browse for to the folder where you have copied the classes Make sure the selected folder is listed and then click OK. How can i resolve the error?

    Read the article

  • Getting a hardware profile from Fedora 12 after installation

    - by Chris T
    I've installed Fedora 12 on a computer I found in the trash (Bulk garbage day!) and I'm trying to figure out what's under the hood (seems like a stock dell but I'd like to know the details). Is there a way to get a hardware profile on Fedora after it's already installed on the harddrive? I saw an option at install but I skipped over it.

    Read the article

  • UIButton on UIScrollView can't work

    - by william-hu
    Hi, i used UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 180, 180)]; myLabel.backgroundColor = [UIColor greenColor]; [self.view addSubview:myLabel]; UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [self addTarget:self action:@selector(show) forControlEvents:UIControlEventTouchDown]; myButton.frame = CGRectMake(80.0, 120.0, 30, 30); myButton.showsTouchWhenHighlighted = YES; [self addSubview:myButton]; in this way the button works(call show:), but use [myLabel addSubview:myButton]; the button can't work. who can tell me why? I have tried to change the target to myLabel, can't work too.So who can tell me,thank you. By the way , i want to use the button on the UILabel,and the UILabel on UIScrollView.Thanks a lot!

    Read the article

  • Having issues with jquery ui datepicker and IE

    - by Howlingfish
    This works perfectly in Firefox but doesnt work in ie i get the following error "Line: 640 Error: Object doesn't support this property or method" Here is my code <asp:TextBox ID="calendardatedob" CssClass="calendardatedob" runat="server" AccessKey="n" TabIndex="4" MaxLength="40" /><span class="req">*</span> e.g dd/mm/yyyy Here is my jquery $(document).ready(function() { $("#ctl00_PageContent_calendardatedob").datepicker(); }); im referencing these > <script > src="../../assets/js/jquery.min.js" > type="text/javascript"></script> > <script > src="../../assets/js/jquery-ui-1.8.custom.min.js" > type="text/javascript"></script>

    Read the article

  • JSplitPane giving wrong resize cursor with GTK LAF?

    - by carneades
    Running the official JSplitPane demo http://java.sun.com/docs/books/tutorial/uiswing/components/splitpane.html on my Ubuntu system gives a resize cursor like -- over the divider. The behavior of native split panes gives <-- resize cursors. Does this qualify as a bug that should be reported to Sun (eh, Oracle)? Is there a workaround?

    Read the article

  • FileFinder using SQL

    - by James Morgan
    I was thinking of working on a project while I have some free time and this one looks pretty nice: http://mindprod.com/project/filefinder.html One thing I'm wondering about is that will it really be much faster compared to the regular windows search if I use SQL? I'm planning to use MySQL since it's open source. Also, do I need to be good at databases for this? I have basic knowledge about relational databases and can definitely make some SQL statements. Thanks.

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >