Search Results

Search found 911 results on 37 pages for 'jonathan reno'.

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

  • How do you uninstall old custom installs of Xcode?

    - by Jonathan
    Hi, When I install a beta, I do a custom install into a separate folder to the latest release version. I have several old beta installs. How do I uninstall the old custom versions of xcode? Can I just trash the folder? Our do I need to use Terminal? The release notes suggest to use this: $ sudo /Library/uninstall-devtools --mode=all But will this just uninstall my original official release version 3.2? Thanks.

    Read the article

  • How do I print out objects in an array in python?

    - by Jonathan
    I'm writing a code which performs a k-means clustering on a set of data. I'm actually using the code from a book called collective intelligence by O'Reilly. Everything works, but in his code he uses the command line and i want to write everything in notepad++. As a reference his line is >>>kclust=clusters.kcluster(data,k=10) >>>[rownames[r] for r in k[0]] Here is my code: from PIL import Image,ImageDraw def readfile(filename): lines=[line for line in file(filename)] # First line is the column titles colnames=lines[0].strip( ).split('\t')[1:] rownames=[] data=[] for line in lines[1:]: p=line.strip( ).split('\t') # First column in each row is the rowname rownames.append(p[0]) # The data for this row is the remainder of the row data.append([float(x) for x in p[1:]]) return rownames,colnames,data from math import sqrt def pearson(v1,v2): # Simple sums sum1=sum(v1) sum2=sum(v2) # Sums of the squares sum1Sq=sum([pow(v,2) for v in v1]) sum2Sq=sum([pow(v,2) for v in v2]) # Sum of the products pSum=sum([v1[i]*v2[i] for i in range(len(v1))]) # Calculate r (Pearson score) num=pSum-(sum1*sum2/len(v1)) den=sqrt((sum1Sq-pow(sum1,2)/len(v1))*(sum2Sq-pow(sum2,2)/len(v1))) if den==0: return 0 return 1.0-num/den class bicluster: def __init__(self,vec,left=None,right=None,distance=0.0,id=None): self.left=left self.right=right self.vec=vec self.id=id self.distance=distance def hcluster(rows,distance=pearson): distances={} currentclustid=-1 # Clusters are initially just the rows clust=[bicluster(rows[i],id=i) for i in range(len(rows))] while len(clust)>1: lowestpair=(0,1) closest=distance(clust[0].vec,clust[1].vec) # loop through every pair looking for the smallest distance for i in range(len(clust)): for j in range(i+1,len(clust)): # distances is the cache of distance calculations if (clust[i].id,clust[j].id) not in distances: distances[(clust[i].id,clust[j].id)]=distance(clust[i].vec,clust[j].vec) #print 'i' #print i #print #print 'j' #print j #print d=distances[(clust[i].id,clust[j].id)] if d<closest: closest=d lowestpair=(i,j) # calculate the average of the two clusters mergevec=[ (clust[lowestpair[0]].vec[i]+clust[lowestpair[1]].vec[i])/2.0 for i in range(len(clust[0].vec))] # create the new cluster newcluster=bicluster(mergevec,left=clust[lowestpair[0]], right=clust[lowestpair[1]], distance=closest,id=currentclustid) # cluster ids that weren't in the original set are negative currentclustid-=1 del clust[lowestpair[1]] del clust[lowestpair[0]] clust.append(newcluster) return clust[0] def kcluster(rows,distance=pearson,k=4): # Determine the minimum and maximum values for each point ranges=[(min([row[i] for row in rows]),max([row[i] for row in rows])) for i in range(len(rows[0]))] # Create k randomly placed centroids clusters=[[random.random( )*(ranges[i][1]-ranges[i][0])+ranges[i][0] for i in range(len(rows[0]))] for j in range(k)] lastmatches=None for t in range(100): print 'Iteration %d' % t bestmatches=[[] for i in range(k)] # Find which centroid is the closest for each row for j in range(len(rows)): row=rows[j] bestmatch=0 for i in range(k): d=distance(clusters[i],row) if d<distance(clusters[bestmatch],row): bestmatch=i bestmatches[bestmatch].append(j) # If the results are the same as last time, this is complete if bestmatches==lastmatches: break lastmatches=bestmatches # Move the centroids to the average of their members for i in range(k): avgs=[0.0]*len(rows[0]) if len(bestmatches[i])>0: for rowid in bestmatches[i]: for m in range(len(rows[rowid])): avgs[m]+=rows[rowid][m] for j in range(len(avgs)): avgs[j]/=len(bestmatches[i]) clusters[i]=avgs return bestmatches

    Read the article

  • ASP.NET Dates Deployment Issue

    - by Jonathan Stowell
    Hi guys, I recently bought some webspace with dailyrazor.com. I have deployed an application I have been working on to the server and am currently trying to workout the bugs but I can't seem to solve this one. I have set up my database in Visual Studio to use the one I have create with dailyrazor the same db the deployed version will use. I am using British Dates and on my localhost datetime is displayed: 27/05/2010 09:00 However on the dailyrazor host it is displayed: 5/27/2010 9:00 AM Short Dates e.g. 27/04/2010 display the same on both servers. This is causing some issues when entering data as errors occur on date fields. Any help would be appreciated. Thanks, Jon

    Read the article

  • require_once in php

    - by Jonathan
    I have a php file which has a require_once Statement (?) this file is then in included in 2 other php files, one php file is in a sub directory so the layout is like this ("file1" and "file2" include the file "included" which require_onces the "required")# L--subfolder1 | L--file1 L--subfolder2 | L--required L--file2 L--included How can I reference the "required" file from the "included" file so that it will work from both file1 and file2?

    Read the article

  • Our Flash Streaming Player Occasionally Stutters like a Skipping CD after a Period of Time

    - by Jonathan Fritz
    We offer a streaming player for a number of our clients, who are responsible for their providing us with their own audio streams. We have written a very simple flash player that can play all of the streams that we support (icecast/shoutcast/live365/mp3 over http/etc). Unfortunately, we have found that when listening, our player sometimes begins to stutter (like a skipping cd), sometimes after only 10 minutes, and sometimes after an hour of listening. We have noticed this behaviour in firefox on both linux and windows. Does anybody know anything about this problem? We know that flash isn't ideal for infinite streams of audio, but it's about all that we can find that's on every platform out there. If anybody can suggest a solution to our problem, I'll be your friend forever. Here is a link to the live player: http://cr-jf.jfritz.02.dev.wecreate.com/streaming/player_v5/ Note that you'll need to test in a browser that isn't IE, because we use WMP in IE, and that the JavaScript on the page will cause the player to unload and re-load once an hour because of memory issues. Because I can only put one hyperlink in a post, I'll add a link to the player source code as a comment. Thanks all!

    Read the article

  • PHP Arrays: Loop trough array with a lot of conditional statements. Help / Best practices

    - by Jonathan
    Hi, I have a problem I don't know how to get it to work the best way. I need to loop trough an array like the one below. I need to check if the [country] index is equal to a Spanish speaking country (lot of countries) and then get those [title] indexes of the correspondent country and check for duplicates. The original array: Array ( [0] => Array ( [title] => Jeux de pouvoir [country] => France ) [1] => Array ( [title] => Los secretos del poder [country] => Argentina ) [2] => Array ( [title] => Los secretos del poder [country] => Mexico ) [3] => Array ( [title] => El poder secreto [country] => Uruguay ) ) To help you understand, the final result I need to get looks something like this: Array ( [0] => Array ( [title] => Los secretos del poder [country] => Argetnina, Mexico ) [1] => Array ( [title] => El poder secreto [country] => Uruguay ) )

    Read the article

  • Mono - Uri class

    - by Jonathan.Peppers
    I am making an HttpWebRequest at a url similar to this: "http://mysite.com/search?query=my+search+string" Problem is, the Uri class escapes it with %, and the site I'm making the request against can't handle the escaped characters. (I have no control to fix the site) So tried this [Obsolete] constructor: new Uri(myUriString, true); But it did not seem to make any difference, when debugging, my Uri still got escaped. I am running this on a Mac with Mono, but I have not tried it on standard .Net on Windows to see if it has the same behavior. Is there another way to get around this issue?

    Read the article

  • Convert SelectedObjectCollection to Collection of Specific Type

    - by Jonathan Wood
    I have a WinForms multiselect listbox, and each item in the listbox is of type MyClass. I am also writing a method that needs to take a parameter that is a collection of MyClass. It could be of type MyClass[], List<MyClass>, IList<MyClass>, IEnumerable<MyClass>, etc. Any of those would work fine. Somehow, I need to pass the selected items in the listbox to my method. But how would I convert SelectedObjectCollection to any of the MyClass collection types described above?

    Read the article

  • How do I turn off a custom IValueConverter at design time?

    - by Jonathan Allen
    How do I turn off a custom IValueConverter at design time? Basically I want to write this: Public Class MethodBinder Implements IValueConverter Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert If [DESIGN_TIME] Then Return Nothing If value IsNot Nothing Then Return CallByName(value, CStr(parameter), CallType.Method) Return Nothing End Function Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack Throw New NotSupportedException End Function End Class

    Read the article

  • Are there other search options for heroku

    - by Jonathan
    I am about to launch a beta site, and heroku looks like a great option. The only think that is getting me down is that the only search option is $20/mth for the Websolr add-on. I am sure that Websolr is great, but at this very early point in this project, I rather not light up that expense. Are there any free search options to couple with heroku's Blossom (free) plan. I feel like such a cheapskate!

    Read the article

  • Why is there a seemingly identical copy of the JDK 1.5 core runtime in org.osgi.foundation-1.0.0.jar?

    - by Jonathan Neufeld
    I am maintaining a web application that depends on OSGi and Maven pulls-in a jar called org.osgi-foundation-1.0.0.jar that seems to contain the same classes as part of the JDK core runtime such as: java.util.*; java.io.*; etc. and so on. This seems very strange and I have to ask why this is necessary. More-over, my web-application fails to deploy on JBoss 6 because these are "illegal package names" for a third-party library. What is the purpose of org.osgi-foundation-1.0.0.jar ? is it necessary?

    Read the article

  • Problem with Python 3.1(syntax error). Im a beginner please help!

    - by Jonathan
    Hi there, im new to pragraming :) I got a problem with sytax error while making a guessing game. the problem is in (if Gender = boy or Boy), the equal(=) letter is a syntax error. Please help! Answer = 23 Guess = () Gender = input("Are you a boy, a girl or an alien? ") if Gender = boy or Boy: print("Nice!", Gender) if Gender = girl or Girl: print("Prepare do die!", Gender) if Gender = alien or Alien: print("AWESOME my", Gender, "Friend!") While Guess != Answer: if Guess < Answer: print("Too low! try again") else: print("too high!" print("Congratulations you guessed correct!", Gender, "Have fun!" Thank

    Read the article

  • WPF: ComboBox Max Items?

    - by Jonathan Allen
    What is the maximum number of items you can put in a WPF ComboBox before it starts suffering serious performance degration? (Assume bare-bones XP business-class computer.) What is the maximum number of items you can put in a WPF ComboBox before a typical user will start complaining?

    Read the article

  • What's the best way to clear the slate with your team

    - by Jonathan
    I work largely as an architect, and have developed a pretty big enterprise application based on SOA. Turns out my teamleader has been skilling up the indians behind my back even though I've been spending time and effort preparing a formal handover (to describe the design decisions and why). It just breeds lack of trust and sends the wrong message about the value of my work. Now I'm too furious to even talk to anyone. Do I sit in silence for the next 3 weeks waiting for my transfer?

    Read the article

  • PHP: Infinity loop and Time Limit!

    - by Jonathan
    Hi, I have a piece of code that fetches data by giving it an ID. If I give it an ID of 1230 for example, the code fetches an article data with an ID of 1230 from a web site (external) and insert it into a DB. Now, the problem is that I need to fetch all the articles, lets say from ID 00001 to 99999. If a do a 'for' loop, after 60 seconds the PHP internal time limit stops the loop. If a use some kind of header("Location: code.php?id=00001") or header("Location: code.php?id=".$ID) and increase $ID++ and then redirect to the same page the browser stops me because of the infinite loop or redirection problem. Please HELP!

    Read the article

  • Getting the DirectShow VideoRender filter to respond to MediaType changes on its Input Pin?

    - by Jonathan Websdale
    Below is the code extract from my decoder transform filter which takes in data from my source filter which is taking RTP network data from an IP camera. The source filter, decode filter can dynamically respond to changes in the camera image dimensions since I need to handle resolution changes in the decode library. I've used the 'ReceiveConnection' method as described in the DirectShow help, passing the new MediaType data in the next sample. However, I can't get the Video Mixing Renderer to accept the resolution changes dynamically even though the renderer will render the different resolution if the graph is stopped and restarted. Can anyone point out what I need to do to get the renderer to handle dynamic resolution changes? HRESULT CDecoder::Receive(IMediaSample* pIn) { //Input data does not necessarily correspond one-to-one //with output frames, so we must override Receive instead //of Transform. HRESULT hr = S_OK; //Deliver input to library long cBytes = pIn->GetActualDataLength(); BYTE* pSrc; pIn->GetPointer(&pSrc); try { hr = m_codec.Decode(pSrc, cBytes, (hr == S_OK)?&tStart : NULL); } catch (...) { hr = E_UNEXPECTED; } if (FAILED(hr)) { if (theLog.enabled()){theLog.strm() << "Decoder Error " << hex << hr << dec << " - resetting input"; theLog.write();} //Force reset of decoder m_bReset = true; m_codec.ResetInput(); //We have handled the error -- don't pass upstream or the source may stop. return S_OK; } //Extract and deliver any decoded frames hr = DeliverDecodedFrames(); return hr; } HRESULT CDecoder::DeliverDecodedFrames() { HRESULT hr = S_OK; for (;;) { DecodedFrame frame; bool bFrame = m_codec.GetDecodedFrame(frame); if (!bFrame) { break; } CMediaType mtIn; CMediaType mtOut; GetMediaType( PINDIR_INPUT, &mtIn); GetMediaType( PINDIR_OUTPUT, &mtOut); //Get the output pin's current image resolution VIDEOINFOHEADER* pvi = (VIDEOINFOHEADER*)mtOut.Format(); if( pvi->bmiHeader.biWidth != m_cxInput || pvi->bmiHeader.biHeight != m_cyInput) { HRESULT hr = GetPin(PINDIR_OUTPUT)->GetConnected()->ReceiveConnection(GetPin(PINDIR_OUTPUT), &mtIn); if(SUCCEEDED(hr)) { SetMediaType(PINDIR_OUTPUT, &mtIn); } } IMediaSamplePtr pOut; hr = m_pOutput->GetDeliveryBuffer(&pOut, 0, 0, NULL); if (FAILED(hr)) { break; } AM_MEDIA_TYPE* pmt; if (pOut->GetMediaType(&pmt) == S_OK) { CMediaType mt(*pmt); DeleteMediaType(pmt); SetMediaType(PINDIR_OUTPUT, &mt); pOut->SetMediaType(&mt); } // crop, tramslate and deliver BYTE* pDest; pOut->GetPointer(&pDest); m_pConverter->Convert(frame.Width(), frame.Height(), frame.GetY(), frame.GetU(), frame.GetV(), pDest); pOut->SetActualDataLength(m_pOutput->CurrentMediaType().GetSampleSize()); pOut->SetSyncPoint(true); if (frame.HasTimestamp()) { REFERENCE_TIME tStart = frame.Timestamp(); REFERENCE_TIME tStop = tStart+1; pOut->SetTime(&tStart, &tStop); } m_pOutput->Deliver(pOut); } return hr; }

    Read the article

  • jQuery .trigger() or $(window) not working in Google Chrome

    - by Jonathan
    I have this jQuery ajax navigation tabs plugin that I created using some help from CSS-Tricks.com and the jQuery hashchange event plugin (detects hash changes in browsers that don't support it). The code is little long to post it here but it goes something like this: Part 1) When a tab is clicked, it gets the href attribute of that tab and add it to the browsers navigation bar like '#tab_name': window.location.hash = $(this).attr("href"); Part 2) When the navigation bar changes (hash change), it gets the href change like this: window.location.hash.substring(1); (substring is to get only 'tab_name' without the '#'), and then call the ajax function to get the info to display. I want to automatically trigger the plugin to load the first tab when the page is accessed, so at the start of the code I put: if (window.location.hash === '') { // If no '#' is in the browser navigation bar window.location.hash = '#tab_1'; // Add #tab_1 to the navigation bar $(window).trigger('hashchange'); // Trigger a hashchange so 'Part 2' of the plugin calls the ajax function using the '#tab_1' added } The probles is that it works in FF but not in Chrome, I mean, everything works but it seems like the $(window).trigger('hashchange'); is not working because it doesnt get the first tab.. Any suggestions??

    Read the article

  • Javascript works great locally, but not on my server

    - by Jonathan Cohen
    I'm teaching myself javascript by creating a script for displaying an external rss feed on a webpage. The code I patched together works great locally. This is a screen grab of the code producing exactly the desired behavior. The code is populating all the information inside the section "Blog: Shades of Gray", except for "tagged" which I hard coded: But when I upload the site files to my server, the code doesn't work at all. This is a screen grab of the code on my site NOT producing the desired behavior... This feels like I'm not getting something really basic about how javascript works locally vs. on the server. I did my half hour of googling for an answer and no trails look promising. So I'd really appreciate your help. This is my site (under construction) http://jonathangcohen.com Below is the code, which can also be found at http://jonathangcohen.com/grabFeeds.js. /*Javascript for Displaying an External RSS Feed on a Webpage Wrote some code that’ll grab attributes from an rss feed and assign IDs for displaying on a webpage. The code references my Tumblr blog but it’ll extend to any RSS feed.*/ window.onload = writeRSS; function writeRSS(){ writeBlog(); } function writeBlog(){ if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","http://blog.jonathangcohen.com/rss.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; var x=xmlDoc.getElementsByTagName("item"); //append category to link for (i=0;i<3;i++) { if (i == 0){ //print category var blogTumblrCategory = x[i].getElementsByTagName("category")[0].childNodes[0].nodeValue document.getElementById("getBlogCategory1").innerHTML = '<a class="BlogTitleLinkStyle" href="http://blog.jonathangcohen.com/tagged/'+blogTumblrCategory+'">'+blogTumblrCategory+'</a>'; //print date var k = x[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue thisDate = new Date(); thisDate = formatTumblrDate(k); document.getElementById("getBlogPublishDate1").innerHTML = thisDate; //print title var blogTumblrTitle = x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue var blogTumblrLink = x[i].getElementsByTagName("link")[0].childNodes[0].nodeValue document.getElementById("getBlogTitle1").innerHTML = '<a class="BlogTitleLinkStyle" href="'+blogTumblrLink+'">'+blogTumblrTitle+'</a>'; } if (i == 1){ //print category var blogTumblrCategory = x[i].getElementsByTagName("category")[0].childNodes[0].nodeValue document.getElementById("getBlogCategory2").innerHTML = '<a class="BlogTitleLinkStyle" href="http://blog.jonathangcohen.com/tagged/'+blogTumblrCategory+'">'+blogTumblrCategory+'</a>'; //print date var k = x[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue thisDate = new Date(); thisDate = formatTumblrDate(k); document.getElementById("getBlogPublishDate2").innerHTML = thisDate; //print title var blogTumblrTitle = x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue var blogTumblrLink = x[i].getElementsByTagName("link")[0].childNodes[0].nodeValue document.getElementById("getBlogTitle2").innerHTML = '<a class="BlogTitleLinkStyle" href="'+blogTumblrLink+'">'+blogTumblrTitle+'</a>'; } if (i == 2){ //print category var blogTumblrCategory = x[i].getElementsByTagName("category")[0].childNodes[0].nodeValue document.getElementById("getBlogCategory3").innerHTML = '<a class="BlogTitleLinkStyle" href="http://blog.jonathangcohen.com/tagged/'+blogTumblrCategory+'">'+blogTumblrCategory+'</a>'; //print date var k = x[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue thisDate = new Date(); thisDate = formatTumblrDate(k); document.getElementById("getBlogPublishDate3").innerHTML = thisDate; //print title var blogTumblrTitle = x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue var blogTumblrLink = x[i].getElementsByTagName("link")[0].childNodes[0].nodeValue document.getElementById("getBlogTitle3").innerHTML = '<a class="BlogTitleLinkStyle" href="'+blogTumblrLink+'">'+blogTumblrTitle+'</a>'; } } } function formatTumblrDate(k){ d = new Date(k); var curr_date = d.getDate(); var curr_month = d.getMonth(); curr_month++; var curr_year = d.getFullYear(); printDate = (curr_month + "/" + curr_date + "/" + curr_year); return printDate; } Thank you!

    Read the article

  • Keeping php script seperate from UI

    - by Jonathan
    I have php scripts that do things like register, login, upload. I would like to keep the HTML in a seperate file so that say I make a desktop client I can just use the php files to do the login register etc. Basically to have say a front end, the HTML or desktop client and then only one backend, the php. Is that possible?

    Read the article

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