Search Results

Search found 6715 results on 269 pages for 'preg match'.

Page 127/269 | < Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >

  • Export SSL Cert from IIS and import into GlassFish keystore

    - by Tim H
    What I need: I have an existing SSL certificate installed on IIS 6. On the same machine, I have GlassFish installed and would like to share the same certificate since they both share the same hostname, and they use different ports: IIS uses 443 and GlassFish uses 8181. Why I need it: Reuse existing SSL certs from IIS to GlassFish. I imagine that this is possible. I am able to install an SSL cert into GlassFish's keystore, and then import the same exact cert into IIS. I just want to go the other way - imagine having an SSL cert on IIS being used for months, and now I want to enable SSL on GlassFish. What I have done: Created a keystore with an alias: server.hostname.com Imported intermediate CA certs associated with the existing SSL Cert Imported the existing SSL cert with the same alias: server.hostname.com, but the keytool won’t allow this, as it is not associated: keytool error: java.lang.Exception: Public keys in reply and keystore don't match Why? Using a different alias causes the cert to not be trusted in the CA chain.

    Read the article

  • Getting live traffic/visitor analytics when using a reverse proxy

    - by jotto
    I'm in process of implementing Varnish as a reverse proxy for a Ruby on Rails app and I'm using Google Analytics (JS/client side script to record visitor data) but it's several hours delayed so its useless for knowing what's going on now. I need at a glance live data that includes referring traffic and what current req/sec is. Right now I am using a simple Rack middleware application to do the live stats (gist.github.com/235745) but if the majority of traffic hits Varnish, Rack will never be hit so this won't work. The closest solution I've found so far is http://www.reinvigorate.net/ but it's in beta (there are also no implementation details on their front page). Does Varnish have traffic logs that I can custom format to match my Apache logs so I can combine them, or will I have to roll my own JS implementation like GA that shows the data in real time?

    Read the article

  • Tridion New UI Preview Site is not reflecting with the changes unless pulished

    - by Ram G
    I have new UI setup and noticing that when ever I update a page it is not refreshing with the updated changes. I do not see either the page_{sessionId/GUID}.aspx created either. Checked the session preview DB and I see the changes in PAGE_CONTENT table with new rendered content, so seems like session preview is working fine but the Preview site is not able to get the changes and refresh the UI. I have checked all the preview handlers and mappings for .aspx and made sure they are correct in web.config. Any thoughts on why the preview site not showing up the changes? I have the session preview DB setup in cd_storage_conf.xml. <StorageBindings> <Bundle src="preview_dao_bundle.xml"/> </StorageBindings> <Wrappers> <Wrapper Name="SessionWrapper"> <Timeout>120000</Timeout> <Storage Type="persistence" Id="db-session-webservice" dialect="MSSQL" Class="com.tridion.storage.persistence.JPADAOFactory"> <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" /> <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource"> <Property Name="serverName" Value="localhost" /> <Property Name="portNumber" Value="1433" /> <Property Name="databaseName" Value="Tridion_Broker_SessionPreview" /> <Property Name="user" Value="usr" /> <Property Name="password" Value="pwd" /> </DataSource> </Storage> </Wrapper> </Wrappers> web.config (handlers): <add verb="GET" path="*.htm" type="Tridion.ContentDelivery.Preview.Web.StaticFileHandler" /> <add verb="GET" path="*.jpg" type="Tridion.ContentDelivery.Preview.Web.StaticFileHandler" /> <add verb="GET" path="*.png" type="Tridion.ContentDelivery.Preview.Web.StaticFileHandler" /> <add verb="GET" path="*.aspx" type="Tridion.ContentDelivery.Preview.Web.StaticFileHandler" /> <add verb="GET" path="*.html" type="Tridion.ContentDelivery.Preview.Web.StaticFileHandler" /> <add name="Tridion.ContentDelivery.Preview.Web.PreviewContentModule" type="Tridion.ContentDelivery.Preview.Web.PreviewContentModule" /> Log (timestamp and DEBUG prefix removed): ClaimStore - put: uri=taf:session:id, value=tridion_db59279b-7d37-4b2e-ad98-eaaa6af7038e ClaimStore - put: uri=taf:session:id, value=tridion_db59279b-7d37-4b2e-ad98-eaaa6af7038e ClaimStore - put: uri=taf:tracking:id, value=tridion_d1fa1017-a28d-4f48-a790-b74f78c69314 ClaimStore - put: uri=taf:tracking:id, value=tridion_d1fa1017-a28d-4f48-a790-b74f78c69314 SearchClaimProcessor - No match found for referrer string http://uidemo.practice.com/en/Product/musk.aspx SearchClaimProcessor - No match found for referrer string http://uidemo.practice.com/en/Product/musk.aspx ClaimStore - put: uri=taf:claim:ambientdata:footprintcartridge:devicetype, value=Desktop ClaimStore - put: uri=taf:claim:ambientdata:footprintcartridge:devicetype, value=Desktop ClaimStore - put: uri=taf:claim:ambientdata:footprintcartridge:mobiledevice, value=NotMobile ClaimStore - put: uri=taf:claim:ambientdata:footprintcartridge:acceptlanguage, value=en-US ClaimStore - put: uri=taf:claim:ambientdata:footprintcartridge:mobiledevice, value=NotMobile ClaimStore - put: uri=taf:claim:ambientdata:footprintcartridge:acceptlanguage, value=en-US PageHandler - The session wrappers are correctly installed. Any thoughts/pointers on what might be going wrong...? (sorry for the long post)

    Read the article

  • Word mergefield wildcard not correctly matching

    - by aZn137
    Hello, Below is my mergefield code: { IF { MERGEFIELD Subs_State } = "GA" "blah blah" "{ IF { MERGEFIELD CEOrgStates } = "GA" "blah blah" ""} "} I'm pulling records from a MS Access db. My goal is to check whether a record has Subs_State field matching "GA", or the CEOrgStates has the word "GA" (some records have stuff like "|FL|CA|GA|CT|KY|" (no quotes)). When I merged the docs, Word doesnt seem to be able to match with the wildcards: If I use and compare "*GA" (fields ending with GA), it works; however, the double wildcards "*GA*" dont seem to work at all. Here are the things I’ve tried: Have data in lowercase, then compare with lowercase Have data in lowercase, convert to and then compare with uppercase Do the opposite of the above 2 with uppercase data Use “*GA*” and “*ga*” (no pipe) Use different delimiters Nothing seems to work with the double wildcard matching. What am I doing wrong? Thanks!

    Read the article

  • xsl:include template with no default namespace causes xmlns=""

    - by CraftyFella
    Hi, I've got a problem with xsl:include and default namespaces which is causing the final xml document contain nodes with the xmlns="" In this synario I have 1 source document which is Plain Old XML and doesn't have a namespace: <?xml version="1.0" encoding="UTF-8"?> <SourceDoc> <Description>Hello I'm the source description</Description> <Description>Hello I'm the source description 2</Description> <Description/> <Title>Hello I'm the title</Title> </SourceDoc> This document is transformed into 2 different xml documents each with their own default namespace. First Document: <?xml version="1.0" encoding="utf-8"?> <OutputDocType1 xmlns="http://MadeupNS1"> <Description >Hello I'm the source description</Description> <Description>Hello I'm the source description 2</Description> <Title>Hello I'm the title</Title> </OutputDocType1> Second Document: <?xml version="1.0" encoding="utf-8"?> <OutputDocType2 xmlns="http://MadeupNS2"> <Description>Hello I'm the source description</Description> <Description>Hello I'm the source description 2</Description> <DocTitle>Hello I'm the title</DocTitle> </OutputDocType2> I want to be able to re-use the template for descriptions in both of the transforms. As it's the same logic for both types of document. To do this I created a template file which was *xsl:include*d in the other 2 transformations: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="xml"/> <xsl:template match="Description[. != '']"> <Description> <xsl:value-of select="."/> </Description> </xsl:template> </xsl:stylesheet> Now the problem here is that this shared transformation can't have a default Namespace as it will be different depending on which of the calling transformations calls it. E.g. for First Document Transformation: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="xml"/> <xsl:template match="SourceDoc"> <OutputDocType1 xmlns="http://MadeupNS1"> <xsl:apply-templates select="Description"/> <xsl:if test="Title"> <Title> <xsl:value-of select="Title"/> </Title> </xsl:if> </OutputDocType1> </xsl:template> <xsl:include href="Template.xsl"/> </xsl:stylesheet> This actually outputs it as follows: <?xml version="1.0" encoding="utf-8"?> <OutputDocType1 xmlns="http://MadeupNS1"> <Description xmlns="">Hello I'm the source description</Description> <Description xmlns="">Hello I'm the source description 2</Description> <Title>Hello I'm the title</Title> </OutputDocType1> Here is the problem. On the description Lines I get an xmlns="" Does anyone know how to solve this issue? Thanks Dave

    Read the article

  • How to get an X11 Window from a Process ID ?

    - by Adam Pierce
    Under Linux, my C++ application is using fork() and execv() to launch multiple instances of OpenOffice so as to view some powerpoint slide shows. This part works. Next I want to be able to move the OpenOffice windows to specific locations on the display. I can do that with the XMoveResizeWindow() function but I need to find the Window for each instance. I have the process ID of each instance, how can I find the X11 Window from that ? UPDATE - Thanks to Andy's suggestion, I have pulled this off. I'm posting the code here to share it with the Stack Overflow community. Unfortunately Open Office does not seem to set the _NET_WM_PID property so this doesn't ultimately solve my problem but it does answer the question. // Attempt to identify a window by name or attribute. // by Adam Pierce <[email protected]> #include <X11/Xlib.h> #include <X11/Xatom.h> #include <iostream> #include <list> using namespace std; class WindowsMatchingPid { public: WindowsMatchingPid(Display *display, Window wRoot, unsigned long pid) : _display(display) , _pid(pid) { // Get the PID property atom. _atomPID = XInternAtom(display, "_NET_WM_PID", True); if(_atomPID == None) { cout << "No such atom" << endl; return; } search(wRoot); } const list<Window> &result() const { return _result; } private: unsigned long _pid; Atom _atomPID; Display *_display; list<Window> _result; void search(Window w) { // Get the PID for the current Window. Atom type; int format; unsigned long nItems; unsigned long bytesAfter; unsigned char *propPID = 0; if(Success == XGetWindowProperty(_display, w, _atomPID, 0, 1, False, XA_CARDINAL, &type, &format, &nItems, &bytesAfter, &propPID)) { if(propPID != 0) { // If the PID matches, add this window to the result set. if(_pid == *((unsigned long *)propPID)) _result.push_back(w); XFree(propPID); } } // Recurse into child windows. Window wRoot; Window wParent; Window *wChild; unsigned nChildren; if(0 != XQueryTree(_display, w, &wRoot, &wParent, &wChild, &nChildren)) { for(unsigned i = 0; i < nChildren; i++) search(wChild[i]); } } }; int main(int argc, char **argv) { if(argc < 2) return 1; int pid = atoi(argv[1]); cout << "Searching for windows associated with PID " << pid << endl; // Start with the root window. Display *display = XOpenDisplay(0); WindowsMatchingPid match(display, XDefaultRootWindow(display), pid); // Print the result. const list<Window> &result = match.result(); for(list<Window>::const_iterator it = result.begin(); it != result.end(); it++) cout << "Window #" << (unsigned long)(*it) << endl; return 0; }

    Read the article

  • Force Colloquy not to use built-in Growl notifications

    - by thepurplepixel
    Whenever Colloquy needs to pop up a notification (for example, when you are PM'd), it uses its built-in Growl notifications, which really annoy me because they stay on the screen until they are clicked (at least NOTICE's do anyways). I'd like to make Colloquy use the Growl that I have installed on my Mac, not its built-in Growl notifications. That way, I could change its preferences from the Growl .prefpane and it would match the look of all my other notifications. I seem to remember this being possible (maybe in a bug report or something), but I can't remember how. Thanks!

    Read the article

  • Why do I get "Sequence contains no elements"?

    - by Gary McGill
    NOTE: see edits at bottom. I am an idiot. I had the following code to process set of tag names and identify/process new ones: IEnumberable<string> tagNames = GetTagNames(); List<Tag> allTags = GetAllTags(); var newTagNames = tagNames.Where(n => !allTags.Any(t => t.Name == n)); foreach (var tagName in newTagNames) { // ... } ...and this worked fine, except that it failed to deal with cases where there's a tag called "Foo" and the list contains "foo". In other words, it wasn't doing a case-insensitive comparison. I changed the test to use a case-insensitive comparison, as follows: var newTagNames = tagNames.Where(n => !allTags.Any(t => t.Name.Equals(n, StringComparison.InvariantCultureIgnoreCase))); ... and suddenly I get an exception thrown when the foreach runs (and calls MoveNext on) newTagNames. The exception says: Sequence has no elements I'm confused by this. Why would foreach insist on the sequence being non-empty? I'd expect to see that error if I was calling First(), but not when using foreach? EDIT: more info. This is getting weirder by the minute. Because my code is in an async method, and I'm superstitious, I decided that there was too much "distance" between the point at which the exception is raised, and the point at which it's caught and reported. So, I put a try/catch around the offending code, in the hope of verifying that the exception being thrown really was what I thought it was. So now I can step through in the debugger to the foreach line, I can verify that the sequence is empty, and I can step right up to the bit where the debugger highlights the word "in". One more step, and I'm in my exception handler. But, not the exception handler I just added, no! It lands in my outermost exception handler, without visiting my recently-added one! It doesn't match catch (Exception ex) and nor does it match a plain catch. (I did also put in a finally, and verified that it does visit that on the way out). I've always taken it on faith that an Exception handler such as those would catch any exception. I'm scared now. I need an adult. EDIT 2: OK, so um, false alarm... The exception was not being caught by my local try/catch simply because it was not being raised by the code I thought. As I said above, I watched the execution in the debugger jump from the "in" of the foreach straight to the outer exception handler, hence my (wrong) assumption that that was where the error lay. However, with the empty enumeration, that was simply the last statement executed within the function, and for some reason the debugger did not show me the step out of the function or the execution of the next statement at the point of call - which was in fact the one causing the error. Apologies to all those who responded, and if you would like to create an answer saying that I am an idoit, I will gladly accept it. That is, if I ever show my face on SO again...

    Read the article

  • Who moved this PC here aka Locate which port on switch a PC is plugged into

    - by ggonsalv
    The catch is you have no SNMP access, not even public. The end vision is locate a PC in building easily even if PC's are moved around. The MAC address of the PC is known and the software would run as client on each desktop, reporting back which port the PC was plugged into. Well from a programmer perspective, my network skills are not the best. Yes I could use SNMP, download the MAC port table, load it into SQL, match it to the PC name. Seems alot of work. Lets say I ping a single point from the PC. Would the echo have some thing unique for each device on the same switch? All I need to identify some thing unique for each PC plugged into each port. If the PC was moved from location A to a different location then the unique response would change.

    Read the article

  • How to use objects as modules/functors in Scala?

    - by Jeff
    Hi. I want to use object instances as modules/functors, more or less as shown below: abstract class Lattice[E] extends Set[E] { val minimum: E val maximum: E def meet(x: E, y: E): E def join(x: E, y: E): E def neg(x: E): E } class Calculus[E](val lat: Lattice[E]) { abstract class Expr case class Var(name: String) extends Expr {...} case class Val(value: E) extends Expr {...} case class Neg(e1: Expr) extends Expr {...} case class Cnj(e1: Expr, e2: Expr) extends Expr {...} case class Dsj(e1: Expr, e2: Expr) extends Expr {...} } So that I can create a different calculus instance for each lattice (the operations I will perform need the information of which are the maximum and minimum values of the lattice). I want to be able to mix expressions of the same calculus but not be allowed to mix expressions of different ones. So far, so good. I can create my calculus instances, but problem is that I can not write functions in other classes that manipulate them. For example, I am trying to create a parser to read expressions from a file and return them; I also was trying to write an random expression generator to use in my tests with ScalaCheck. Turns out that every time a function generates an Expr object I can't use it outside the function. Even if I create the Calculus instance and pass it as an argument to the function that will in turn generate the Expr objects, the return of the function is not recognized as being of the same type of the objects created outside the function. Maybe my english is not clear enough, let me try a toy example of what I would like to do (not the real ScalaCheck generator, but close enough). def genRndExpr[E](c: Calculus[E], level: Int): Calculus[E]#Expr = { if (level > MAX_LEVEL) { val select = util.Random.nextInt(2) select match { case 0 => genRndVar(c) case 1 => genRndVal(c) } } else { val select = util.Random.nextInt(3) select match { case 0 => new c.Neg(genRndExpr(c, level+1)) case 1 => new c.Dsj(genRndExpr(c, level+1), genRndExpr(c, level+1)) case 2 => new c.Cnj(genRndExpr(c, level+1), genRndExpr(c, level+1)) } } } Now, if I try to compile the above code I get lots of error: type mismatch; found : plg.mvfml.Calculus[E]#Expr required: c.Expr case 0 = new c.Neg(genRndExpr(c, level+1)) And the same happens if I try to do something like: val boolCalc = new Calculus(Bool) val e1: boolCalc.Expr = genRndExpr(boolCalc) Please note that the generator itself is not of concern, but I will need to do similar things (i.e. create and manipulate calculus instance expressions) a lot on the rest of the system. Am I doing something wrong? Is it possible to do what I want to do? Help on this matter is highly needed and appreciated. Thanks a lot in advance. After receiving an answer from Apocalisp and trying it. Thanks a lot for the answer, but there are still some issues. The proposed solution was to change the signature of the function to: def genRndExpr[E, C <: Calculus[E]](c: C, level: Int): C#Expr I changed the signature for all the functions involved: getRndExpr, getRndVal and getRndVar. And I got the same error message everywhere I call these functions and got the following error message: error: inferred type arguments [Nothing,C] do not conform to method genRndVar's type parameter bounds [E,C genRndVar(c) Since the compiler seemed to be unable to figure out the right types I changed all function call to be like below: case 0 => new c.Neg(genRndExpr[E,C](c, level+1)) After this, on the first 2 function calls (genRndVal and genRndVar) there were no compiling error, but on the following 3 calls (recursive calls to genRndExpr), where the return of the function is used to build a new Expr object I got the following error: error: type mismatch; found : C#Expr required: c.Expr case 0 = new c.Neg(genRndExpr[E,C](c, level+1)) So, again, I'm stuck. Any help will be appreciated.

    Read the article

  • How do I enable write access for an sFTP only user under Ubuntu?

    - by Jon Cage
    I'm running Ubuntu 12.04 and am trying to configure a user to allow chroot'd sFTP connections to another section of the filesystem. I've added the following to my /etc/ssh/sshd_config file: Match Group mygroup X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp ChrootDirectory /home/%u I've set their home directory so that it's owned by root but has their group. I've created a mount --bind from /home/myuser/transfers to /my/filesystem which appears to be navigable. The problem I'm having is that I'm not able to write to any part of the filesystem which makes this pretty useless as an FTP server. What am I missing? What can I check?

    Read the article

  • How can I sign my server with an SSL certificate

    - by Saif Bechan
    I have a dedicated server and I want to use one domain name for default entrance to the system. My system is Apache 2 on CentOS 5.4. Lets says the domain name is mydomain.com. I have also bought an SSL certificate and installed it to work with this default domain. Still when I restart Apache I get the following error message: [Sat May 01 02:21:22 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?) [Sat May 01 02:21:22 2010] [warn] RSA server certificate CommonName (CN) `mydomain.com' does NOT match server name!? Does anyone have an idea how I can remove this message. I have the server, domain name, and ssl key.

    Read the article

  • Import LDIF file to external server

    - by colemanm
    As a follow-up to my previous question, which I've resolved part of, what we're trying to do now is take an exported .ldif file of the "Users" container on our OS X Server and import it into a separate OpenLDAP server on an EC2 instance. This we'll use for LDAP user authentication of other apps without having to open our internal network to LDAP traffic. The exported .ldif file thinks the DN of the "Users" container is cn=users,dc=server,dc=domain,dc=com. Is it easiest to configure the EC2 OpenLDAP server to think that it's domain is the same so the container is imported to the proper place? Or should we edit the text of the .ldif file to change the DN to match the external naming? Hopefully that makes sense... but I'm confused as to the best way to accomplish this.

    Read the article

  • Foward slash in kibana 3 query

    - by G Mawr
    I'm trying to add a query that will match a request that ends with a slash, like this one: n.n.n.n - - [16/Oct/2013:16:40:41 +0100] "GET / HTTP/1.1" 200 25058 "-" "Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A501 Safari/9537.53" I'm using the Lucene query type. If my query is set to *, I see the event. If I set it to request:"css", I see CSS requests, as expected. However, all of the following yield no results: request:"/" request:"\/" request:"\\/" I tried a Lucene regular expression, with no luck: request:/\// I note that someone else is getting what appears to be a similar issue, although that's on Kibana 2: https://github.com/rashidkpc/Kibana/issues/401 How can I query for requests that end with a / character?

    Read the article

  • How to redirect (or Alias) jump page with Apache

    - by Meltemi
    I'm not an Apache expert but need to make a small change to a web server. We are introducing a "jump page" URL that is different from a primary URL (for tracking reasons). /productA/index.html /productA/jump_index.html Basically i want to log that jump_index.html was requested and then return index.html. I don't want the client to wait 8 seconds or so for a redirect. How should we be handling this? Simply symlink (or alias) the file in the filesystem? Use mod_alias Alias Match (if so how exactly)? something better still?

    Read the article

  • Implementing Variable Envelope Return Path (VERP) using Exchange

    - by iammichael
    We're looking into implementing Variable Envelope Return Path (VERP) for improved bounce processing for our application. Our current mail infrastructure is MS Exchange 2007 but are in the process of upgrading to 2010. We're also implementing Postini for spam filtering. Exchange doesn't support sub-addressing (see also this question on disposable addresses) -- and VERP is somewhat of a specialized application of sub-addressing. Are there any options for implementing VERP in Exchange without putting another non-Exchange SMTP relay in front of Exchange to pre-process incoming messages? Specifically could a transport rule be created that could match against the target (non-existing) recipient, store that recipient address in a special header added to the message, and redirect the message to a pre-created mailbox? Note: we have developer resources available if custom code could be used somehow.

    Read the article

  • Need data on disk drive management by OS: getting base I/O unit size, "sync" option, Direct Memory A

    - by Richard T
    Hello All, I want to ensure I have done all I can to configure a system's disks for serious database use. The three areas I know of (any others?) to be concerned about are: I/O size: the database engine and disk's native size should either match, or the database's native I/O size should be a multiple of the disk's native I/O size. Disks that are capable of Direct Memory Access (eg. IDE) should be configured for it. When a disk says it has written data persistently, it must be so! No keeping it in cache and lying about it. I have been looking for information on how to ensure these are so for CENTOS and Ubuntu, but can't seem to find anything at all! I want to be able to check these things and change them if needed. Any and all input appreciated.

    Read the article

  • Partial generic type inference possible in C#?

    - by Lasse V. Karlsen
    I am working on rewriting my fluent interface for my IoC class library, and when I refactored some code in order to share some common functionality through a base class, I hit upon a snag. Note: This is something I want to do, not something I have to do. If I have to make do with a different syntax, I will, but if anyone has an idea on how to make my code compile the way I want it, it would be most welcome. I want some extension methods to be available for a specific base-class, and these methods should be generic, with one generic type, related to an argument to the method, but the methods should also return a specific type related to the particular descendant they're invoked upon. Better with a code example than the above description methinks. Here's a simple and complete example of what doesn't work: using System; namespace ConsoleApplication16 { public class ParameterizedRegistrationBase { } public class ConcreteTypeRegistration : ParameterizedRegistrationBase { public void SomethingConcrete() { } } public class DelegateRegistration : ParameterizedRegistrationBase { public void SomethingDelegated() { } } public static class Extensions { public static ParameterizedRegistrationBase Parameter<T>( this ParameterizedRegistrationBase p, string name, T value) { return p; } } class Program { static void Main(string[] args) { ConcreteTypeRegistration ct = new ConcreteTypeRegistration(); ct .Parameter<int>("age", 20) .SomethingConcrete(); // <-- this is not available DelegateRegistration del = new DelegateRegistration(); del .Parameter<int>("age", 20) .SomethingDelegated(); // <-- neither is this } } } If you compile this, you'll get: 'ConsoleApplication16.ParameterizedRegistrationBase' does not contain a definition for 'SomethingConcrete' and no extension method 'SomethingConcrete'... 'ConsoleApplication16.ParameterizedRegistrationBase' does not contain a definition for 'SomethingDelegated' and no extension method 'SomethingDelegated'... What I want is for the extension method (Parameter<T>) to be able to be invoked on both ConcreteTypeRegistration and DelegateRegistration, and in both cases the return type should match the type the extension was invoked on. The problem is as follows: I would like to write: ct.Parameter<string>("name", "Lasse") ^------^ notice only one generic argument but also that Parameter<T> returns an object of the same type it was invoked on, which means: ct.Parameter<string>("name", "Lasse").SomethingConcrete(); ^ ^-------+-------^ | | +---------------------------------------------+ .SomethingConcrete comes from the object in "ct" which in this case is of type ConcreteTypeRegistration Is there any way I can trick the compiler into making this leap for me? If I add two generic type arguments to the Parameter method, type inference forces me to either provide both, or none, which means this: public static TReg Parameter<TReg, T>( this TReg p, string name, T value) where TReg : ParameterizedRegistrationBase gives me this: Using the generic method 'ConsoleApplication16.Extensions.Parameter<TReg,T>(TReg, string, T)' requires 2 type arguments Using the generic method 'ConsoleApplication16.Extensions.Parameter<TReg,T>(TReg, string, T)' requires 2 type arguments Which is just as bad. I can easily restructure the classes, or even make the methods non-extension-methods by introducing them into the hierarchy, but my question is if I can avoid having to duplicate the methods for the two descendants, and in some way declare them only once, for the base class. Let me rephrase that. Is there a way to change the classes in the first code example above, so that the syntax in the Main-method can be kept, without duplicating the methods in question? The code will have to be compatible with both C# 3.0 and 4.0. Edit: The reason I'd rather not leave both generic type arguments to inference is that for some services, I want to specify a parameter value for a constructor parameter that is of one type, but pass in a value that is a descendant. For the moment, matching of specified argument values and the correct constructor to call is done using both the name and the type of the argument. Let me give an example: ServiceContainerBuilder.Register<ISomeService>(r => r .From(f => f.ConcreteType<FileService>(ct => ct .Parameter<Stream>("source", new FileStream(...))))); ^--+---^ ^---+----^ | | | +- has to be a descendant of Stream | +- has to match constructor of FileService If I leave both to type inference, the parameter type will be FileStream, not Stream.

    Read the article

  • I have a mail server that hosts several client emails but 1 in particular is being blocked because of its SBRS score

    - by Vince Saavedra
    If I was hosting emails for 3 clients and my reverse DNS is mail.allclients.com and I am hosting for client2.com, client3.com etc. What would be the rDNS for client3.com? Would it reflect the rDNS of mail.allclients.com? If so, I do I prevent mails from client3.com from being blocked because the PTR does not match rDNS? Finally on your advice to have my email service publish an SPF record. Is this something I need to submit to the company I registered my mail.allclients.com to? So I for example registered with GoDaddy.com then I will need to submit a request to them to publish an SPF record on their DNS right? Thank you for your advice and kind assistance. Vince Saavedra

    Read the article

  • Horrible performing RAID

    - by Philip
    I have a small GlusterFS Cluster with two storage servers providing a replicated volume. Each server has 2 SAS disks for the OS and logs and 22 SATA disks for the actual data striped together as a RAID10 using MegaRAID SAS 9280-4i4e with this configuration: http://pastebin.com/2xj4401J Connected to this cluster are a few other servers with the native client running nginx to serve files stored on it in the order of 3-10MB. Right now a storage server has a outgoing bandwith of 300Mbit/s and the busy rate of the raid array is at 30-40%. There are also strange side-effects: Sometimes the io-latency skyrockets and there is no access possible on the raid for 10 seconds. The file system used is xfs and it has been tuned to match the raid stripe size. Does anyone have an idea what could be the reason for such a bad performing array? 22 Disks in a RAID10 should deliver way more throughput.

    Read the article

  • Return cell reference as result of if statement with vlookups.

    - by EMJ
    I have two sets of data in excel. One contains a set of data which represents the initial step of a process. The other set of data represents the additional steps which take place after the first step is completed. Each of the data records in the "additional step data" has an id in a column. I need to find the identifying codes of the "additional step data" which correspond with the initial step data records. The problem is that I have to match the data in 4 columns between the two data sets and return the id of the "additional step data". I started by doing a combination of an if and vlookup functions, but I got stuck when I tried to figure out how to get the if statement to reference the id of the matching "additional step data". Basically I am trying to avoid having to search by manually filtering between two sets of data and finding corresponding records. Does anyone have any idea about how to do this?

    Read the article

  • Combining lists of objects containing lists of objects in c#

    - by Dan H
    The title is a little prosaic, I know. I have 3 classes (Users, Cases, Offices). Users and Cases contain a list of Offices inside of them. I need to compare the Office lists from Users and Cases and if the ID's of Offices match, I need to add those IDs from Cases to the Users. So the end goal is to have the Users class have any Offices that match the Offices in the Cases class. Any ideas? My code (which isnt working) foreach (Users users in userList) foreach (Cases cases in caseList) foreach (Offices userOffice in users.officeList) foreach (Offices caseOffice in cases.officeList) { if (userOffice.ID == caseOffice.ID) users.caseAdminIDList.Add(cases.adminID); }//end foreach //start my data classes class Users { public Users() { List<Offices> officeList = new List<Offices>(); List<int> caseAdminIDList = new List<int>(); ID = 0; }//end constructor public int ID { get; set; } public string name { get; set; } public int adminID { get; set; } public string ADuserName { get; set; } public bool alreadyInDB { get; set; } public bool alreadyInAdminDB { get; set; } public bool deleted { get; set; } public List<int> caseAdminIDList { get; set; } public List<Offices> officeList { get; set; } } class Offices { public int ID { get; set; } public string name { get; set; } } class Users { public Users() { List<Offices> officeList = new List<Offices>(); List<int> caseAdminIDList = new List<int>(); ID = 0; }//end constructor public int ID { get; set; } public string name { get; set; } public int adminID { get; set; } public string ADuserName { get; set; } public bool alreadyInDB { get; set; } public bool alreadyInAdminDB { get; set; } public bool deleted { get; set; } public List<int> caseAdminIDList { get; set; } public List<Offices> officeList { get; set; } }

    Read the article

  • gcServer config not taking effect

    - by G33kKahuna
    I'm supporting a ASP.NET v2.0 app installed on a Windows 2003 SP3 Enterprise on a quad core 8G machine running on .NET 2.0 SP1. 1.before enabling the config, ran "tasklist /m mscorwks.dll" Image Name PID Modules w3wp.exe 7888 mscorwks.dll 2.add under section in web.config 3.ran IISRESET, rebooted server too 4.ran "tasklist /m mscorsvr.dll" INFO: No tasks are running which match the specified criteria. 5.ran "tasklist /m mscorwks.dll" Image Name PID Modules w3wp.exe 6251 mscorwks.dll It seems like gcServer is not taking effect. Are there any additional settings/ configurations necessary to get it working?

    Read the article

  • SVN Merge two reposiories - what about the UUIDs?

    - by grant007
    Hi, This is my scenario: Originally had two seperate repositories, I need to merge these into one repository. I don't care too much about the history in these repositories. I created a new repository and can import the repositories no problem. The issue is with users working copies, I can ask them to switch --relocate them however there is the issue of the UUID which will be different for each original repository: I can only reassign the UUID in the new repository to match one of the original repositories. So what is the best method to resolve this issue? (I suspect/hope I am going about this wrong...) Any ideas appreciated! -Grant.

    Read the article

  • Sharepoint 2010 Restore .bak Error

    - by Quiel
    I'm having issues with restoring my .bak files to my own sharepoint environment due to version difference. My version is currently: Sharepoint Server with Enterprise Client Access License Ms sharepoint Foundation 2010 core : 14.0.4763.1000 Security Update of Ms sharepoint Foundation 2010(kb2494001) 14.0.6106.5008 Server Version(Where I'm creating my Backups): SharePoint Server with Enterprise Client Access License Microsoft SharePoint Foundation 2010 Core : 14.0.4763.1000 Security Update for Office SharePoint Foundation 2010 (KB2345322) : 14.0.5123.5002 I would like to know if there is a way I could enable my backups from the Server to be compatible with my version. My only option is to downgrade my version since I'm not an admin to the server. Does my Client Access License an issue? Can I just downgrade my security update to match the one in the server? If there is would you please be kind enough to tell me how. ?

    Read the article

< Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >