Thursday, 15 April 2010

c# - WCF Service, how to get the web site URL from within a class library? -


I have a WCF service running in IIS, which functions in a class library where httpContext is available. How can I get a web site URL dynamically, it can also be a virtual directory?

You can create a ServiceHostFactory that launches your service host manually, then your application Here is a simple example:

(in your myService.svc):

  & lt;% @, store the endpoint address in a static category used by Servicehost service = "MyNamespace.MyService" factory = "MyNamespace.MyServiceHostFactory" & gt%;  

(in your MyServiceHostFactory.cs):

  /// & lt; Summary & gt; Increases ServiceHostFactory to allow access to /// ServiceHostFactory. /// & lt; / Summary & gt; Public category MyServiceHostFactory: ServiceHostFactory {/// & lt; Summary & gt; /// Creates a new ServiceHost using the specified service and base address /// & lt; / Summary & gt; /// & lt; Param name = "service type" & gt; & Lt; / Param & gt; /// & lt; Param name = "baseAddresses" & gt; & Lt; / Param & gt; /// & lt; Returns & gt; & Lt; / Returns & gt; Protected Override ServiceHost CreateServiceHost (Type Service Type, URI [] baseAddresses) {ServiceHost host; Host = new service host (service type, baseadress); MyGlobalStaticClass.Address = baseAddresses [0]; // Assume that you want to know the endpoint first; return host; }  

(in your MyGlobalStaticClass.cs):

  public static string address = "";  

compilation - Error in compiling a Linux kernel -


आप त्रुटियों को कैसे पढ़ते हैं?

/ Home / aal / build / kernel पर config -file।

  /usr/src/linux-2.6$ हे बनाम ओ / होम / एलाल / बिल्ड / कर्नल /   

मुझे मिल

  ... cut ... सीसी [एम] ड्राइवर / मंच / go7007 / s2250-board.o /usr/src/linux-2.6/drivers/ मचान / go7007 / s2250-board.c: 24: 26: त्रुटि: s2250-loader.h: ऐसा कोई फ़ाइल या निर्देशिका /usr/src/linux-2.6/drivers/staging/go7007/s2250-board.c: फ़ंक्शन में 'Read_reg_fp': /usr/src/linux-2.6/drivers/staging/go7007/s2250-board.c:264: चेतावनी: असंगत सूचक प्रकार /usr/src/linux-2.6/include से 'down_interruptible' का तर्क 1 पास करना /linux/semaphore.h43: नोट: अपेक्षित 'स्ट्रक्चर सिक्वॉर *' पर तर्क तर्क प्रकार का है जो 'स्ट्रेट म्यूट x *' /usr/src/linux-2.6/drivers/staging/go7007/s2250-board.cailand73: चेतावनी: असंगत सूचक प्रकार से 'अप' का तर्क 1 पास करना /usr/src/linux-2.6/include/linux/semaphore.h:47: n Ote: अपेक्षित 'स्ट्रक्चर सिक्वॉर *' लेकिन तर्क 'प्रकार' स्ट्रेट म्यूट x * /usr/src/linux-2.6/drivers/staging/go7007/s2250-board.c की है: फ़ंक्शन के '2250_इनिट ': / usr / src / Linux-2.6 / drivers / staging / go7007 / s2250-board.c: 670: त्रुटि: फ़ंक्शन '2250 लोडर_इनिट' /usr/src/linux-2.6/drivers/staging/go7007/s2250-board.c:676 के अंतर्निहित घोषणा: त्रुटि: फ़ंक्शन '2250 लोडर_क्लानुप' के गर्वित घोषणा: '[4]: *** [ड्राइवरों / स्टेजिंग / go7007 / s2250-board.o] त्रुटि 1 बनाओ [3]: *** [ड्रायवर / स्टेजिंग / go7007] त्रुटि 2 मेक [2]: *** [ड्राइवर / मंच] त्रुटि 2 बना [1]: *** [ड्राइवर] त्रुटि 2 बनाते हैं: *** [सब-मेक] त्रुटि 2  

अपने .config से उस ड्रायवर के संदर्भ को निकालें और समस्या दूर हो जाएगी। वैकल्पिक रूप से यदि आपको ड्रायवर को स्रोत के लिए उपयुक्त चाहिए।

ये सभी त्रुटियां गायब हैंडर के कारण होती हैं।


DB Operations in asp.net with c# -


I have a question from an interviewer:

If two users open the same page, then One person is adding 105 records and one person is removing the same record, what happens in this scenario?

How do I answer?

This is a bit strange, because records have not been destroyed yet, if it was reached together anybody Also, I'm sure they are seeing constitutionalism, and possibly probably.

Take a look, it is showing how to apply optimist conductor with ASP.NET.


JQuery Navigation Menu Animation with Wordpress Page List -


So I'm using Jquery to display a pop up menu on my existing site. HTML is a WordPress wp_list_pages output for all your kind WordPress types. For all your non-wordpress types, this means that WordPress nested ul & amp; According to the architecture on the page below the line elements, I want the Java code to be compatible with WordPress, so if I change the pages, the code handles it.

I think the code should be light, but there is a bit below Junky. Any better ideas? Also, I see the pop-up menu only on the UL element for 1000ms (1s), but not otherwise. idea?

  jquery (document) .ready (function () {jQuery.fn.pauseit = function} {jQuery (this). Value ({dummy: 1}, duration); return it ;};}); JQuery (document) .ready (function () {jQuery ("div # access li.page_item ul"). CSS ({display: "none"}); // Opera Fix jQuery ("div # access li.page_item") Fade (':' 'none').) Fadeine ('fast');}, function () {jQuery (this) .find ('ul: first'). CSS Feeds ('sharp');});});  

So I searched hoverIntent that resolved my problem.


javascript - Using onComplete Event and Pages.xml -


I have a "a4j: commandButton" which runs some JavaScript on . " Event A " Action " is also calling a method.

    

I am using pages.xml in the seam to change a different page when that method is called.

  & lt; pageview-id = "/ web pages / page1.XML"> gt; Navigation from-action = "# {Bean. Method ()} "& gt; See redirecter- id =" / webpage / page 2.xml "/>   

Problem:

In order to call me when page 2 is loaded, the complete method should call "thisJavaFunction ()". However, because it is a separate page, but not a complete event.

I can use an open event in the body of page 2, but I can not use it because the page 2 uses the template which uses other pages (Like page 1), this means that when other pages are called from an on-loading event, it is called.

Is there a way to get around this ?


python - Can I combine two 'findAll' search blocks in beautifulsoup, into one? -


Can I combine these two blocks into one:

EDIT: Loops like Yacoby No other method was in response to the combination of. Soup.find all (['script', 'form'] for tags in

  tag: tag.extract () for tag in soup.find all (id = "footer") : Tag.extract ()  

In addition to this, I can do several blocks from one:

soup.findle (id = "footer" ): Tags for tags in Soup.findAll (id = "content"). Extract (): tags for tags in soup.find all (id = "links") .extract (): tag.extract () < / Code>

or there may be some lambda expressions, where I can check in the array or in some other simpler method

In addition to how can I get the tag with the attribute class, as is the class reserved keyword:

Edit: This part is solved by soup. Attrs = {'class': 'noprint'}):

  for tag in soup.findAll (class = "noprint"): tag. Extract ()  

Yo You [