Search Results

Search found 1392 results on 56 pages for 'andy mc'.

Page 8/56 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • C# Class Factories

    - by Andy
    I have a class called Foo that has a function that looks like the following List<Bar> LoadData(); Both Foo and Bar are in a library that I want to reuse in other projects. Now I am working on a new project and I want to subclass Bar. Let's call it NewBar. What is a simple and flexible way to get Foo.LoadData to return a list of NewBar? I think that a factory is needed or perhaps just a delegate function. Can anyone provide an example? Thanks, Andy

    Read the article

  • C#, Generic Lists and Inheritance

    - by Andy
    I have a class called Foo that defines a list of objects of type A: class Foo { List<A> Items = new List<A>(); } I have a class called Bar that can save and load lists of objects of type B: class Bar { void Save(List<B> ComplexItems); List<B> Load(); } B is a child of A. Foo, Bar, A and B are in a library and the user can create children of any of the classes. What I would like to do is something like the following: Foo MyFoo = new Foo(); Bar MyBar = new Bar(); MyFoo.Items = MyBar.Load(); MyBar.Save(MyFoo.Items); Obviously this won't work. Is there a clever way to do this that avoids creating intermediate lists? thanks, Andy

    Read the article

  • Favorite Midnight Commander tips & trick

    - by takeshin
    Please share your favorite mc tips here. My favorites: I just learned that Alt+. enables easily to toggle display of hidden files (on mc 4.7). Ctrl+\ - favorite dirs Alt+s - quick search BTW: how to use command line completion without switching to Ctrl+o mode? (TAB does not work, since it changes panels) how to insert full path of the current panel into the command line?

    Read the article

  • How to get rid of messages addressed to not existing subdomains?

    - by user71061
    Hi! I have small problem with my sendmail server and need your little help :-) My situation is as follow: User mailboxes are placed on MS exchanege server and all mail to and from outside world are relayed trough my sendmail box. Exchange server ----- sendmail server ------ Internet My servers accept messages for one main domain (say, my.domain.com) and for few other domains (let we narrow it too just one, say my_other.domain.com). After configuring sendmail with showed bellow abbreviated sendmail.mc file, essentially everything works ok, but there is small problem. I want to reject messages addressed to not existing recipients as soon as possible (to avoid sending non delivery reports), so my sendmail server make LDAP queries to exchange server, validating every recipient address. This works well both domains but not for subdomains. Such subdomains do not exist, but someone (I'm mean those heated spamers :-) could try addresses like this: user@any_host.my.domain.com or user@any_host.my_other.domain.com and for those addresses results are as follows: Messages to user@sendmail_hostname.my.domain.com are rejected with error "Unknown user" (due to additional LDAPROUTE_DOMAIN line in my sendmail.mc file, and this is expected behaviour) Messages to user@any_other_hostname.my.domain.com are rejected with error "Relaying denied". Little strange to me, why this time the error is different, but still ok. After all message was rejected and I don't care very much what error code will be returned to sender (spamer). Messages to user@sendmail_hostname.my_other.domain.com and user@any_other_hostname.my_other.domain.com are rejected with error "Unknown user" but only when, there is no user@my_other.domain.com mailbox (on exchange server). If such mailbox exist, then all three addresses (i.e. user@my_other.domain.com, user@sendmail_hostname.my_other.domain.com and user@any_other_hostname.my_other.domain.com) will be accepted. (adding additional line LDAPROUTE_DOMAIN(my_sendmail_host.my_other.domain.com) to my sendmail.mc file don't change anything) My abbreviated sendmail.mc file is as follows (sendmail 8.14.3-5). Both domains are listed in /etc/mail/local-host-names file (FEATURE(use_cw_file) ): define(`_USE_ETC_MAIL_')dnl include(`/usr/share/sendmail/cf/m4/cf.m4')dnl OSTYPE(`debian')dnl DOMAIN(`debian-mta')dnl undefine(`confHOST_STATUS_DIRECTORY')dnl define(`confRUN_AS_USER',`smmta:smmsp')dnl FEATURE(`no_default_msa')dnl define(`confPRIVACY_FLAGS',`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl FEATURE(`use_cw_file')dnl FEATURE(`access_db', , `skip')dnl FEATURE(`always_add_domain')dnl MASQUERADE_AS(`my.domain.com')dnl FEATURE(`allmasquerade')dnl FEATURE(`masquerade_envelope')dnl dnl define(`confLDAP_DEFAULT_SPEC',`-p 389 -h my_exchange_server.my.domain.com -b dc=my,dc=domain,dc=com')dnl dnl define(`ALIAS_FILE',`/etc/aliases,ldap:-k (&(|(objectclass=user)(objectclass=group))(proxyAddresses=smtp:%0)) -v mail')dnl FEATURE(`ldap_routing',, `ldap -1 -T<TMPF> -v mail -k proxyAddresses=SMTP:%0', `bounce')dnl LDAPROUTE_DOMAIN(`my.domain.com')dnl LDAPROUTE_DOMAIN(`my_other.domain.com ')dnl LDAPROUTE_DOMAIN(`my_sendmail_host.my.domain.com')dnl define(`confLDAP_DEFAULT_SPEC', `-p 389 -h "my_exchange_server.my.domain.com" -d "CN=sendmail,CN=Users,DC=my,DC=domain,DC=com" -M simple -P /etc/mail/ldap-secret -b "DC=my,DC=domain,DC=com"')dnl FEATURE(`nouucp',`reject')dnl undefine(`UUCP_RELAY')dnl undefine(`BITNET_RELAY')dnl define(`confTRY_NULL_MX_LIST',true)dnl define(`confDONT_PROBE_INTERFACES',true)dnl define(`MAIL_HUB',` my_exchange_server.my.domain.com.')dnl FEATURE(`stickyhost')dnl MAILER_DEFINITIONS MAILER(smtp)dnl Could someone more experienced with sendmail advice my how to reject messages to those unwanted subdomains? P.S. Mailboxes @my_other.domain.com are used only for receiving messages and never for sending.

    Read the article

  • Trouble using gitweb with nginx

    - by Rayne
    I have a git repository in a directory inside of /home/raynes/pubgit/. I'm trying to use gitweb to provide a web interface to it. I use nginx as my web server for everything else, so I don't really want to have to use another just for this. I'm mostly following this guide: http://michalbugno.pl/en/blog/gitweb-nginx, which is the only guide I can find via google and is really recent. fcgiwrap apparently isn't in Lucid Lynx's repositories, so I installed it manually. I spawn instances via spawn-fcgi: spawn-fcgi -f /usr/local/sbin/fcgiwrap -a 127.0.0.1 -p 9001 That's all good. My /etc/gitweb.conf is as follows: # path to git projects (<project>.git) #$projectroot = "/home/raynes/pubgit"; $my_uri = "http://mc.raynes.me"; $home_link = "http://mc.raynes.me/"; # directory to use for temp files $git_temp = "/tmp"; # target of the home link on top of all pages #$home_link = $my_uri || "/"; # html text to include at home page $home_text = "indextext.html"; # file with project list; by default, simply scan the projectroot dir. $projects_list = $projectroot; # stylesheet to use $stylesheet = "/gitweb/gitweb.css"; # logo to use $logo = "/gitweb/git-logo.png"; # the 'favicon' $favicon = "/gitweb/git-favicon.png"; And my nginx server configuration is this: server { listen 80; server_name mc.raynes.me; location / { root /usr/share/gitweb; if (!-f $request_filename) { fastcgi_pass 127.0.0.1:9001; } fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } } The only difference here is that I've set fastcgi_pass to 127.0.0.1:9001. When I go to http://mc.raynes.me I'm greeted with a page that simply says "403" and nothing else. I have not the slightest clue what I did wrong. Any ideas?

    Read the article

  • Sendmail issue with AuthInfo

    - by chris
    I'm having trouble finding out where to add in this line to /etc/mail/access: AuthInfo:smtp.sendgrid.net "U:XXX" "P:XXX" "M:PLAIN" When I run this: m4 sendmail.mc >sendmail.cf My error: WARNING: feature greetpause before access.db.... I also am modifying sendmail.mc with: define(`SMART_HOST', `smtp.sendgrid.net')dnl FEATURE(`access_db')dnl define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl

    Read the article

  • A regular expression that will allow a string with only one Capital Letter

    - by Phoenix
    The string should be 6 - 20 characters in length. And it should contain 1 Capital letter. I can do this in code using C# string st = "SomeString" Regex rg = new Regex("[A-Z]"); MatchCollection mc = rg.Matches(st); Console.WriteLine("Total Capital Letters: " + mc.Count); if (mc.Count > 1) { return false; } But what i really want is a Regular expression that will match my string if it only contains one capital. The string can start with a common letter and should have only letters. Thanks In advance. (I did look at some of the other RegEx questions but they did not help).

    Read the article

  • what's the UNC path for local computer from a remote machine ?

    - by KaluSingh Gabbar
    I am writing a small utility program in IronPython to install applications on remote machine using managementclass which uses WMI. Now, the script would install an application on Machine_B from Machine_A, it works fine as long as you have the msi file on the local drive of the Target machine (Machine_B, in this case). I want to be able to do same thing with .msi file being on the Host (Machine_A) machine. network_scope = r"\\%Machine_B\root\cimv2" scope = ManagementScope(network_scope, options) scope.Connect() mp = ManagementPath("Win32_Product") ogo = ObjectGetOptions() mc = ManagementClass(scope, mp, ogo) inParams = mc.GetMethodParameters ("Install") inParams["PackageLocation"] = r"C:\installs\python-3.1.1.msi" inParams["AllUsers"] = True retVal = mc.InvokeMethod ("Install", inParams, None) print retVal ["ReturnValue"].ToString() PROBLEM : [Machine A] --- Where I am running the script, and want to host the .msi file [Machine B] --- where I want to install the application So, How can I define the UNC path for local machine ? what will be inParams["PackageLocation"] = ??

    Read the article

  • Drag/Drop movieclip event in JSFL? (Flash IDE)

    - by niels
    Lately im trying to do some experimental things with JSFL, and i was wondering if it is possible to listener for an event when a component (that i have made) or movieclip is dragged from library on the stage. i want to create something that i'll get a component and drop it on a mc. when the component is dropped on the mc the component will save the mc as a reference in some var. maybe with events isnt the way to go but i have no clue if this is possible or how to do it another way. i hope someone can help me get started thx in advance

    Read the article

  • ASP MVC Creating Form Rows Dynamically

    - by Jonathan Stowell
    Hi Guys, I haven't even attempted this yet and am creating this question for advice really. I have a strongly typed page which receives a form model composed of several components. It is to create a mitigating circumstance (MC) for a student at a university for my final year project. A MC can be composed of the initial problem, assessment extensions, and I use a multi select box to allow the user to select staff retrieved from the database which are able to view the MC once created. The thing is I feel that a student could be granted many assignment extensions for one problem. I am wander if it is possible to include a button/image on the form which when clicked will create a new assessment extension object, and duplicate the form components to set the values for the object? This would all need to occur without any page refreshes. Any advice, or links to good tutorials would be appreciated. I have so far been unable to find any suitable examples. Thanks, Jon

    Read the article

  • CSS elements won't line up

    - by Lewis
    I have just embedded a newsletter field and button into my website, the field sits nicely but the button is too low. I tried different styles but nothing seems to work. http://www.pazzle.co.uk/ Just underneath the banner. <!-- Begin MailChimp Signup Form --> <div id="mc_embed_signup"> <form action="http://pazzle.us6.list-manage.com/subscribe/post?u=7167bf73b26b7bd1298d4f925&amp;id=a48b73e435" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate> <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required><div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div> </form> </div> <!--End mc_embed_signup-->

    Read the article

  • excel change 4 rows / 48 col to 48 rows / 4 col

    - by GoodOlPete
    Hi, I've selected 4 database records of 48 fields into excel as below: FirstName LastName Age Address1 ....................... Andy smith 23 53 high st billy ball 43 23 the avenue charles brown 76 rose cottage dave green 43 station rd I want to display them as firstname andy billy charles dave lastname smith ball brown green age 23 43 76 43 address1.............................. Can anyone suggest how to do this?

    Read the article

  • Handling async ASMX web service exceptions

    - by Andy
    Hi, I've developed silverlight client with makes async web services calls to a asmx web service. The problem is, I want to handle exceptions, so far as to be able to tell in the client application whether there was an exception in the webservice (and therefore will be logged local to the webservice) or whether there was a communication problem (i.e. the endpoint for the webservice was wrong). In testing both types of exceptions in my project I get the same generic exception: System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. This exception is amazingly useless when an exception occured in the webservice as it clearly has been found. Is the presence of this generic error to do with security (not being allowed to see true errors)? It can't be the fact that I don't have debug strings as I'm running on a dev PC. Either way, my question is, what's the best way to handle async errors in a commercial silverlight application? Any links or ideas are most welcome! :) Thanks a lot! Andy.

    Read the article

  • Grep failing with Emacs (windows), and GnuWin32 Grep

    - by Andy
    Hi, I've downloaded and installed the GnuWin32 tools, and added the grep executables to the Emacs bin. I've also, for what its worth, added the GnuWin32 bin folder to my Path variable. Problem is though, when I try and run with suggested grep commands, I always get: Grep exited abnormally with code 53 at Wed Feb 24 17:16:12 For the life of me, I can't find any reference to error code 53 anywhere! :( I've tried the exact examples on a number of websites for example, when I enter: M-x grep <ret> It comes up with Run grep (like this): grep -n Which is fine, but I have no idea of what parameters it expects. I've tried some in some tuorials, but I get error code 53 again! One of the things I've tried is straight from the emacs wiki (http://www.emacswiki.org/emacs/GrepMode#toc2) (maybe not for the windows version though?) and it says to try this command: M-x grep -n -e setq ~/.emacs Which I've tried and I get: -*- mode: grep; default-directory: "c:/[My Directory]/" -*- Grep started at Wed Feb 24 17:30:47 grep -n -e setq ~/.emacs NUL Grep exited abnormally with code 53 at Wed Feb 24 17:30:47 So frustrating as this is meant to be a powerful feature of Emacs and I'm really trying to learn it as I've heard good things about it! Any help would be appreciated! :) Andy UPDATE From the suggestion below, I've tried it via command line and it seems to work fine, perhaps there some config I'm UPDATE I've found the command M-x Occur which seems to do much the same as I would image grep does. Are there many extra benefits to using grep over occur if I can't get this working?

    Read the article

  • Fluent NHibernate is bringing ClassMap Id and SubClassMap Id to referenced table?

    - by Andy
    HI, I have the following entities I'm trying to map: public class Product { public int ProductId { get; private set; } public string Name { get; set; } } public class SpecialProduct : Product { public ICollection<Option> Options { get; private set; } } public class Option { public int OptionId { get; private set; } } And the following mappings: public class ProductMap : ClassMap<Product> { public ProductMap() { Id( x => x.ProductId ); Map( x => x.Name ); } public class SpecialProductMap : SubclassMap<SpecialProduct> { public SpecialProductMap() { Extends<ProductMap>(); HasMany( p => p.Options ).AsSet().Cascade.SaveUpdate(); } } public class OptionMap : ClassMap<Option> { public OptionMap() { Id( x => x.OptionId ); } } The problem is that my tables end up like this: Product -------- ProductId Name SpecialProduct -------------- ProductId Option ------------ OptionId ProductId // This is wrong SpecialProductId // This is wrong There should only be the one ProductId and single reference to the SpecialProduct table, but we get "both" Ids and two references to SpecialProduct.ProductId. Any ideas? Thanks Andy

    Read the article

  • Blank subreport in Jasper Reports

    - by Andy Chapman
    Hi all, I'm trying to launch a report that I created in iReport which contains a main report and a subreport. In iReport, the subreport launches fine and contains data, however when I try to launch it from within my java code, the subreport is blank. What I've done so far: I have a String parameter in the main report called "SUBREPORT" that is used to define the path to the subreport. E.g. value: "E:\java\ReportLauncher\reports\test_subreport1.jasper" The subreport expression in the main report is set to: $P{SUBREPORT} The subreport connection expression is: $P{REPORT_CONNECTION} I also have a subreport parameter defined called "INVOICE_NUMBER" that is set to $F{InviInvNo}, which maps to a field in the main report. In my java code, I have: HashMap<String, Object> paramHash = new HashMap(); paramHash.put("INVOICE_NUMBER", invoiceID); paramHash.put("REPORT_CONNECTION", this.conn); paramHash.put("SUBREPORT", subReportPath); JasperPrint jasperprint = JasperFillManager.fillReport(this.reportPath, paramHash, this.conn); The main report is created fine and is populated. The subreport area however is blank. Any thoughts for what I'm doing wrong? Thanks in advance, Andy.

    Read the article

  • wpf - window to be tight round user control

    - by Andy Clarke
    Hi, I've got a user control that I'm loading into a Window dynamically - I wanted to set the Window so that it didn't have a size and then I thought the window to resize accordingly depending on the UserControl. However it dosn't - can anyone assist please? I've made a very basic example - I've cut out the dynamic bits and just put a UserControl in a Window. What do I need to do to get the window to be tight around the UserControl? Thanks, Andy <UserControl x:Class="WpfApplication1.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300" Background="LightBlue"> <Grid> </Grid> </UserControl> <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:WpfApplication1="clr-namespace:WpfApplication1" Title="Window1" > <Grid> <WpfApplication1:UserControl1> </WpfApplication1:UserControl1> </Grid> </Window>

    Read the article

  • Why does my Sax Parser produce no results after using InputStream Read?

    - by Andy Barlow
    Hello, I have this piece of code which I'm hoping will be able to tell me how much data I have downloaded (and soon put it in a progress bar), and then parse the results through my Sax Parser. If I comment out basically everything above the //xr.parse(new InputSource(request.getInputStream())); line and swap the xr.parse's over, it works fine. But at the moment, my Sax parser tells me I have nothing. Is it something to do with is.read (buffer) section? Also, just as a note, request is a HttpURLConnection with various signatures. /*Input stream to read from our connection*/ InputStream is = request.getInputStream(); /*we make a 2 Kb buffer to accelerate the download, instead of reading the file a byte at once*/ byte [ ] buffer = new byte [ 2048 ] ; /*How many bytes do we have already downloaded*/ int totBytes,bytes,sumBytes = 0; totBytes = request.getContentLength () ; while ( true ) { /*How many bytes we got*/ bytes = is.read (buffer); /*If no more byte, we're done with the download*/ if ( bytes <= 0 ) break; sumBytes+= bytes; Log.v("XML", sumBytes + " of " + totBytes + " " + ( ( float ) sumBytes/ ( float ) totBytes ) *100 + "% done" ); } /* Parse the xml-data from our URL. */ // OLD, and works if comment all the above //xr.parse(new InputSource(request.getInputStream())); xr.parse(new InputSource(is)) /* Parsing has finished. */; Can anyone help me at all?? Kind regards, Andy

    Read the article

  • Problem with response.redirect sending incorrect HTTPMethod

    - by Andy Macnaughton-Jones
    Hi, I've got a strange problem with a Response.Redirect. I'm using VB.NET with the .NET 2 framework (so VS2005 & SP1). I've got a page that I do a form submit on (that's a proper form method="POST" hard-coded onto the page) and that properly posts me back the page data which is then processed. As part of that processing the system determines if we need to get sent to another URL after processing has been complete. So the request.httpmethod = "POST". So if the "GotoPage" parameter has a URL specified we then do a response.redirect(URL, false). (False as we want page processing to complete in order to write some timing logs etc). The page correctly redirects but instead of the response having a "GET" as the request.httpmethod it has a "POST" instead ! Now, we're using our own custom framework so that we use the HTTPRequest method to determine if a page has been posted back or is being "Getted" so the "IsPagePostBack" property doesn't work (that only works when you're using the normal .NET controls and form submissions). In all other instances our code works happily but what might be causing the Request.httpMethod to not be being set correctly ? I've tried doing a response.clear before the redirect in case headers are being written out before hand but to no avail. Any clues ?! thanks, Andy

    Read the article

  • jquery loop to create elements with retained values

    - by Andy Simpson
    Dear all, I recently asked a question about creating elements with jquery. Specifically I needed input boxes created/deleted depending on the value of a particular select box. This was answered quickly with a very nice solution as follows: $('select').change(function() { var num = parseInt($(this).val(), 10); var container = $('<div />'); for(var i = 1; i <= num; i++) { container.append('<input id="id'+i+'" name="name'+i+'" />'); } $('somewhere').html(container); }); This works very well. Is there a way to have the values remaining in the text boxes when the selection is changed? For example, lets say the select element value is set to '2' so that there are 2 input boxes showing. If there is input already entered in these boxes and the user changes the select element value to '3' is there a way to get the first 2 input boxes to retain their value? Thanks for the help in advance Andy

    Read the article

  • 3 Servers, is this is a cluster?

    - by Andy Barlow
    Hello, At the moment I have one Ubuntu server, 9.10, running with a simple Samba share, a mail server, DNS server and DHCP server. Mostly its just there for file sharing and email server. I also have 2 other servers that are exactly the same hardware and spec as the first, which have an rsync set up to retrieve the shared folders and backs them up. However, if the first server goes down, all of our shares disappear along with our mail and the system must be rebuilt. Also I tend to find if people are downloading a large amount from the file server, no-one can access there emails - especially in the morning when everyone is signing in at once. Would it be more beneficial for me to have all 3 servers, all running the same services, doing the same thing with some sort of cluster with load balancing? I'm not really sure where to begin looking, or how to go about such a setup where 3 servers are all identical, but perhaps one acts as the main load balancer?? If someone can point me in the right direction, or if this simply sounds like one of those Enterprise Cloud's that is now a default setup in Ubuntu Server 9.10+, then I'll go down that route. Cheers in advance. Andy

    Read the article

  • Why do my Sax Parser produce no results after using InputStream Read?

    - by Andy Barlow
    Hello, I have this piece of code which I'm hoping will be able to tell me how much data I have downloaded (and soon put it in a progress bar), and then parse the results through my Sax Parser. If I comment out basically everything above the //xr.parse(new InputSource(request.getInputStream())); line and swap the xr.parse's over, it works fine. But at the moment, my Sax parser tells me I have nothing. Is it something to do with is.read (buffer) section? Also, just as a note, request is a HttpURLConnection with various signatures. /*Input stream to read from our connection*/ InputStream is = request.getInputStream(); /*we make a 2 Kb buffer to accelerate the download, instead of reading the file a byte at once*/ byte [ ] buffer = new byte [ 2048 ] ; /*How many bytes do we have already downloaded*/ int totBytes,bytes,sumBytes = 0; totBytes = request.getContentLength () ; while ( true ) { /*How many bytes we got*/ bytes = is.read (buffer); /*If no more byte, we're done with the download*/ if ( bytes <= 0 ) break; sumBytes+= bytes; Log.v("XML", sumBytes + " of " + totBytes + " " + ( ( float ) sumBytes/ ( float ) totBytes ) *100 + "% done" ); } /* Parse the xml-data from our URL. */ // OLD, and works if comment all the above //xr.parse(new InputSource(request.getInputStream())); xr.parse(new InputSource(is)) /* Parsing has finished. */; Can anyone help me at all?? Kind regards, Andy

    Read the article

  • finding ALL cycles in a huge sparse matrix

    - by Andy
    Hi there, First of all I'm quite a Java beginner, so I'm not sure if this is even possible! Basically I have a huge (3+million) data source of relational data (i.e. A is friends with B+C+D, B is friends with D+G+Z (but not A - i.e. unmutual) etc.) and I want to find every cycle within this (not necessarily connected) directed graph. I've found this thread (http://stackoverflow.com/questions/546655/finding-all-cycles-in-graph/549402#549402) which has pointed me to Donald Johnson's (elementary) cycle-finding algorithm which, superficially at least, looks like it'll do what I'm after (I'm going to try when I'm back at work on Tuesday - thought it wouldn't hurt to ask in the meanwhile!). I had a quick scan through the code of the Java implementation of Johnson's algorithm (in that thread) and it looks like a matrix of relations is the first step, so I guess my questions are: a) Is Java capable of handling a 3+million*3+million matrix? (was planning on representing A-friends-with-B by a binary sparse matrix) b) Do I need to find every connected subgraph as my first problem, or will cycle-finding algorithms handle disjoint data? c) Is this actually an appropriate solution for the problem? My understanding of "elementary" cycles is that in the graph below, rather than picking out A-B-C-D-E-F it'll pick out A-B-F, B-C-D etc. but that's not the end of the world given the task. E / \ D---F / \ / \ C---B---A d) If necessary, I can simplify the problem by enforcing mutuality in relations - i.e. A-friends-with-B <== B-friends-with-A, and if really necessary I can maybe cut down the data size, but realistically it is always going to be around the 1mil mark. z) Is this a P or NP task?! Am I biting off more than I can chew? Thanks all, any help appreciated! Andy

    Read the article

  • What's keeping this timer in scope? The anonymous method?

    - by Andy
    Ok, So I have a method which fires when someone clicks on our Icon in a silverlight application, seen below: private void Logo_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { e.Handled = true; ShowInfo(true); DispatcherTimer autoCloseTimer = new DispatcherTimer(); autoCloseTimer.Interval = new TimeSpan(0, 0, 10); autoCloseTimer.Tick +=new EventHandler((timerSender,args) => { autoCloseTimer.Stop(); ShowInfo(false); }); autoCloseTimer.Start(); } Whats meant to happen is that the method ShowInfo() opens up a box with the company info in and the dispatch timer auto closes it after said timespan. And this all works... But what I'm not sure about is because the dispatch timer is a local var, after the Logo_MouseLeftButtonUp method finishes, what is there to keep the dispatch timer referenced and not availible for GC collection before the anonymous method is fired? Is it the reference to the ShowInfo() method in the anonymous method? Just feels like some thing I should understand deeper as I can imagine with using events etc it can be very easy to create a leak with something like this. Hope this all makes sense! Andy.

    Read the article

  • Dynamic loading of shared objects using dlopen()

    - by Andy
    Hi, I'm working on a plain X11 app. By default, my app only requires libX11.so and the standard gcc C and math libs. My app has also support for extensions like Xfixes and Xrender and the ALSA sound system. But this feature shall be made optional, i.e. if Xfixes/Xrender/ALSA is installed on the host system, my app will offer extended functionality. If Xfixes or Xrender or ALSA is not there, my app will still run but some functionality will not be available. To achieve this behaviour, I'm not linking dynamically against -lXfixes, -lXrender and -lasound. Instead, I'm opening these libraries manually using dlopen(). By doing it this way, I can be sure that my app won't fail in case one of these optional components is not present. Now to my question: What library names should I use when calling dlopen()? I've seen that these differ from distro to distro. For example, on openSUSE 11, they're named the following: libXfixes.so libXrender.so libasound.so On Ubuntu, however, the names have a version number attached, like this: libXfixes.so.3 libXrender.so.1 libasound.so.2 So trying to open "libXfixes.so" would fail on Ubuntu, although the lib is obviously there. It just has a version number attached. So how should my app handle this? Should I let my app scan /usr/lib/ first manually to see which libs we have and then choose an appropriate one? Or does anyone have a better idea? Thanks guys, Andy

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >