Daily Archives

Articles indexed Tuesday January 11 2011

Page 21/37 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • How to install opencv?

    - by Rick_2047
    Hello All, I am trying to learn image processing and obviously opencv is one of the best options. Usually synaptic does all my installing work for me so I just checked the repos. But in the repos there is only on libcv1 and it is listed as 1.0.0-6.2ubuntu1. Does that mean it is version 1.0 of opencv? Also I found this page in community wiki https://help.ubuntu.com/community/OpenCV It says I need to install libcv4 which is not in my repos. I also downloaded the source but it uses something called cmake, never used it before. Is it similar to make?

    Read the article

  • How do you install packetfence?

    - by BrNathan
    Was anyone able to install packetfence on Ubuntu 10? I tried a tutorial, but didn't have any luck. Some of the services installed and are working apache with php, snort, pfdetect, and pfdhcplistener. I can even get info from it, but for the life of me I can't get it to work with apache2. When I run pfcmd service pf start I also get an error uninitialized value $_[7] in join at /usr/local/pf/lib/pf/class.pm line 170

    Read the article

  • OpenOffice Calc: How can I count the number of different items with data pilot?

    - by manu
    Hi all, I have a rather long spreadsheet with historical information of issues solved by some user on a colaborative environment. The spreadsheet have the following (relevant) columns date, week no., project, author id, etc... The week no. is calculated from the date, is basically the year concatenated with the week number within that year; for instance, both 2009-02-18 and 2009-02-20 yield the week number 200908 - the 8th week of year 2009; and 2009-02-23 yields 200909 - the 9th week of year 2009. I need to count how many different users (given by author id) contributed to some project, on a weekly basis. I have setup a data pilot with the week as Row Field, the project as the Column Field, and count-author as the Data Field. However, this counts the author id as different instances. This is not what I need. I need to count how many different users contributed to each project on a weekly basis. I expect to get something like: projects week Project1 Project2 Project3 200901 10 2 200902 2 7 Each inner cell containing how many different users contributed. With the count-author configuration, what I get is how many contributions (total) got the project on that week. Is there a way to tell OpenOffice Calc to do what I want?

    Read the article

  • Network print to brother MFC-7420

    - by trampster
    I am trying to pint to a Brother MFC-7420 from my ubuntu 10.04 machine. The brother is attached to a windows XP machine and is shared. This is what I have tried: System-Administration-Printing, Add, Expand Network Printer, Windows Printer via SAMBA, Browse (I can find the printer no problems here), Foward, Choose Driver Dialog, Brother, My printer is not in this list So the next thing I tried was to download the printer driver from here http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html The driver installed fine but my printer still does not appear in the list. I also tried installing the cups wrapper but that gave the following error. Restarting Common Unix Printing System: cupsd [ OK ] cp: cannot stat `/usr/share/cups/model/MFC7420.ppd': No such file or directory dpkg: error processing cupswrappermfc7420 (--install): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: cupswrappermfc7420 I tried connecting the printer directly but even though I have installed the driver, when I go to printers and click on the printer (it shows up fine as a USB printer) then it say searching for drivers and then gives me a list, this is the same list as before which doesn't have my printer. It really shouldn't be this hard. on window you don't have to installing anything it just works and the same is true for my brothers Mac. How do I print to my printer?

    Read the article

  • align to the bottom of the div [closed]

    - by dole
    I need to arange the value and the lorem ipsum text to the bottom of the div as in the following image, but everything I've tryed until now doesn't work. My html looks like this: <div class="product"> <span class="title">Lorem Ipsum</span> <div class="values"> <span class="price">$29,225</span> <span class="description">Lorem ipsum dolor sit amet, consectetur ...</span> </div> </div>

    Read the article

  • Android App - XML or java

    - by Andrew Cochrane
    Hello - I am currently starting to create an app for a small charity company. But Im not entirely sure how to properly learn how to code for the Android OS. I have searched online for tutorials but most stop at the same stage and only show you how to launch the "helloWorld" app. My question is this: 1) Will using solely XML be sufficient to code an app? Does it require working in partnership with java? 2) Does anyone know of any books, recommended books of course, that break everything down for you step-by-step? Cheers

    Read the article

  • Forcing size of a complex Flash object.

    - by John
    As I've found recently, setting width/height properties on a Sprite only forces the Sprite to fit the given dimensions by scaling the actual size, which is calculated by Flash based on the rendered content. This leaves me confused. If I have a custom Sprite subclass which draws using Graphics, how can I do layout before an initial render - the size will be zero until it is first drawn? For a more complex issue, let's say I have a 2D game world with objects spread over a wide area with world coordinates from (0,0) to (5000,5000), where each object has a size of maybe up to 100x100. I want to have a Flash component which is the "game window", and has a fixed size like 400x300, rendering part of the game world. So how do I force the game window size to 400x300 pixels? I can draw a 400x300 rectangle to get the size correct but then if I draw any objects which are partly in-view, they can screw this up. Is the right approach to provide a custom setSize(w,h) method which is used rather than width & height setters? But even so, is there no way to make a Sprite force to the size I want? Do you really have to catch it every render and re-scale it?

    Read the article

  • Hide uiview, but not it's subview?

    - by Malene
    Hi! I have an app where i add ViewB as a subview to ViewA... But the background of ViewB is clearColor, which means that I can see ViewA through ViewB! If I set viewA to be hidden, ViewB goes away too! I am making a "flip-transition" between the views, so I can't just remove ViewA and then add ViewB :-/ -Anybody got an idea about what I can do? Here's my code: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:mainTableView cache:YES]; [mainTableView addSubview:subTableView]; [UIView commitAnimations];

    Read the article

  • How do you get 100% code coverage with guards in Haskell?

    - by dan_waterworth
    I'm trying to get (and prove) 100% test coverage for some code I'm writing in Haskell using HPC. However if I write something like this: fac n | n > 0 = n * (fac (n - 1)) | otherwise = 1 Then the second expression of the guard statement has always True tagged to it. What is the easiest way to overcome this in the general case? edit: Just to clarify. This code: fac n = if n > 0 then n * (fac (n - 1)) else 1 Works fine with HPC, (running it gives 100% code coverage). I'm basically suffering from this problem: http://hackage.haskell.org/trac/ghc/ticket/3175

    Read the article

  • Using Maven with Sourceforge.net

    - by mjn
    For a new project which uses Maven I would like to add distributionManagement configuration in the pom.xml which will connect the project with the Sourceforge.net file upload system. I have found this information (of 2007), is it still valid or do you know updated resources? http://docs.codehaus.org/display/MAVENUSER/MavenAndSourceforge Related question: How can I deploy artifacts from a Maven build to the SourceForge File Release System?

    Read the article

  • Py_INCREF/DECREF: When

    - by Izz ad-Din Ruhulessin
    Is one correct in stating the following: If a Python object is created in a C function, but the function doesn't return it, no INCREF is needed, but a DECREF is. [false]If the function does return it, you do need to INCREF, in the function that receives the return value.[/false] When assigning C typed variables as attributes, like double, int etc., to the Python object, no INCREF or DECREF is needed. Assigning Python objects as attributes to your other Python objects goes like this: PyObject *foo; foo = bar // A Python object tmp = self->foo; Py_INCREF(foo); self->foo = foo; Py_XDECREF(tmp); //taken from the manual, but it is unclear if this works in every situation EDIT: -- can I safely use this in every situation? (haven't run into one where it caused me problems) dealloc of a Python object needs to DECREF for every other Python object that it has as an attribute, but not for attributes that are C types. Edit With 'C type as an attribute I mean bar and baz: typedef struct { PyObject_HEAD PyObject *foo; int bar; double baz; } FooBarBaz;

    Read the article

  • With google maps, can you use google's own popup windows?

    - by SLC
    I've implemented a google map with points and stuff that uses an address that the user inputs. When you click a point, the popup bubble appears with the name and address in. Often this name and address is a prominent location, as it's used for meetings and things, such as a university. If you google the address yourself on maps.google.co.uk then you get google's own popup bubble, which often has a photo, information, opening hours, links to directions, reviews, etc. etc. I am wondering if there's a way to use that popup dialog instead of my own, where it is available. I can't see anything in the API to do this. I'm using V2 as we support IE6 in a lot of our users, but I've been told recently I can upgrade to V3 should I need functionality from it. Any ideas?

    Read the article

  • Change style display for cells with Javascript

    - by Ronny
    Hi, I want to do something like this: user selects one radio button (lock,delete or compare). I want to show to him only the relevant column from the table. (each option has different column). The table is ajax. I guess i need to change the display style for every cell but i don't know how. Here is example: Here i want to change the display of the cells function ButtonForTbl(value) { var x=document.getElementById("audithead").rows[0].cells; if (value == "lock"){ document.getElementById('lock').checked = true; //something like for(...)lockCell.style.display='' //something like for(...)deleteCell.style.display='none' //something like for(...)compareCell.style.display='none' } else if(value == "delete"){ document.getElementById('delete').checked = true; //something like for(...)lockCell.style.display='none' //something like for(...)deleteCell.style.display='' //something like for(...)compareCell.style.display='none' } else{ document.getElementById('compare').checked = true; } } I guess i need something like that: for (i = 0; i < deleteCell.length; i++) deleteCell[i].style.display='' = true ; The table: oCell = oRow.insertCell(-1); oCell.setAttribute('id','comCell' ); oCell.setAttribute('align', 'center'); oCell.innerHTML = "<input type='checkbox' id='com' value='"+ ind + "'name='com[]'>"; oCell = oRow.insertCell(-1); oCell.setAttribute('id','lockCell' ); oCell.setAttribute('align', 'center'); oCell.innerHTML = "<input type='checkbox' id='lock' value='"+ ind + "'name='lock[]'>"; Radio buttons: <input type="radio" value="compare" id="compare" name="choose" onclick="ButtonForTbl(this.value)"/> Compare&nbsp; <input type="radio" value="delete" id="delete" name="choose" onclick="ButtonForTbl(this.value)"/> Delete&nbsp; <input type="radio" value="lock" id="lock" name="choose" onclick="ButtonForTbl(this.value)"/> Lock<br/> The table html: <table class="auditable"> <thead id="audithead"> <tr><td></td></tr> </thead> <tbody id="auditTblBody"> </tbody> </table> EDIT: Full row is like that: <tr> <td align="center" id="lockCell" style="display: none;"> <input type="checkbox" onclick="" name="lock[]" value="1500" id="lock"></td> <td align="center" id="delCell" style="display: none;"> <input type="checkbox" name="del[]" value="1500"></td> <td align="center" id="comCell"> <input type="checkbox" onclick="setChecks(this)" name="com[]" value="1500" id="com"></td> <td width="65px">100% 1/1</td><td width="105px">2011-01-10 17:47:37</td> </tr> Thank you so much!

    Read the article

  • Code Golf: Numeric Ranges

    - by SLaks
    Mods: Can you please make this Community Wiki? Challenge Compactify a long list of numbers by replacing consecutive runs with ranges. Example Input 1, 2, 3, 4, 7, 8, 10, 12, 13, 14, 15 Output: 1 - 4, 7, 8, 10, 12 - 15 Note that ranges of two numbers should be left as is. (7, 8; not 7 - 8) Rules You can accept a list of integers (or equivalent datatype) as a method parameter, from the commandline, or from standard in. (pick whichever option results in shorter code) You can output a list of strings by printing them, or by returning either a single string or set of strings. Reference Implementation (C#) IEnumerable<string> Sample(IList<int> input) { for (int i = 0; i < input.Count; ) { var start = input[i]; int size = 1; while (++i < input.Count && input[i] == start + size) size++; if (size == 1) yield return start.ToString(); else if (size == 2) { yield return start.ToString(); yield return (start + 1).ToString(); } else if (size > 2) yield return start + " - " + (start + size - 1); } }

    Read the article

  • WCF client side List<> problem

    - by MrKanin
    Hey there.. i got a WCF service with a method (GetUserSoftware)to send a List to a client. the software i have difined like this: [DataContract] public class Software { public string SoftwareID { get; set; } public string SoftwareName { get; set; } public string DownloadPath { get; set; } public int PackageID { get; set; } } the method is going through my db to get all software availeble to the clien, and generates a list of that to send back to the client. problem is i on the client side the list is turned into an array. and every item in that array dont contain any of my software attributs. i have debugged my way through the server side. and seen that the list its about to send is correct. with the expected software and attributs in it. any one know how to work around this or know what i can do ?

    Read the article

  • JPA generic field

    - by m.ugues
    Hallo all Is it possible to persist a generic field? I have this property on an Entity class ... private T payload; ... T extends EventMessagePayload and public interface StringPayload extends EventMessagePayload{ String getPayload(); } In my application i persist the field only when is of String type and during the save operation all works great. When I read the object instead JPA try to create a String object but instead is a StringPaylod. Is there a way to intercept the creation and handle the object marshalling? Kind regards Massimo

    Read the article

  • Twitter API Rate Limit - Overcoming on an unauthenticated JSON Get with Objective C?

    - by Cian
    I see the rate limit is 150/hr per IP. This'd be fine, but my application is on a mobile phone network (with shared IP addresses). I'd like to query twitter trends, e.g. GET /trends/1/json. This doesn't require authorization, however what if the user first authorized with my application using OAuth, then hit the JSON API? The request is built as follows: - (void) queryTrends:(NSString *) WOEID { NSString *urlString = [NSString stringWithFormat:@"http://api.twitter.com/1/trends/%@.json", WOEID]; NSURL *url = [NSURL URLWithString:urlString]; NSURLRequest *theRequest=[NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0]; NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self startImmediately:YES]; if (theConnection) { // Create the NSMutableData to hold the received data. theData = [[NSMutableData data] retain]; } else { NSLog(@"Connection failed in Query Trends"); } //NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]]; } I have no idea how I'd build this request as an authenticated one however, and haven't seen any examples to this effect online. I've read through the twitter OAuth documentation, but I'm still puzzled as to how it should work. I've experimented with OAuth using Ben Gottlieb's prebuild library, and calling this in my first viewDidLoad: OAuthViewController *oAuthVC = [[OAuthViewController alloc] initWithNibName:@"OAuthTwitterDemoViewController" bundle:[NSBundle mainBundle]]; // [self setViewController:aViewController]; [[self navigationController] pushViewController:oAuthVC animated:YES]; This should store all the keys required in the app's preferences, I just need to know how to build the GET request after authorizing! Maybe this just isn't possible? Maybe I'll have to proxy the requests through a server side application? Any insight would be appreciated!

    Read the article

  • Regular Expressions, avoiding HTML tags in PHP

    - by Jason Axelrod
    I have actually seen this question quite a bit here, but none of them are exactly what I want... Lets say I have the following phrase: Line 1 - This is a TEST phrase. Line 2 - This is a <img src="TEST" /> image. Line 3 - This is a <a href="somelink/TEST">TEST</a> link. Okay, simple right? I am trying the following code: $linkPin = '#(\b)TEST(\b)(?![^<]*>)#i'; $linkRpl = '$1<a href="newurl">TEST</a>$2'; $html = preg_replace($linkPin, $linkRpl, $html); As you can see, it takes the word TEST, and replaces it with a link to test. The regular expression I am using right now works good to avoid replacing the TEST in line 2, it also avoids replacing the TEST in the href of line 3. However, it still replaces the text encapsulated within the tag on line 3 and I end up with: Line 1 - This is a <a href="newurl">TEST</a> phrase. Line 2 - This is a <img src="TEST" /> image. Line 3 - This is a <a href="somelink/TEST"><a href="newurl">TEST</a></a> link. This I do not want as it creates bad code in line 3. I want to not only ignore matches inside of a tag, but also encapsulated by them. (remember to keep note of the / in line 2)

    Read the article

  • Save all xml nodes to db without looping through it

    - by AndreMiranda
    I have this xml: <Path> <Record> <ID>6534808</ID> <Distance>1.05553036073736</Distance> </Record> <Record> <ID>6542471</ID> <Distance>1.05553036073736</Distance> </Record> ... and about more 500 nodes </Path> And I'm using the code below to get all "Record" nodes: XmlNodeList paths = xDoc.SelectNodes("//Record"); And, after that, I save each record to database. But, the problem is that I'm using a foreach to loop through this nodes and the count of this nodes may be more than 500, sometimes it gets up to 1000 "Records" node. And this gets too long... Is there a way to save all of these nodes without looping through it? Thanks!!

    Read the article

  • WPF Databinding problem

    - by costin
    Hi, I'm new to WPF and I have some difficulties when I'm trying to populate a ListView with a list of custom objects. internal class ApplicationCode { public int Code { get; set; } public IEnumerable<string> InstrumentCodes { get; set; } } I have a list of ApplicationCode which I set to ItemsSource to a ListView. I need to display the ApplicationCode.Code as a string and for the rest of the columns a check box which can be checked/unchecked depending if the column name is contained in the InstrumentCodes collection. In order to set the check box I use a converter on databinding: <DataTemplate x:Key="InstrumentCodeTemplate"> <CheckBox IsEnabled="False" IsChecked="{Binding Mode=OneTime, Converter={StaticResource InstrumentSelectionConverter}}" /> </DataTemplate> The problem I have is because I can't know which is the current column at the time of cell data binding and I can't set the ConverterParameter. public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { ApplicationCode appCode = value as ApplicationCode; return appCode != null && appCode.InstrumentCodes.Contains(parameter.ToString()); } There is a way to find out the column index or name? Or there is another way to solve this problem?

    Read the article

  • Image upload - Return URL

    - by Qmal
    Hello I build a script that does image uploading and resizing and it all works well, but how can I get the URL from image afterwards? I don't want my Image Source in HTML be like "../img/cat/1.png/" I want it to be like "http://MyIP/img/cat/1.png" I understand that I can just make a variable like $myHost = "http://blabla.com"; and add strip the ".." at the beginning but then it's not so good if I want to use it on other site because I need to replace this all the time. Maybe there is any other way?

    Read the article

  • Jquery Block on my document .ready function not working

    - by kumar
    Hello Friens, I have this code, I added JS Script file to my Master page. <script src="/Scripts/Jquery.blockUI.js" type="text/javascript"></script> This Below code I have in my master page.on document.ready <script type="text/javascript"> $(document).ready(function () { $.blockUI({ message: $('#question'), css: { width: '275px'} }); }); </script> <div id="question" style="display:none; cursor: default"> <h2 class="padding"><br />An unexpected system error has occurred while processing your request.<br /></h2> <h3>We apologize for this inconvenience.<br /> Please report this error to your system administrator with the following information:<br /><br /> Session id is:</h3> <input type="button" id="OK" value="OK" /> </asp:Content> On my Document.ready Function my BlockUi is not working? can any body tell me why its not working? thanks

    Read the article

  • Source control issue with deploying versions

    - by Bonefisher
    Hi all, we have this discussion about how to deploy to production revisions that are UAT closed without revisions with UAT not-closed status. We are using SVN and we figured out that we are not able to just take revisions without prior-revisions on the same file made. Let me explain it on this example: we have 3 revisions made on same file: r1: UAT closed (ready to deploy) r2: UAT not-closed (not ready) r3: UAT closed (ready to deploy) now I want to deploy only my changes for which the UAT is closed (e.g. r1 and r3). In SVN this is not possible because r3 contains also r2 changes.. How do you made this to work? Maybe branching? Or just take r1 and wait until r2 is UAT closed? thanks

    Read the article

  • JSF Open new window and display bean data

    - by JSFPRINTER
    I am running JSF 2.0 and the latest version of Primefaces 2.2RC1 I believe. I am trying to create a printer friendly window. When the user clicks on a p:commandLink I want a new window to open and display a xhtml file I have named printView.xhtml. Now I can get the window working fine using JavaScript window.open but when I open the new window it will not render any values it just displays everything as #{myBean.value}. Does anyone know how to properly open a window and extend the current scope of the application into that window so I can call all of my managed beans properly and display the values etc. etc.

    Read the article

  • Wrap a list to add an empty row for UI binding.

    - by TheSean
    I am binding a List to a UI Control. My list does not contain a blank row, but I need to add one to allow the user to select blank. However, I'm using the same list in other parts of the application (users can edit/add/delete items) where it doesn't make sense to show a blank row. My idea is to create a wrapper around the list which adds a blank row just for the UI. The wrapper would hold a reference so that updates to the list (from other parts of the app) would be reflected in UI without any extra work. I have tried a few different ways, but nothing has worked out for me yet. Can anyone solve this problem?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >