Thursday 15 January 2015

mod rewrite - mod_rewrite "too many redirects" problem -


कोशिश कर रहा है,

  & lt; ifmodule mod_rewrite.c & gt; रीवाइटइन्गइन ऑन रीराइटकंड पर% {REQUEST_METHOD} ^ ट्रेसे रीराइटराइल। * - [एफ] रीवर्टकंड% {HTTP_HOST} ^ (। *) देव \ .example \ .edu $ [एनसी] रीराइटरेले ^ / टेस्ट (। *) $ Http: // Dev.example.edu/test/index.php/test$1 [NC] & lt; / IfModule & gt;  

एक अपाचे 2.2 सर्वर पर, इस पुनर्लेखन को पथ के "index.php / test" भाग को छिपाने के लिए काम करने के लिए।

मैंने जो कुछ भी कोशिश की है पता बार में यूआरएल भाग (index.php / test) को छोर देता है या "बहुत सारे रीडायरेक्ट्स" त्रुटि देता है।

मुझे संदेह है कि दोनों पक्षों पर होने वाले समीकरण का "परीक्षण" हिस्सा इसे फेंक रहा है बंद है लेकिन मुझे यकीन नहीं है कि इसे कैसे काम करना है।

मुझे बस चाहते हैं: dev.example.edu/test/index.php/test* को फिर से लिखना: dev.example.edu/test/*

धन्यवाद

एक अनन्त पुनरावर्तन से बचने के लिए आपको गंतव्य पथ को बाहर करना होगा:

  रीवाइटकंड% {HTTP_HOST} ^ (। *) Dev \ .example \ .com $ [NC] रीवर्टकॉन्ड $ 1! ^ / अनुक्रमणिका \ .php / test / rewriterule ^ / test / (। *) $ Http://dev.example.com/test/index.php/test/$1 [एनसी]  

यहां पहले समूह का मिलान ( $ 1 ) ^ / index \ .php / test / से मेल नहीं खाता है।

लेकिन अगर आप /test/index.ph को फिर से लिखना चाहते हैं P / test / ... से / test / ... , आपको इस नियम की आवश्यकता होगी:

  पुनर्लेखन% {HTTP_HOST} ^ (। *) Dev \ .example \ .com $ [NC] रीव्रेट नियम ^ / अनुक्रमणिका \ .php / test /(.*)$ http://dev.example.com/test/$1 [NC]  
< / div>

Invoking Task UI in Siebel 8 -


I am trying to open a task UI in Sebel 8 and can not find anywhere.

I have added a button to an applet, with the method "launch task" and the following control user prop: name: function name value:

that button also appears in the UI Does not give

Does anyone know why the button is not shown?

I have activated and deployed the work, and it is running on a dedicated client against my local database.

I also tried to implement the task from the applet server script, as told in bookshelf

Any help would be appreciated.

Thank you, Thomas

Hmm, I got a problem.

My responsibilities did not have access to work.

The problem is resolved.


java me - Question about OSGi for embedded -


I'm going to work on OSGi-based embedded / mobile applications. I need to clarify some confusing questions.

(1) Can the Equinox J2ME run on the environment or not?

(2) How to start Equinox OSGI container under pure J2ME environment (not installed JDK and JRE)?

(3) Do I have some external jar / third party jar (which is based on JRE classes) for embedded applications?

Thank you!

Java ME is a part of an "embedded" environment, which means that among other things Generally there is not enough memory to run in storage space or there were limitations of application size at one time.

This means that instead of dumping large, fat, JSCe jar into a device with limited capabilities, you should try again to think what you are trying to achieve.

Also consider that there is a version of Java that mobile phones are quite limited, many 'regular' Java applications and libraries will not work there.

By dumping your jar applications, taking your stuff and making them into a jar.

In other words, you have to think differently about Java ME - this is not a bloated world that lives in most Java stuff.


algorithm - accurate single pass penny computation -


We have a cost which should be assigned to the departments 1.nn another calculation to produce the share for each department It is 0 to 1 number with more than 5 decimal places. The sum of shares in all departments is exactly 1, but they are not necessarily equal.

The goal is to calculate the correct dollar and cents to bill each department. The sum of the bill must surely match the cost C, it can not be a few pennies or less, besides each Departmental stake should not require partial pennies. In addition, although this is not only appropriate to leave the rest on the final department, but it is not necessary to look back at the previous timeframe. Note that the shares of each department are almost always rounded up to the pan, almost always above / below some pennies.

Broadly the maximum example: C = 33.34, with each 4 department ok 0.2500 shares. Because 33.34 * 0.25 = 8.335 so you can see that the two departments have to pay 8.33 and the two have to pay 8.34. A correct assignment would be: D1 = 8.33, D2 = 8.34, D3 = 8.33, D4 = 8.34. If you score a goal, then every department pays 8.34, which results in an overage of $ 0.02. If you multiply it by several departments and many more costs, then you end up with a hundred dollar discrepancies.

I want to do it in close passage, that is, I do not want to do it through the loop. I am away from 0.02, then loop again and values ​​until it is not right. I want to do this in 1 pass. I would also like to know that this is the name of the algorithm.

In Perl:

  #! Use / usr / bin / perl strict; Use warnings; Use data: Dumper; Use list: AllUtils qw (sum); Print dumper allocation (10_000, .23, .37, .4); Print dumper allocation (33.34, .25, .25, .25, .25); Print dumper allocated (100, 1/3, 1/3, 1/3); Sub Allocation {My ($ C, @shares) = @_; My @alloc; While (my $ share = change @share) {push @alloc, sprintf '% .2f', $ C * $ share; $ C - $$ alloc [-1]; My $ denom = sum = shares; $ Shares for $ _ / = $ denom; } Return \ @alloc; }  

Output:

$ VAR1 = ['2300.00', '3700.00', '4000.00']; $ VAR1 = ['8.34', '8.33', '8.34', '8.33']; $ VAR1 = ['33.33 ', '33.33', '33.33 '];

Where is the latest revision of subsonic 3? -


When I click on the big download button

The version I'm receiving is the 3 additional versions listed for download on the download panel. Which is the most recent, default or 3.0.0.3?

And what big downloads button does everything get to that version?

master in Git Branch), this is a potentially maintained code in the store and it should be avoided in the production environment.

To answer your question in particular, Code> 3.0.0.3 , unless you probably want unwanted, beta-quality code.

More For reliable information, check.


c++ - How to catch the null pointer exception? -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 8 जवाब
  try {int * पी = 0; * पी = 1; } पकड़ (...) {cout & lt; & lt; "नल पॉइंटर।" & Lt; & lt; endl; }  

मैंने इस तरह के अपवाद को पकड़ने की कोशिश की लेकिन यह काम नहीं करता, कोई मदद?

सी ++ में "नल पॉइंटर अपवाद" जैसी कोई चीज नहीं है केवल अपवाद जो आप पकड़ सकते हैं, यह स्पष्ट है कि फेंक अभिव्यक्ति (प्लस के रूप में, जैसा कि पावेल ने लिखा है, मानक ऑपरेटर नई , द्वारा आंतरिक रूप से फेंक दिया गया कुछ मानक C + गतिशील_कास्ट आदि)। सी ++ में कोई अन्य अपवाद नहीं हैं शून्य पॉइंटर्स की व्याख्या करना, शून्य आदि से विभाजन सी + + में अपवाद उत्पन्न नहीं करता है, यह अपरिभाषित व्यवहार का उत्पादन करता है यदि आप मामलों में फेंकने के अपवाद चाहते हैं जैसे कि मैन्युअल रूप से इन स्थितियों को पहचानने और फेंकना स्पष्ट रूप से इनकी जिम्मेदारी है सी ++ में ऐसा कैसे काम करता है।

जो कुछ भी आप चाहते हैं वह सी ++ भाषा के साथ नहीं कर रहा है, बल्कि विशेष कार्यान्वयन की विशेषता है। दृश्य सी ++ में, उदाहरण के लिए, सिस्टम / हार्डवेयर अपवादों को सी + + अपवादों में "रूपांतरित" किया जा सकता है, लेकिन इस गैर-मानक कार्यक्षमता से जुड़ी कीमत होती है, जो आमतौर पर भुगतान करने योग्य नहीं होती है।


ruby - Turning a hash into a string of name-value pairs -


If I change Ruby hash into a string of name-value pairs (for example, used in HTTP parameters) Am), is this the best way?

Define the hash field = {"a" = & gt; "Foo", "B" = & gt; "Bar"} # Move it to the name-value string http_params = fields.map {| K, v | "# {K} = # {v}"}. ('& Amp;')

I think my question is:

Is there an easy way to go to http_params ? Given, works in the above way and is quite straightforward, but I'm curious if there is any way of getting the string in the string without creating an array (the result of the first map method)?

This is probably the best that you can do. You can repeat through the couple in Josh, you can go as you build the string. But in this case the intermediate string must be created and destroyed in each step.

Do you have any use-cases where this is a performance barrier? In general, Ruby is working behind scenes so that worrying about such a temporary array is probably not worth it. If you are worried that this may be a problem, then your code for speed and memory usage Consider entering, often results do not expect you.


Are there "Type-unsafe" function parameters in c# and how could we make one? -


  सार्वजनिक सूची & lt; string & gt; विशेषताएं = नई सूची & lt; स्ट्रिंग & gt; (); सार्वजनिक शून्य जोड़ें (स्ट्रिंग कुंजी, स्ट्रिंग मान) {if (value.ToString ()! = "") {Attributes.Add (key + "= \" "+ value +" \ ""); }} सार्वजनिक शून्य जोड़ें (स्ट्रिंग कुंजी, इंट वैल्यू) {if (value.ToString ()! = "") {Attributes.Add (key + "= \" "+ value +" \ ""); }}  

अतः, दो जोड़ कार्यों के बजाय, क्या हम सिर्फ एक ही कर सकते हैं? उदाहरण के लिए

  सार्वजनिक शून्य जोड़ें (स्ट्रिंग कुंजी, & lt; var & gt; मान) {if (value.ToString ()! = "") {Attributes.Add (key + "= \" " + मान + "\" "); }}  

ध्यान दें कि इस मामले में, आपके फ़ंक्शन का पूर्णांक संस्करण होना चाहिए सूची में शामिल करने के लिए वैसे भी एक स्ट्रिंग में कनवर्ट किया गया। इसलिए यदि आपकी पूरी समस्या वास्तव में बताई गई है, तो आपको केवल अपने फ़ंक्शन के स्ट्रिंग संस्करण की आवश्यकता है और इसे इस पर कॉल कर सकते हैं:

  int SomeValue = 42; स्ट्रिंग SomeName = "जीवन को उत्तर, ब्रह्मांड और सब कुछ"; जोड़ें (कुछनाम, SomeValue.ToString ());  

लेकिन यदि आप अधिक सामान्य समस्या के बारे में पूछ रहे हैं, तो आप इस तरह से वस्तु प्रकार का उपयोग कर सकते हैं:

  सार्वजनिक शून्य जोड़ें (स्ट्रिंग कुंजी, ऑब्जेक्ट मान) {if (value! = Null) {attributes.Add (key + "= \" "+ value.ToString () +" \ ""); }}  

या इससे भी बेहतर, बस स्ट्रिंग का उपयोग करें। फ़ॉर्मैट:

  स्ट्रिंग.फ़ॉर्मेट ("{0} = \" {1} \ "" , कुछनाम, कुछ वैल्यू);  

how to get a UITextView to Clear like a UITextField does -


Trying to get IITextView to clean UITextField to clear like IITextField I send a lot of things like email or tweet with multiple lines of text; Any code will be very much thank you very much

About adding a button and then:

  - (IBAction) Clearfield: (ID) sender {textView.text = @ ""; // TextView Type UITextView}  

c# - Is it appropriate to cast ContentPresenter.Content to UIElement? -


Is there a situation where ContentPresenter is the content of UIElement ? Given that the field has been declared as an object instead of UIElement , it seems that it will happen, however, I can not think of any situation where it is, or even That it is also valid.

  ContentPresenter presenter = GetTemplateChild (PART_Presenter) as ContentPresenter; UIElement myElement = (UIElement) presenter. Material; MyElement.SomeUIMethod (); // Possible invalid operation exceptions?  

I do this all the time - and complete MVVM method non- UIElement Content, here is an example:

Create a class that is not derived from the UIElement , I will call MyViewModelClass in this example.

Create a window and add this code

  public partial squares window 1: window {public window 1 () {DataContext = new MyViewModelClass (); InitializeComponent (); }}  

and add some content controls to XAML:

  & lt; Button content = "{binding}" />  

Now you have a ContentPresenter (inside the button control template) with MyViewModelClass as the content.

Another (probably more common) example, for example, each ListBoxItem has a ContentPresenter which is in the list, whichever is it < Set the code> ItemControl ItemSource .


javascript - Viewing LCOV file in Windows -


Background: I used JsTestDriverCoverage and has prepared a test coverage report for my Javascript unit tests.

Q: Is there a way to convert files to a more readable format (using the command), or are you using other applications to read the file?

Thank you.

Use the zenith to convert it to a set of HTML files


Problem with DataAnnotationsModelBinder in ASP.NET MVC 2 -


Everyone tried a tutorial on data encryption? It was not working for me
When I'm trying to submit the edited product, I get this error message:
Method not found: 'System.Collections.Generic.IDictionary`2 System.Web .mvc. ModelBindingContext.get_ValueProvider () '.
I am using ASP.NET MVC preview 2. 2. Why is this any thoughts happening? I need a model binder for them.
Have you come to a post or article on which the guide was how to work it?

Data encryption model binder in ASP.NET MVC 2 is the default model binder, you register the model binder There is no need to do this because it is in the tutorial. So remove the line you register model binders.

In addition, when you are on it, you should probably get it updated.

HTH,
Charles


python - Inheriting specific parent model attributes in foreignkey->'self' relationship in Django -


मेरे पास एक Django मॉडल है:

  class Foo (models.Model): name = Model.CharField (अनोखा = सच) विशेषता 1 = मॉडल। फ्लोटफ़ील्ड (नल = सच, रिक्त = सच) विशेषता 2 = मॉडल। फ्लोटफ़ील्ड (नल = सच, रिक्त = सच) विशेषता 3 = मॉडल। बूलियन फिल्ड (शून्य = सच, रिक्त = सच) Attribute4 = models.CharField (null = True, blank = true) inherit = models.ForeignKey ('self', related_name = 'children', null = true, blank = true)  

I ऐसा करना चाहूँगा कि जब उत्तराधिकार रिक्त / रिक्त नहीं है, तो उस विशेषता 1 और विशेषता 2 आदि को मूल वस्तु से प्राप्त किया जाता है inherit ताकि जब मैं विशेषताओं का उपयोग करता हूं, तब मुझे मान मिल जाते हैं माता-पिता का मैं बच्चे में मूल्यों को निर्धारित करने की परवाह नहीं करता हूं।

मैंने मॉडल विधियों का उपयोग करने के बारे में सोचा है जैसे।:

  _attribute1 = models.FloatField (null = true, blank = true) Get_attribute1 (स्वयं): यदि self.inherit: return self.inherit._attribute1 else: return self._attribute1 set_attribute1 (स्वयं, मान): यदि नहीं self.inherit: self._attribute1 = value attribute1 = property (get_attribute1, set_attribute1)   

लेकिन मेरे बारे में 10 विशेषताओं के बाद से यह बदसूरत लग रहा है। क्या ऐसा करने का एक बेहतर तरीका है?

शायद __ getattr __ और < कोड> __ सेटैट्र __ यहां एक अच्छा विकल्प है।

  वर्ग फू (models.Model): name = models.CharField (अनन्य = सत्य) inherit = models.ForeignKey ('self' , संबंधित_नाम = 'बच्चों', नल = सच, रिक्त = सत्य) _attribute1 = मॉडल। फ्लोटफ़िल्ड (नल = सच, रिक्त = सत्य) _attribute2 = मॉडल। फ्लोटफ़िल्ड (नल = सत्य, रिक्त = सत्य) _attribute3 = मॉडल। बुलियनफिल्ड (रिक्त = सच = रिक्त = सत्य) _attribute4 = models.CharField (नल = सच, रिक्त = सच) def __getattr __ (स्वयं, नाम): अगर self.inherit और hasattr (self.inherit, नाम): वापसी getattr (self.inherit, रिटर्न सुपर (फू, सेल्फ) .__ Getattr __ (नाम) def __setattr __ (आत्म, नाम, मान) रिटर्न सुपर (रिवर्स गेटेटर (सेल्फ, '_' + नाम, कोई नहीं) : यदि self.inherit और hasattr (self.inherit, नाम): वापसी सेटैट आर (self.inherit, name, value) एलीफ हैटट्रर (स्वयं, '_' + नाम): रिटर्न स्व .__ डायस्ट __ [नाम] = मान रिटर्न सुपर (फू, सेल्फ) .__ सेटैट्र __ (नाम, वैल्यू)  < / Pre> 

अस्वीकरण: मैंने इसे चलाने की कोशिश नहीं की


installer - WiX: Passing Install path to managed custom action -


New day, new problem ;-) still conflict with managed custom action I already have a custom action Has been able to make a call and pass some test data. Now I have to change the test data through actual data. And the problems start here: I want to call the batch file which was installed in the subdirectory of my establishment. That's why I have to pass the installation path in custom action. It can be done using customAnadet Data Mechanism but this does not work when I log in to the installation, I can see that the custom is pointing to the right path outside the installation, but as soon as I see it in customization I have a customAntaData property empty ...

Can anyone get a look on my code and give me a tip that I am doing wrong? Thanks in advance!

Merge module that calls a custom action:

  & lt; Module ID = "DflHelpInstaller" language = "1033" version = "1.0.0.0" & gt; ; & Lt; Package id = "f952de58-1dc6-46b3-872a-7a49e2d9ea0a" manufacturer = "DflHelpInstaller" installerVersion = "200" /> & Lt; Binary ID = 'RegisterDflHelpDll' sourcefile = "$ (var.REGISTERHELP.TargetDir) RegisterDflHelp.CA.dll" /> & Lt; Custom Action ID = 'RegisterDflHelp' BinaryKey = 'RegisterDflHelpDll' DllEntry = 'RegisterDflHelp' Execute = 'Deferred' /> & Lt; Custom Action ID = "RegisterDflHelp.SetProperty" Returns = "Check" Property = "RegisterDflHelp" value = '[INSTALLLOCATION]' Execute = 'Instant' /> & Lt; InstallExecuteSequence & gt; & Lt; After custom action = 'RegisterDflHelp.SetProperty' = 'CostFinalize' / & gt; & Lt; After custom action = 'RegisterDflHelp' = 'InstallFiles' / & gt; & Lt; / InstallExecuteSequence & gt; & Lt; Directory Id = "TARGETDIR" name = "SourceDir" & gt; & Lt; / Directory & gt; & Lt; ComponentGroupRef id = "Help Group" /> & Lt; / Module & gt; & Lt; / Wix & gt;  

  & lt; Directory id = "turgitidir" name = "SourceDir" & gt; & Lt; Directory Id = "ProgramFilesFolder" Source Name = "PFFiles" & gt; & Lt; Directory id = "company" name = '$ (var.COMPANY)' & gt; & Lt; Directory id = "INSTALLLOCATION" source name = '$ var.v [SDK_VERSION]' & gt; & Lt; Component ID = "MyBanner" guide = "C8C 28B92-9326-4991-1BFB1-BbDFDF 3653AB" & gt; & Lt; File id = "banner.bmp" source = "banner.bmp" pyth = "yes" disk id = "1" /> & Lt; / Component & gt; & Lt; Merge ID = "DflHelpInstaller" SourceFile = "DflHelpInstaller.msm" language = "1033" diskID = "1" /> & Lt; / Directory & gt; & Lt; / Directory & gt;  

....

  & lt; Feature ID = "Full" title = "Setup" Details = "Installs SDK on your local machine." Display = "detail" level = "1" configurable directory = "INSTALLLOCATION" & gt; & Lt; ComponentRef Id = "Banner" /> & Lt; ComponentRef Id = "UNINSTALLER" /> & Lt; ComponentGroupRef id = "Reference group" / & gt; & Lt; MergeRef id = "DflHelpInstaller" /> & Lt; / Feature & gt; Custom Action:  
  Public Sections Custom Action {[Custom Action] Public Stable Action Register Delphahlap (session session) {session.log ("Custom Start action 1 "); Session Logs ("before access to customsadata"); // should have the installation path - unfortunately it is empty! Why? String cad = session ["CustomActionData"]; Debugger.Break (); RegisterHelp (CAD); Session.log ("The end of the custom verb .."); Return action Success; }  

If you portray your data ...

  & lt; Custom Action ID = "Microactive Action Data" Return = "Check" Property = "MyCastAction" value = 'PROPERTY0 = [PROPERTY0]; PROPERTY1 = [PROPERTY1]; PROPERTY2 = [PROPERTY2] 'Excipulate =' Instant '/ & gt;  

You can access data like this:

  string property0 = session.CustomActionData ["Property0"]; String property1 = session.CustomActionData ["Property1"]; String property 2 = session. CustomActionData ["Property2"];  

In the previous example, you will use it:

  & lt; Custom Action ID = "RegisterDflHelp.SetProperty" Return = "check" property = "RegisterDflHelp" Value = 'INSTALLLOCATION = [INSTALLLOCATION]' Execute = 'Instant' />  

then

  string cad = session.CustomActionData ["INSTALLLOCATION"];  

python - Is it possible for my linux machine (with no GUI) to hit Twitter sign up page, and then spit out a captcha in a webpage format -


It is so that I can just type in letters and (through the IP of my Linux box) can register ?

(Twitter uses reCaptcha)

Is there a way to capture JavaScript, output it in a webpage then submit it?

Twitter provides special offers to automatically post logs from one of your programs Use it.


c# - Using an (I)List<string> as the source for a DataColumn -


I am playing with DataGrid View Control provided by .NET. So far I have a (i) seem unable to bind a list to a DataColumn. Is it possible and how should I go around doing this?

I think this link will answer your question:

If you Directly list & lt; String & gt; If you bind to the DatagridView, then you will get the length of the string in the column because it is the only property on each string to list. You have to set some where the string itself will be available as a property. Then DatagridView.data will be an example of a class that will be set for property that hide the IList & lt;> and Datagridveiw.Datamember.


iphone - Objective-C error: expected '=', ',', ';', 'asm' or '__attribute__' before 'class' -


I'm getting this from an iPhone app that I'm working on. Not sure about interpreting the error ... it has been thrown in some place in my code. I can not see any pattern of the incident.

Is this a common error? what is the meaning of this?

The error posted by you indicates that there is a syntax error around your use Class . Manually examine the first reported error, and you can keep the reason in mind.

To help you debug, include the surrounding code so that we can assist you.

Common reason:

  1. For the forward class announcement in the headers, @ is missing @
  2. Li> Missed ; An enum, a structure, or a typedef
  3. after the declaration of the ciped C ++ code, where class is used to declare a structure , But the code is invalid in the purpose-C

Clubbing reprints of a book with different ISBNs -


I am using the Google Books API to search the user for a specific book and display the results. The problem is that different versions of the same book have different ISBNs. Is there any way to club these reprints on the basis of API returns?

I want to do this because I have ISB of some versions in my database so when a user searches for a book, I want to club all the results and display them as a result Would like to do

  http: //xisbn.worldcat.org/webservices/xid/isbn/0596002815  

To get this feedback :

  & lt; Rsp stat = "ok" & gt; & Lt; ISBN & gt; 0596002815 & lt; / ISBN & gt; & Lt; ISBN & gt; 1565928938 & lt; / ISBN & gt; & Lt; ISBN & gt; 1565924649 & lt; / ISBN & gt; & Lt; ISBN & gt; 0596158068 & lt; / ISBN & gt; & Lt; ISBN & gt; 0596513984 & lt; / ISBN & gt; & Lt; ISBN & gt; 1600330215 & lt; / ISBN & gt; & Lt; ISBN & gt; 8371975961 & lt; / ISBN & gt; & Lt; ISBN & gt; 059680539X & lt; / ISBN & gt; & Lt; ISBN & gt; 8324616489 & lt; / ISBN & gt; & Lt; / RSP & gt;  

In which first original ISBN is included, and then all options known to the WorldKat, you can then use alternate options for grouping.


scala - How to write a lazy, variable argument version of "orElse" -


Is it possible to write the normalized orElse method to option arguments Takes a variable number of? Instead:

  lazy wall o1 = {println ("foo"); None) Lazy val o2 = {println ("bar"); Some ("bar")} lazy wall o3 = {println ("falcon"); Some ("falcon")} // ... o1 or ales o2 or else o3 // or else ...  

You can use:

< Pre> orElse (O1, o2, o3) //, ...

< According to p> (4.6 function declaration and definitions) you can not define parameters by the name of aliases:

  ParamType :: = Type | '= & Gt;' Type | Type '*' scala & gt; Def or Else (x: (=> string) *) & lt; Console & gt ;: 1: Error: Any name parameter type is not allowed def or else (x: (=> string) *)  
  Diff or Else [T] (X: ((=) => option [T]) *): option [t] = if (x.isEmpty) none x.first.apply.orElse (or Else ((x drop 1): _ *)) contained anyToFun0 [T] (T: = & gt; t): ((=) = & gt; t) = () = & gt; T or Else (O1, O2, O3)  

javascript - How do I get the mouse position of a DOM element that is a child of a relative element? -


How to obtain the position of the mouse over a DOM element, is it a child of relative element (in JavaScript)?

Here's a way I want to get the position of the mouse in an element. It returns the y value in a standard axis (below -> top) or in the web axis (above -> below). Get the position of

  / * In relation to the given element, the mouse event in a standard axis system is the standard axis system: the original (0, 0) starts from the bottom-left side and 'y 'Is growing and is right for' X '. * / Function GetMousePositionInElement (ev, element) {var offset = element.offset (); Var below = offset.top + element.height (); Var x = ev.pageX - offset.left; Var y = plane - ev.pageY; Return {x: x, y: y, y_fromTop: element.height () - y}; }  

This requires jQuery.


Algorithm complexity -


I am trying to calculate the complexity of the following algorithms

  Private static list & Lt; Int & gt; GetIndexes (string stripped text, string search text) {list & lt; Int & gt; Count = new list & lt; Int & gt; (); Int index = 0; While (strippedText.Length & gt; = Index & amp; amp; Index! = -1) {index = strippedText.IndexOf (searchText.Trim (), Index, String Compiler, Ordinal Ignor Sees); If (index! = -1) {count.Add (index); Index ++; } And continue; } Calculation of return; }  

I know that there is a complexity of O (n) in the loop, if every move has increased by 1, but the wage increases with the index is. On each walk it is 1 or strippedText.lenght () .

Anyone can raise thoughts?

However, the worst position is O (N).


ajax - Functions too fast? So they get skipped? -


An Epilex, PHP, MySQL and some HTML / all are cured with one function.

When I want to delete an entry in the list, it should be like the fashion function when I send an update request for my list, the way I want it also goes. . But, when I call delete ();

When I put alert in both functions, both functions are executed. And the script runs fine through my Ajax function, PHP Ajax handler and Returns the result to the user, and the alert is also going on well at all!

So my question is, my work is very fast? Or is there something that I am missing here, which is causing non-removal?

Solution I have brought the update in the line after xmlHttp.resonseText to delete Function. In that way the second function call is executed followed by the first function is done. Thanks all!

Javascript will only execute the next statement, while an AJAX call is taking place. There are several ways to use AJAX on full call, which you can call, so after an AJAX call that you want to execute is only called later

I work with php Not done, but it is worth noting on it.


c# - Lambda syntax in linq to db4o? -


I know that with the following possible linq2db4o

  to AB dB where a Colour. Eclocks (Colors.Green)  

What do I need, something that allows me to conditionally create my query (like I can do in other Linux forms)

  public IEnumerable & lt; Apple & gt; Searchple's bag (apple search bag bag) {var q = db.Apples; If (bag.color! = Null) {q = q.Where (a => a.color.Equals (bag color)); } Return q.Asumerable (); }  

In a real situation, searchbags will maintain many properties and will create a giant if tree that will catch all the possible combinations of loaded properties, they will go crazy.

It is possible to call first

  var q = (db in select c in color c);  

And then continue from there, but this is not what I am searching for.

Disclaimer: Approximately 11 months prior to duplicate.
It is a bit more obvious because I think this topic is better and I hope now some db4o god eyes can catch it on:

Any suggestions?

Yes, it is definitely possible to build custom LINQ queries using DB4O . It is valid that DB is defined as:

  IObjectContainer db;  

Your query is:

  Public INMEMALABLE & lt; Apple & gt; Searchpeople (apple search bag bag) {var query = db. Cast & LT; Apple & gt; (); // query a Db4objects.Db4o.Linq.IDb4oLinqQuery & lt; Apple & gt; If (bag.color! = Null) query = query Where (a => a.color == bag.Color); Return query; }  

In that case, whenever the returnable number is being repeated, then the query will be executed.

Another possibility is to use the IQueryable mechanism, which is well-known by developers:

  Public IQueryable & lt; Apple & gt; Searchpeople (apple search bag bag) {var query = db.exchangeable & lt; Apple & gt; (); // query will be a system. Link Equitable & lt; Apple & gt; If (bag.color! = Null) query = query Where (a => a.color == bag.Color); Return query; }  

In both cases, the db4o will try to remove a customized query from the lambda expression on execution, and if it fails, then the LINQ will fallback to the object.

By avoiding queries from LINQ, the first one has more advantage.

How to alter a MENU_LOCAL_TASK tab menu in Drupal -


I have created a tabbed menu in my custom Drupal 6 module. I want to place an HTML dropdown list on the right side of the tabbed menu at the top of my module page. Some AJAX events will be changed in the list, such as changing the CRIM boundary on SQL queries, specifying 10,20,50,100 results. How do I get it without heading templates?

Thank you,

You can do this by overriding your theme: / P>

  function yourtheme_menu_local_tasks () {// Allow empty output to dropdown dropdown $ under $ dropdown = ''; // Check whether the dropdown in this menu should be added $ inject_dropdown = TRUE; // TODO: Check the logic according to your needs, e.g. Inspecting the path through ARG () wanted / injection? If ($ inject_dropdown) {// Yes, formap api $ select = array ('#type' = & gt; select ',' # title '= & gt; t (' number of results: '),' #options '= & Gt; array (' 10 ',' 20 ',' 50 ',' 100 '),); / L> L & gt; Tag to fit the rest tab list $ dropdown = '& lt; Li & gt; . Drupal_render (select $) '& lt; / Li & gt; '; } // Note: The following is a copy of the default theme_menu_local_tasks (), // (possibly empty) $ dropdown variable output $ addition = ''; If ($ primary = menu_primary_local_tasks ()) {$ output. = "& Lt; ul class = \" Tab Primary \ "& gt; \ n". $ Primary $ dropdown "& lt; / ul & gt; \ n"; } If ($ secondary = menu_secondary_local_tasks ()) {$ output. = "& Lt; ul class = \" Tab secondary \ "& gt; \ n". $ Secondary "& Lt; / ul & gt; \ n"; } Return $ Output; }  

(note: unchecked code - potential typo)


asp.net - Accessing C# code hosted on US server from Local machine -


I recently created a website in C # with ASP.net and hosted it on the US server, now My problem is that I want to access my code from a local machine, is it possible to access the code of the US server from my local machine? Because when any change suggested by my boss is to reach that server and making that change is hard work, then

What I did for him: -

    < Li>

    I selected the Open Website in Visual Studio 2005 and select Remote Site. Ask me if the URL of the website's URL is configured with FrontPage server extension, under which a textbox HTPS says: //

  1. Then I went to the US server and installed the FrontPage server extension as described in the webpage

What I recorded in the Visual Studio 2005 text box

You will supply the URL to access the file or FTP credentials on the site.

However, I am going to recommend against this approach because there is no good idea to develop directly against production servers. A local copy that you publish on the server is a more appropriate solution, and in the end you will have to spend a lot of time.


c# - Convert form.RenderControl() value to xml Well Formed -


On ASP.NET, how can I change the output from form1? Revisited () well -form xml?

MSDN page has many useful information on this problem.


iphone - Is this a UIKit bug? -


I'm not sure whether this bug actually comes from my app or is actually a UIKit bug. Maybe someone can explain here.

There is a tableview, each cell provides a disclosure button with a "setting" screen which is a model view. The modal view can be closed using the "Close" button.

There is a UITextview in the model view.

Now the bug comes here: the user holds a key that provides the same letter (example: A -> AAA A ...). When the user holds that key, the letters are found and the blue color is first selected. If the user keeps this button and simultaneously clicks on the "off" button the modal view disappears and the table view is visible. The keyboard goes away, but the {a ä à} menu for one second is still visible then the app crashes.

This can only be done again on the device, because you can not press two buttons simultaneously.

Here is a stack trace

  date / time: 2009-12-01 17: 39: 31.048 +0100 OS version: iPhone OS 3.0.1 (7A) 400) Report version: 104 Exception type: EXC_BAD_ACCESS (SIBBS) Exception code: 0x00000008 Carren_ PROTECTION_FAILURE Crash Thread: 0 Thread 0 Crashed: 0 libobjc.A.dylib 0x300102ac objc_msgseend + 16 1 UIKit 0x308ffda0 - [Text marked in UIKeyboardImpl] 20 2 UIKit 0x309161b2 - [UIKeyboardImpl updateShiftState] + 230 3 UIKit 0x309224c0 - [UIKeyboardImpl Handbuster Callback] + 72 4 UIKit 0x30922466 Supervisor Callback + 14 5 CoreFoundation 0x3020bf38 __CFRunLoopDoObservers + 420 6 CoreFoundation 0x30252e46 CFRun LoopRunSpecific + 1734 7 CoreFoundation 0x3025276a CFRunLoopRunInMode + 42 8 GraphicsServices 0x32044b08 GSEventRunModal + 108 9 GraphicsServices 0x32044bb4 GSEventRun + 56 10 UIKit 0x308f035c - [UIApplication _run] 384 11 UIKit 0x308ef11a UIApplicationMain + 694 12 **** 0x00002360 Main (Main I: 14) 13 **** 0x000022 FC Start + 44 Thread 1: 0 Libistum. B Deal 0x31d47624 semaphore_wait_signal_trap + 8 1 libSystem.B.dylib 0x31d702de semaphore_wait_signal + 2 2 libSystem.B.dylib 0x31d49c9c pthread_mutex_lock + 284 3 WebCore 0x35866fa6 __ZL17_WebTryThreadLockb + 98 4 WebCore 0x35866f22 __zll4WebRunLoopLockPl9__kfruँlupobsservermpv + 14 5 CoreFoundation 0x3020bf38 __kfruँlupdubsservers + 420 6 CoreFoundation 0x30252db0 CFRunLoopRunSpecific + 1584 7 CoreFoundation 0x3025276a CFRunLoopRunInMode + 42 8 WebCore 0x35866ed2 __zll2RunWebThreadPv + 286 9 LibSystemkbi. Dileep 0x31d6a6ea _pthread_body + 10  

The problem was to resign from the first response, which I forgot


iphone - Is there a way to display a UIBarButtonItem without using a UIToolBar... or even -


Or even, is it able to make the UIToolbar invisible?

What type of impact can I get without displaying a standard UIBarButtonItem, a UIToolBar?

UISegmentedControl with a Segment and Segment control style < / Code> can be set to UISegmentedControlStyleBar .


vb.net - wrong result with IF() function and a nullable integer? -


I hope to return the value of the nothing to the following vb.net function, but its Instead of 0 ...

  is returning a value of the public share function GetDefaultTipoSrvTkt () as an integer? GetDefaultTipoSrvTkt = (integer, DataRow) as the slow-tsrvDict New Dictionary if (IsNothing (tsrvDict) OrElse tsrvDict.Count = 0, nothing, tsrvDict.First.Key) expiration function  
< P> The last line's function can also be written as a return (IsNothing (tsrvDict) OrElse tsrvDict.Count = 0, nothing, tsrvDict.First.Key) but in any case , Why is () function if (IsNothing (tsrvDict) OrElse tsrvDict.Count = 0, nothing, tsrvDict.First.Key) return 0 < / Code> rather than nothing ?

is nothing to be applied as a value type in VB The context type, and in all cases, means "the default value of this type", for example:

  dim x integer = nothing Console.WriteLine (x) For the '0  

if () operator, VB has to detect the return type in some way, it sees both branches, and Their l A shows the nearest common type. In this case, there is a branch type integer second nothing , which is "typeless", but it is compatible with integer As we saw earlier Therefore, the result of type is integer being predicted. When is nothing given in that context, it becomes 0

A clear cast will correct:.

  GetDefaultTipoSrvTkt = if (_IsNothing (TsrvDict) OrElse tsrvDict.Count = 0, _ CType (nothing, integer?), _ TsrvDict.First.Key)  

Or you can use an alternative method to specify zero value for Nullable type:

  GetDefaultTipoSrvTkt = if (_Is nothing (tsrvDict) OrElse tsrvDict.Count = 0, _ New Integer? (), _ TsrvDict.First.Key)  

C# LINQ -How to apply group by? -


I am new to linq. From the list of the following data, help me how I can implement the group and build the other to get the expected output below.

  list & lt; SalesAnalysis & gt; Analyst = new list & lt; SalesAnalysis & gt; (); AnaList.Add (New Sales Analysis ("P 2001", 200 9, 45000)); AnaList.Add (New Sales Analysis ("P 2001", 2008, 13000)); AnaList.Add (New Sales Analysis ("P 2002", 200 9, 5000)); AnaList.Add (New Sale Analysis ("P002", 2008, 15000)); AnaList.Add (New Sales Analysis ("P003", 200 9, 25000)); AnaList.Add (New Sale Analysis ("P003", 2008, 65000)); AnaList.Add (New Sales Analysis ("P004", 200 9, 5000)); AnaList.Add (New Sales Analysis ("P004", 2008, 3000)); AnaList.Add (New Sales Analysis ("P004", 2007, 95000)); AnaList.Add (New Sales Analysis ("P004", 2006, 83000)); Class sales analysis {public string ProductCode {get; Set; } Public int year {receives; Set; } Public Entry Number of Units Sold (Received; Set; } Public Sales Analysis (String Productcode, Int Year, Int NumberFunicatedWed) {ProductCode = productcode; Year = year; Number of unitsisol = no futitssold; }}  

Terms:

1) Report is required only for 2008 and 2009

2) Number = = 30000 Top movement products

3) Number => 10000 to & lt; 30000 average movement products

4) number fonts & lt; 10000 Poor Moving Products

Expected Output:

Top Movement Product Code Year Number P003 2008 65000 P001 2009 45000 Average Movement Product Code Year Number Furnace P 2003 2009 25000 P002 2008 15000 P001 2008 13000 Poor Movement Product Code Year Number Advantage P002 2009 5000 P004 2009 5000 P004 2008 3000 "post-text" itemprop = "text"> < P> To report only items for 2008 and 2009, use one block where:
  where sa.Year == 2008 || Sa.year == 2009  

For the rest, I would suggest an enema to classify "band":

  public enum movement { Top, Average, Bad} Analysis for Sale of Public Static Movement Movement (Sales Analysis) {Return sa.NumberOfUnitsSold> = 30000? protest. Fresh: Sa Number of unit sold & gt; = 10000? protest. Avg: movement. poor; }  

You can then:

  var query = to analytics in where sa.Year == 2008 || Sa.Year == 2009 Movement analysis (SA) by group; Foreign currency (different groups in query) {Console.WriteLine ("{0}:", group.Key); Foreach (different items in the group) {Console.WriteLine ("{0} / {1} / {2}", item.product code, item.year, item.NumberOfUnitsSold); } Console. Wrightite (); }  

It produces the output that you were after, modulo ordering and formatting.


How to learn to like Visual Studio and heavy-duty IDEs -


I have some exposures of Visual Studio, but not a big deal, as well as eclipse, and have not got much Out of experience, what do I want from an editor, a line number, syntax highlighting, and a list of functions / sub-routes if possible. For me, the visual studio is overkill.

Specifically, I do not like the concept of drag-and-drop coding and auto-generated content. I am not saying this is bad, but he is pushing me personally.

What suggestions would you make to join the right mindset to work with these types of devices, and how to show the benefits, as the potential for increasing productivity, I feel that I have a GUI Fighting with me

I 'an avid eclipse user (for Java), and I believe it is too heavy is.

You are not like all the features - although you can turn off a lot of them, at least in Eclipse

I like automatic refactoring and I like auto completion ( Or content support). But I also have an automatic transmission drive. Sometimes I miss the rod-shifts, but most of the time I am trying to pound my way through something and it saves me time and effort. In the same way, sometimes I like to choose my methods, but I enjoy enjoying it, it often happens outside.

Integrated debugger for me is the best feature of all these IDEs I have tight SVN Integration (or CVS / VSS / etc) is also like I was not impressed with offerings outside IDE

I think in many cases, you have to get a plugin that changes your life. For me this Java element is like search (better than grepping), and a plugin that I have written. For many people, something like Mileyine is perfect (it is believed that he finds the most relevant files all the time). You can not really get anything without the IDE, so you choose the option whether one or not.

Finally, the goal is to be productive and to enjoy what you do. To decide whether or not you should use the tool, the producer is more than a logic argument. Most people swear by Word, and I use latex for everything, everyone's own.


Using Ajax.Updater to get a javascript file (prototypejs) -


यहाँ मेरा अजाक्स अनुरोध है:

  नया अजाक्स। अपडेटर ({सफलता: 'पादलेख '},' / Dyn / actions / checksystemmessage ', {प्रविष्टि:' के बाद ', evalScripts: true});  

यहां पर / dyn / actions / checksystem संदेश है:

  & lt; script type = "text / javascript" & gt; & lt;! - दस्तावेज़ पीछे। कंटेनर = नया तत्व ('div', {id: 'behind-system-message'}); behindContainer.setStyle (.org) के पीछे पीछे। कंटेनर के पीछे (.dom: loaded), function () {buildSystemMsg = function (SystemMsg) {// {Display: 'none'}); document.body.appendChild (behindContainer); // मुख्य कंटेनर कंटेनर = नया तत्व ('div', {id: 'system-message'})। अद्यतन (सिस्टममॉस्ब); कंटेनर.सेटस्टाइल ({Display: 'none'}); document.body.appendChild (कंटेनर); // छिपाना बटन छिपाना बीटीएन = नया तत्व ('ए', {'class': 'close-button', 'title': 'close system ('बंद करें' ('मॉड-सिस्टम-अलर्ट')) (नया प्रभाव.मॉव ($ ('मॉड-सिस्टम-अलर्ट'), { कतार: 'सामने', एक्स: 0, वाई: ऑफसेट वाई, मोड: 'रिश्तेदार', अवधि: 0}); } नया प्रभाव। आगे ($ ('पादलेख'), {पंक्ति: 'सामने', एक्स: 0, वाई: ऑफसेट वाई, मोड: 'रिश्तेदार', अवधि: 0}); नया प्रभाव। आगे ($ ('पृष्ठ-कंटेनर'), {पंक्ति: 'सामने', एक्स: 0, वाई: ऑफसेट वाई, मोड: 'रिश्तेदार', अवधि: 0}); नया प्रभाव। आगे ($ ('एनएवी'), {कतार: 'सामने', एक्स: 0, वाई: ऑफसेट वाई, मोड: 'रिश्तेदार', अवधि: 0}); नया प्रभाव। आगे ($ ('हैडर-कंटेनर'), {पंक्ति: 'सामने', एक्स: 0, वाई: ऑफसेट वाई, मोड: 'रिश्तेदार', अवधि: 0}); प्रभाव। ब्लिंडडाउन (पीछे कंटैनर, {कतार: 'सामने', अवधि: 0}); प्रभाव। ब्लिंडडाउन (कंटेनर, {कतार: 'अंत', अवधि: 0.5}); HideBtn.observe ('click', function () {if ($ ('mod-system-alert')) {new effect.Move ($ ('mod-system-alert'), {queue: 'front', x : 0, y: -ऑफ़सेट, मोड: 'रिश्तेदार', अवधि: 0});} नया प्रभाव। आगे ($ ('पादलेख'), {पंक्ति: 'अंत', एक्स: 0, वाई: -ऑफ़सेट, मोड : 'रिश्तेदार', अवधि: 0}); नया प्रभाव। आगे ($ ('पेज-कंटेनर'), {पंक्ति: 'अंत', एक्स: 0, वाई: -ऑफ़सेट, मोड: 'रिश्तेदार', अवधि: 0 }); नया प्रभाव.मॉव ($ ('एनएवी'), {कतार: 'अंत', एक्स: 0, वाई: -ऑफ़सेट, मोड: 'रिश्तेदार', अवधि: 0}); नया प्रभाव। आगे ($ ( 'हैडर-कंटेनर', {कतार: 'अंत', एक्स: 0, वाई: -ऑफ़सेट, मोड: 'रिश्तेदार', अवधि: 0}); प्रभाव। ब्लिंडअप (पीछे कंटैनर, {कतार: 'सामने', अवधि: 0}); प्रभाव। ब्लाइंडअप (कंटेनर, {कतार: 'सामने', अवधि: 0.5}); सेटकाकी ("छिपाई सिस्टम संदेश", सच);}); } HideMsg = get_cookie ("HideSystemMsg"); SystemMsg = '$ {SystemMsg}'; अगर (systemMsg.length & gt; 0 और amp; hideMsg) buildSystemMsg (systemMsg); }); - & gt; & lt; / स्क्रिप्ट & gt;  

यह न तो आईडी पाद लेख वाले तत्व के बाद जावास्क्रिप्ट को सम्मिलित करना है और न ही स्क्रिप्ट निष्पादित है। यह अन्य जावास्क्रिप्ट पुस्तकालयों पर भरोसा करता है जो उस पृष्ठ पर शामिल किए गए हैं जहां अपडेट हो रहा है। मेरा मानना ​​है कि evalScripts केवल तभी काम करेगा यदि आपके प्रतिक्रिया हेडर में एक " पाठ / जावास्क्रिप्ट "सामग्री प्रकार यह वही है जो AJAX लाइब्रेरी को बताता है कि आप सर्वर से जो प्राप्त कर रहे हैं वह एक स्क्रिप्ट है ..

इसके अतिरिक्त, आपको मार्कअप की आवश्यकता नहीं होगी: & lt; script type = "text / javascript "& Gt; & lt;! - , और: - & gt; & lt; / स्क्रिप्ट & gt;

मुझे उम्मीद है कि यह मददगार होगा।


performance - C#: Are struct members more performant? -


About the idea about the member field of Structure vs. Classes:

Reason To use a structure, do not assign an additional object to the stack. It allows to keep this solution as 'executable', such that the class is coded in the field

First of all, it does not mean that piles ?

And, will not the use of strontaks be used to decrease the time of allocation (especially if members of the class are lazy-loaded) at the cost of increasing the memory footprint?

Do you recommend this practice of strokes on classes in certain circumstances?

"post-text" itemprop = "text">

I think that was meant to write that pile, it was just accidentally written a heap.

The question of the strokes or class often comes up here is one. I think it is best to follow this generally given advice:


MSDN answers ..

Actually, that page gives you a 4-item checklist and a class until your type does not meet all the criteria.

Do not define a structure unless the type has all of the following features:

  * It represents a single value of rational, similar to primitive types ( Integer, double, and so on) * It has smaller size than 16 bytes. * It is irreversible * It will not have to be boxed repeatedly.  

Should not you follow this advice? Maybe, but only after proving it through your profile.


webforms - ASP.NET control property with [Flags] enum -


I have developed an ASP.NET control for which one of the properties [Flags] is enum. However, I am ASP. Net control does not seem capable of specifying multiple flags for this property in markup. Is there any special syntax to do this or is it not possible?

Maybe I'm thinking the question is wrong, but you do not set the enum value with a different string than com Can do

Example if I have this property under my control:

  public system. Io File option option {get; Set; }  

I can set it up in markup like this:

  & lt; Uc1: MyControl id = "control1" runat = "server" option = "delete onklos, asynchronous" />  

c# - Exception handling help -


I've written and tested a WinForms application and everything works fine on my machine (Cliche, I know ). When I created a setup project and installed it on a co-worker machine, it receives the following message:

  **************************** Exception text ** ************ System.IndexOutOfRangeException: there System.Data.RBTree`1.GetNodeByIndex (Int32 userIndex) position 0. on (Int32 on System.Data.RBTree`1.get_Item a row System.Windows.Forms.Form.OnLoad (EventArgs e) System.Data.DataRowCollection.get_Item (Int32 index on System.Windows.Forms.Form) on MyApp.MainForm.MainForm_Load (object sender, EventArgs e) Index). OnCreateControl () System.Windows.Forms.Control.CreateControl on System.Windows.Forms.Control.CreateControl () on System.Windows.Forms.Control.WmShowWindow (Boolean fIgnoreVisible) (message & amp; System.Windows meters) in KControlkWndProc (message .Forms & amp; m) in (message System.Windows.Forms.ScrollableControl.WndProc & amp; m) in (message System.Windows.Forms.ContainerControl.WndProc & amp; m ) in (message System.Windows.Forms.Form.WmShowWindow & amp; m) (message System.Windows.Forms.Control.ControlNativeWindow.WndProc & amp ;; System.Windows.Forms.Control.ControlNativeWindow.OnMessage M) (Message & amp; System.Windows.Forms.Form.WandProc (meters on message & m)) System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 Sense I, at IntPtr wParam, IntPtr lParam)  

I believe that I am just beginning when it comes to the exception of dealing with this one. The text is not fully understood to me and I am the best way to debug it, because I can not get the error on my machine.

Can anyone say that the problem is this, or do I have the best advice to debug? Any help is greatly appreciated!

You are apparently using the DataRowCollection object in your main form Load event handler, and this DataRowCollection object is empty (i.e. there is no line in it). Form load event handler assumes that it will not be empty.

I would suggest that you Set breakpoints (F9) on the opening brace of MainForm_Load and phase (F-10 or F-11) until you find the code that code Attempts to use the DataRowCollection .


Is it possible to make SQL Server convert entries columns in a set of results -


मेरे पास निम्न सेटअप है ...

  तालिका: गुण p_id [pk] p_propname O_id_owners [fk] तालिका: मालिकों o_id [pk] o_extcode o_fname o_lname तालिका: चयनित फीचर्स s_id [pk] d_id_features [fk] p_id_properties [fk] तालिका: विशेषताएं d_id [pk] d_code d_featurename g_id_featuregroup [fk] तालिका: फीचर ग्रुप g_id [पीके] g_featuregroupname  

आदर्श रूप से मैं इसे आउटपुट करना चाहता हूं

  & lt; header & gt; स्वामी का नाम | स्वामी एक्स्टोड | प्रोप नाम | [समूह नाम (फीचर ग्रुप)] & lt; पंक्ति & gt; स्वामी का नाम | स्वामी एक्स्टोड | प्रोप नाम | ^ सुविधा कोड | ^ सुविधा कोड |  

इसका समूह का नाम थोड़ा सा है जिसके साथ मैं संघर्ष कर रहा हूं; तालिकाओं को लिंक किया गया है और मैं इस तरह से प्रदर्शित करने के लिए रिकॉर्ड प्राप्त कर सकता हूँ:

  & lt; header & gt; स्वामी का नाम | स्वामी एक्स्टोड | प्रोप नाम | फ़ीचर का नाम & lt; पंक्ति & gt; स्वामी का नाम | स्वामी एक्स्टोड | प्रोप नाम | फ़ीचर का नाम & lt; पंक्ति & gt; स्वामी का नाम | स्वामी एक्स्टोड | प्रोप नाम | फ़ीचर नाम  

क्या आपने यह देखा है?


Where is the SQL outputting when setting show_sql in NHibernate? -


show_sql सेटिंग में एसक्यूएल आउटपुट कहां है?

मेरे पास भी है।

मेरा मानना ​​है कि यह कंसोल पर आउटपुट है।

लेकिन अगर आप log4net सेटअप करते हैं तो आप कर सकते हैं NHibernate की सभी चीज़ों का लॉगफ़ाइल प्राप्त करें

मैं इस प्रोग्राममैटिक रूप से करता हूं और एक कॉन्फ़िग फाइल है जो निर्दिष्ट करती है कि यह करना है या नहीं मुझे हाइबरनेट कॉन्फ़िगरेशन फ़ाइल में सेट करने से बेहतर पाया गया

अपडेट

मुझे सिर्फ स्रोत कोड पर एक नज़र डाला गया है और उनका नाम है लॉगएसकॉलइन्कोनोल ) (Cfg.Loquacious.DbIntegrationConfiguration)।

इसे Cfg.Loquacious.SettingsFactory से कहा जाता है, जो तब कहते हैं log.in.info ("सभी एसक्यूएल को स्टडआउट करना")

यह है Log4net लकड़हारा और मुझे विश्वास है कि यदि आप किसी भी विन्यास फाइल को सेट नहीं करते हैं तो यह कंसोल के लिए डिफ़ॉल्ट है।


c# - How to play a sound in WPF -


I'm a novice C # programmer and I'm having trouble playing music in the game using my WPF (Windows) VS 2008. This is a web app do I think that myMediaElementExample variable is empty when executing it in the Play method ExpenseReportPage.xaml.cs file Is used for

This program is created now, but after running it, it encounters an exception to myMediaElementExample.Play (); The line exception says:

  WpfApplication1.vhost.exe [9 48] generated an uncontrolled Win32 exception.  

Can any of you suggest me what else to try? I have included only the code related to this problem:

ExpenseReportPage.xaml.cs file:

  Namespace expense {{Public Partial Square ExpenseReportPage: Page {... } Public Partial Category MediaElement Example: Page {MediaElement myMediaElementExample = New MediaElement (); Public Media Illustration Example () {} Public Zero OnMouseDownPlayMedia (Object Sender, RoutedEventArgs args) / MouseButtonEventArgs {// Play system will launch media if it is currently not active or // resumed the media if it is stopped If there is a media already running, then there is no effect. I myMediaElementExample.Play (); }}}  

Homepage. Xll.cs File:

  Namespace expense for this {public partial home page: Page {MediaElementExample mediaElementExample = new MediaElementExample (); Public Homepage () {InitializeComponent (); } Zero handclick (Object Sender, Routing Avent ARG E) {button as srcButton = e.Source button; SrcButton.Width = 200; Media Element Example OnMouseDownplayMedia (Sender, E); Enclosing the line for debugging purposes:  
   

MyMediaElementExample.Play ();

with a try {} hold {} with block:

  try {myMediaElementExample.Play (); } (Pre-exception) {// Print either exception or test it in debugger}  

This will give you more information due to the exception. If this is still unclear then update the question with this new information.

If myMediaElementExample was zero, then I expected you to see that you will get one instead of Wenz 32. You can see the myMediaElementExample.Play (); You can check by setting a break point on the line.

Once you find out the problem and decide, you can remove the exception handler or if you want to be cautious, leave it, but to trap exceptions that < Code> MediaElement.Play wakes up.


java - Are Socket's events queued in Flash? -


I try to apply a binary protocol by using TCP / IP sockets between a flash application and a custom Java server The message of the protocol is of variable length, so my idea is to add an area that indicates the number of bytes to read before a full message is parsed, something like this:

< Pre> bytesToRead = socket.readInteger (); Var BF: Bytererere; Socket.readBytes (bytesToRead); ParseMessage (BF);

So my question is: If a message comes from other data socket (when it is done) while processing a message, then type message progress event. SOKKET_DATA is queued, so how much is the number of my handlers, reached at least (in this case) the number of messages that have been called or should I read until all the data socket is available? Or simple:

ProgreeEvent.SOCKET_DATA event in general messages for a handlined line in the Flash The bar is sent when the socket receives the data. Basically every time your Java server calls socket.write (); Or socket.writeln (), you should get the entire message in ProgreeEvent.SOCKET_DATA unless you are certainly sending partial messages.

The answer to this question is expected of your question.


vb.net - Mousewheel scroll in panel with dynamically added picturebox controls? -


I have dynamically added 20 pictureboxes to a panel and when I use the mouse wheel, see the panel scroll I have tried to set the autoscroll to correct the panel control to implement it. Here the code is integer for I = 1 to 20:

  new picture box as dim B () b.Image = nothing b.BorderStyle = BorderStyle.FixedSingle b.Text = i. ToString () b.Size = new size (60, 40) b.Location = new point (0, (i * b.Height) - b.Height) b.Parent = Panel 1 panel 1. Control. Add (B) Next  

I did the same with the button control and it works just fine. I as integer = 1 to 100:

  New button in the form of a dim B () b.Text = i.ToString () b.Size = new size (60, 40) b .Location = new point (0, (i * b.Height) - b.Height) b.Parent = Panel 1 panel 1. Control. Add (B) Next  

This "Button" works for control, but not for "Picturebox" or "Label" controls? How can I influence scrolling using MSWill?

Panel scroll with muswell when this is the control or focus within it, the problem in which you are running It is that when you click on it, neither the picturebox nor the panel gets the focus if you call () on the panel, you will see that the mouse wheel starts working again Does.

A possible solution occurs when the mouse cursor selects the panel to rotate it, to deal with the control. Mouse Event:

  Zero Panel 1_MouseEnter (Object) Sender, event ergues e) {panel1.select (); }  

flash - How to work with buttons in an extended movieclip class -


I think the movieclip enhances the class and in this class there are several buttons. Is present in the FLA and is related to the definition of class, how can I control events from within the class? The following does not work:

  class extends new movie movie clips {var test_btn: button; Function newMovie () {} function test_btn.onRelease () {trace ("pressed button"); }}  

Try to do this,

  Import mx.utils.Delegate; Class Expands New Movie Movieclip {var test_btn: Button; Function Pneumovi () {test_btn.onRelease = Rep. Create (this, Parbutton release); } Button on the function () (trace ("pressed the button"); }}  

Illegal inheritance compilation error using Scala 2.7.7 and LIFT 1.1-SNAPSHOT -


After

I am using JDK 1.6.0_16, and Scala 2.7.7, compiling with Maven.

I get mvn clean compilation and I get four errors, but they are similar, work in different models:

[ERROR] C : \ Users \ Master \ Vertical \ ResumeApp \ src \ Main \ Scala \ jblack \ resumeapp \ Lift \ Model \ ContactInfoModel.scala: 13: Error: Invalid Legacy;

[information] Self type jblack.resumeapp.lift.model.ContactInfoModel does not conform net.liftweb.mapper.CRUDify [long, jblack.resumeapp.lift.model.ContactInfoModel] with jblack.resumeapp selftype To net.liftweb.mapper.CRUDify [long, jblack.resumeapp.lift.model.ContactInfoModel] With net.liftweb.map per.KeyedMetaMapper lift.model.ContactInfoModel [Long, jblack.resumeapp.lift.model.ContactInfoModel]

[information CRUDify with] [Long, ContactInfoModel] {

And this is my code:

  package jblack.resumeapp.lift.model import ne t.liftweb.mapper._Office ContactInfoMetaData ContactInfoModel extension with KeyedMetaMapper [Long, ContactInfoModel ] {Override def dbTableName = "contactinfo" override def fieldOrder = list (key, data, display)} Square ContactInfoModel extends KeyedMapper [Long ContactInfoModel,] with CRUDify [Long, ContactInfoModel] {def getSingleton = ContactInfoMetaData def primaryKeyField = ID object id extends MappedLongIndex (it) object key extends MappedString (this, 100) object data extends MappedString (this, 100) object performance extends MappedBoolean (it)}  

I'm not sure whether I I am doing

Unfortunately, since I was founded in Eclipse night plugin, I can not install IDE 2.7.7, so I just compiled it with Maven.

Am I CRUDify ?

The Siarudeif lift -1.1 should be mixed in my TaMapper object instead Mapper class. So instead of this should work with the code:

  Package jblack.resumeapp.lift.model import net.liftweb.mapper._ objection ContactInfoMetaData extends KeyedMetaMapper with CRUDify [Long, ContactInfoModel] ContactInfoModel [Long, ContactInfoModel] {dbTableName def override = override def fieldOrder = list (key, data, display) "contactinfo"} Square ContactInfoModel extends KeyedMapper [Long, ContactInfoModel] {def getSingleton = ContactInfoMetaData def primaryKeyField = ID object ID extends MappedLongIndex ( This) object mapped string (it, 100) object data mapped string (it, 100) objects T display Maped bullion (this)} extends  
.

java - RSS items order, does it matter? -


I have created an RSS feed with Java ROM, the project is close to the end, but I found strange behavior in some RSS clients.

I think this is more of an RSS client problem, but I want to make sure.

Rome keeps items in a list, so the latest items are at the end of the list. I opened my feed in my RSS subscribers (Firefox and RSS Bandit) and I came to know that they are in reverse order (technically it is chronological, but contrary to the order I used).

I thought this is an RSS client bug (I usually use Google Reader), but I checked some feeds on the internet and saw that they were due to display them properly Near reverse order items (the oldest on the top) are.

But do not trust XML items on item order

And, most importantly, should I reorder my list of items?

Edit: I found an easy solution:

  entries.add (0, entry); // :-)  

But there is a question about "true" client behavior.

One of the RSS's underlying problems is that there really is no standard whose field use is well

I think there will be no need to worry about what the client and the server are actually doing, do you think a device is theoretically Tell them to ...


Image Resizing in (PHP/GD) -


I help find the most efficient way to resize image / image / strong> PHP / GD while the original Protecting the aspect ratio of the image to ensure that the resized image is more than a minimum minimum width; For example, the resized image should have a width> = 400 and a height> = 300 , but should be close to those dimensions as possible while maintaining the original aspect. Ratio.

An ideal 300 height in this "landscape" image or an ideal width = 400 and "portrait" > Width of 400 or height> = 300 .

I believe you want this; In particular, the image in the middle column:

When the source image is wide When the source image is longer Is

Receives from the following code:

  list ($ source_image_width, $ source_image_height) = getimagesize ('/ path / to / image'); $ Target_image_width = 400; $ Target_image_height = 300; $ Source_aspect_ratio = $ source_image_width / $ source_image_height; $ Target_aspect_ratio = $ target_image_width / $ target_image_height; If ($ target_aspect_ratio & gt; $ source_aspect_ratio) {// if it is broader than the target source, then // we maintain the ideal width and prevent height $ target_image_height = (int) ($ target_image_width / $ source_aspect_ratio); } Else {// If there is a longer (or same aspect ratio) than the target source, then // we maintain the ideal height and limit the target $ target_me_method = (int) ($ target_image_height * $ source_aspect_ratio); } // From here, use the Gd library function to resize the image  

record - Video recording without user interaction -


I want to record video with new iPhone SDK available on 3GS without user interaction. I went through UIImagePickerController and UIImagePickerControllerDelegate class reference. I also tried to see the sample code provided by Apple.

Is it possible to record videos without user interaction?

I was not expecting this kind of access to the iPhone SDK - to know the user The possibility of recording the video is very secretly.


.net - Generate several megabytes of of random data in C# -


I want to know a great way to generate random data of several megabytes using C # on Windows (.net) 2.0), but other options such as other options such as .NET 3.0 and Mono libraries will also have some interest).

The purpose of the data is to communicate through a real network network, for certain destinations, so the level of randomness is not really important - although the data is somewhat of an appetite (like repeating characters Series) should not be anything.

I can use random, or generate a GUID I'm curious to know if there are better ways to do this. What is analog to / dev / urandom on UNIX for example?

You can generate this approach to use random number stream:

< Pre> int streamus = (1024 * 1024) * 15; // let's squeeze 15 MBits junk int byte = stream; While (Left & gt; 0) {RNGCryptoServiceProvider rng = New RNGCryptoServiceProvider (); Byte [] buffer = new byte [1024]; RNG. Bats (buffer); Sendbats (buffer); // Leave it on the network interface - = 1024; }

java - Windows 7 Application Icon and Taskbar -


I have an application that uses a 25x25 png image for the app icon on Windows XP, it fits perfectly on the taskbar. Sits, though I change the size of the icon on virtual machine and the taskbar on Windows 7 Windows 7, it becomes a bigger blur. What type of icon should I use on the work bar? Forgive my ignorance, if this is a stupid question, but I'm a Linux guy ...

< P> For many different icon offer taskbar from Windows executable, it uses the default 16x16 pixel icon or 32x32 pixel icon in screen color depth.

An example of Java SWT to set the application icon:

  string [] icon = {"icon16.png", "icon32.png", "icon48 Png "}; Shell.setImages (getImages); Windows 7 then gets the icon to display in the taskbar before the image set (when small icons are enabled) or from the image set to another icon (when small icons are disabled). 


javascript canvas putImageData not writing modified data -


I am trying to unbalance an image. I am currently loading it, parsing the image data, but I can not get it back to write in the canvas.

I have followed all directions to

  context.putImageData (imagedata, 0,0);  

I do this, but the image data does not change. The reference to the "CTX" image that was previously loaded, which is being turned on grayscale.

  grayscale: function grayscale (ctx) {var id = ctx.getImageData (0,0, ctx canvas wide, ctx.canvas.height); For (var i = 0; i & lt; id.height; i ++) {for (var e = 0; i  

Instead of internal loop i, you have to compare and increase e.

When you calculate the index, you have the switch between E and I also it should be (with 4 execution):

  var index = 4 * ( I * id.width + e);  

wpf - How can I stop a TreeViewItem from fireing the Selected event for itself, and its parent? -


I have TreeViewItem when selected , calls a method is. However, I think that when selected event is called, then the selected event for parent is also called TreeViewItem .

I really do not, but it does not happen, but I can not tell any documentation that is telling why this is happening in the first place.

Does anyone tell me why this is starting with, and maybe how to stop it.

I am open to different objects instead of a tree graph, but I need to maintain the visual indication of the selection.

Thank you!

PS: This is a snippet of what I have.

  & lt; Tree VIPIT IEPANDAND = "True" ISELECTED = "FLESE" selected = "Fire extinguisher controller-activated_Event" & gt; & Lt; TreeViewItem.Header & gt; & Lt; Text block text = "{binding path = display name}" /> & Lt; /TreeViewItem.Header> & Lt; TreeViewItem.Items & gt; & Lt; TreeViewItem header = "Order & credits" selected = "Fire_Orders_Credits_Event" /> I'm unable to pick anything based on the snippet I provided.  


rest - How to use OpenID in RESTful API? -


मैं Pylons- आधारित वेब अनुप्रयोग का निर्माण कर रहा हूँ RESTful API के साथ, जो वर्तमान में किसी भी प्रमाणीकरण की कमी है इसलिए मैं इसे लागू करने जा रहा हूं और उपयोगकर्ता पासवर्ड संग्रहीत करने के साथ सभी परेशानी और सावधानी से बचने के लिए, मैं प्रमाणीकरण के लिए OpenID का उपयोग करना चाहता हूं। क्या सबसे अच्छा तरीका होगा यह करने का? क्या ये दो बातें संगत हैं? क्या ओपनआईड का उपयोग करने वाले मौजूदा एएसपी हैं जो मैं प्रेरणा ले सकता हूं?

अब मैं विकल्पों की खोज करने में कुछ समय बिता चुका हूं और निष्कर्षों को संक्षेप करना चाहता हूं। सबसे पहले, थोड़ा अधिक संदर्भ - मैं दोनों सेवा और एपीआई उपभोक्ता को विकसित और नियंत्रित करता हूं। उपभोक्ता फ्लैश आधारित ऐप है जो एक ही मेजबान से दिया जाता है जो अब एपीआई है और इसे ब्राउज़र में उपयोग करना माना जाता है। कोई तृतीय पक्ष क्लाइंट अभी तक दृष्टि में नहीं है

तो सवाल को दो भागों में विभाजित किया जा सकता है,

  • मैं एपीआई के माध्यम से ओपनआईआईडी प्रमाणीकरण कैसे करूं
  • मैं कैसे "प्रमाणीकृत" "बाद के अनुरोधों में स्थिति

पहले भाग के लिए, ओपनआईड प्रमाणीकरण लगभग हमेशा इंटरैक्टिव चरण शामिल करता है प्रमाणीकरण प्रक्रिया के दौरान सबसे अधिक संभावना एक ऐसा कदम होगा जहां उपयोगकर्ता ओपनआईड प्रदाता के वेब पेज में है, कुछ "मैं सहमत हूं" बटन पर हस्ताक्षर करने और दबाकर। इसलिए एपीआई इस पारदर्शी तरीके से संभाल नहीं कर सकती और नहीं कर सकती ("मुझे अपना ओपनआईड प्रदाता और पासवर्ड बताओ और मैं आराम करूँगा")। सबसे अच्छा यह कर सकता है आगे और पीछे HTTP लिंक है कि ग्राहक को खोलने और निर्देशों का पालन करना होगा।

"प्रमाणीकृत" स्थिति को बनाए रखना

REST एपीआई स्टेटलेस नहीं होनी चाहिए, प्रत्येक अनुरोध में इसे संभाल करने के लिए आवश्यक सभी सूचनाओं को शामिल करना चाहिए, है ना? यह प्रत्येक अनुरोध के लिए ओपनआईड प्रदाता के खिलाफ प्रमाणन करने का कोई मतलब नहीं होगा, इसलिए कुछ प्रकार का सत्र आवश्यक है सत्र कुंजी (या "प्रवेश टोकन" या उपयोगकर्ता नाम / पासवर्ड) के लिए कुछ विकल्प हैं:

  • HTTPS + बुनियादी प्रमाणीकरण ("प्राधिकरण: बेसिक ..." प्रत्येक अनुरोध में हैडर) < / Li>
  • प्रत्येक अनुरोध में हस्ताक्षर अनुरोध ("प्राधिकरण: एडब्ल्यूएस ..." हैडर)
  • OAuth: एक्सेस टोकन प्राप्त करें, प्रत्येक अनुरोध में उस और अन्य मापदंडों का एक समूह शामिल करें
  • कुकी जो कि सत्र कुंजी को संग्रहीत करता है ("कुकी: ..." प्रत्येक अनुरोध में हैडर)
  • हस्ताक्षरित कुकी जो कि कुकी में ही सत्र की जानकारी संग्रहीत करता है

सिर्फ एक एपीआई उपभोक्ता अभी, इसलिए मैंने सरलतम काम करने का फैसला किया जो संभवत: काम कर सकता था - कुकीज़ वे पाइलन्स में उपयोग करने में सुपर-आसान हैं, की मदद से। वे फ्लैश ऐप में "बस काम" भी करते हैं - चूंकि यह ब्राउजर के अंदर चलता है, ब्राउजर में फ्लैश ऐप द्वारा किए जाने वाले अनुरोधों में प्रासंगिक कुकीज शामिल होंगे - ऐप को इस संबंध में सभी को बदलने की जरूरत नहीं है। यहां एक स्टैक ओवरफ्लो प्रश्न है जो कुकीज़ का उपयोग करने की भी सलाह देता है:

बीकर में यह भी अच्छी सुविधा है कि सभी सत्र डेटा को कुकी में ही शामिल किया गया है। मुझे लगता है कि इस बारे में स्टेटलेस है जैसा कि यह हो जाता है सर्वर पर नहीं सत्र संग्रह है क्लाइंट साइड में उनके साथ छेड़छाड़ से बचने के लिए कुकीज़ पर हस्ताक्षर और वैकल्पिक रूप से एन्क्रिप्ट किए गए हैं। दोष यह है कि कुकी थोड़ी बड़ी हो जाती है, क्योंकि अब इसे सिर्फ सत्र कुंजी से अधिक स्टोर करने की आवश्यकता है कुछ सामग्री को निकालने से मुझे वास्तव में सत्र (ओपनआईड प्रमाणीकरण के बचे हुए) की आवश्यकता नहीं थी, मुझे कुकी आकार लगभग 200 बाइट्स तक मिला।


joomla1.5 - Why does a Joomla component not work when SEF urls are turned on? -


I have just installed the last night when the player does not work if I start the SEF URL within Joomla (I have Version 1.5.x is). That is, when I press playback on the player (this is a SWF) which does not play the song, but when I go back to the non-SEF'ed URL, the song then plays.

Has anyone experienced this problem or what is the same problem with any other components with whom he has worked?

Anyone know? And possibly suggest how fast I can patch it myself?

Thanks

My guess is to create a code URL for your component Joomla does not use router. Why do not you ask the developers of that component? Maybe you are not the first to run on this issue ..


javascript - Add class or ID to FCKeditor's editable iframe body -


I'm using FCKeditor to edit the content of a div, this is an ID set in the content device, so My CSS can contain P, Lee, IMG, etc. I want that the contents of the FCKeditor should look similar to the content of my div. I've imported my stylesheet in @fck_editorarea.css, but of course there is no ID set in the Fakaditre body, so styles are not implemented.

I am trying to write a plugin for this, to set the body tag ID in the virtual iframe to fiqci, but it can not work. Can any suggestion or a better approach suggest?

There is no need for the plugin Find these lines in FCKedotor's confing file, fckconfig, js

  // This editor will be applied on FCKConfig.BodyId = 'Editor's body element; FCKConfig.BodyClass = '';  

And change the blank body id to whatever you need.


httpwebrequest - How to handle ASP.NET Authentication -


I have the following problem: I accessed some files hosted under IIS using an asp.net page I want to protect The page will be used with another application:

  var request = WebRequest.Create ("www.smth.com/protectData.aspx") as HttpWebRequest; request. Certification = New Network Credentials ("John Doe", "John"); request. Authentic = true; Var response = request GetResponse ();  

How to read the credentials sent to the page (protectData.aspx)?

I have a code to validate credentials ... I have tried to implement custom membership, but HttpContext.Current.User is zero ASPX page web application Hosted in a certified WCF service with a custom policy that hosts:

system.serviceModel>
serviceAuthorization principalPermissionMode = "custom"
Authorization Policies
add policy = "custom policy. Custom policy, custom policy" />
authorization policies - system .serviceModel

I do not have any security for aspiration pages now, basically I want to get the credentials from the request and validate them to use the existing code.

Any help is appreciated, Adrian

There are two options to use HTTP transport authentication or form based authentication.

For Transport Authentication, you need to setup IIS to protect the resources that the client tries to access. This resource can be your file or ASPX page. The ASPX page will then be able to read the HTTPCTEx.Current.User Variable, and will be able to decide that the user can access that resource.

For Form Based Ath, IIS does not have to certify the request. Instead, you post a form for a webform that can see the username / password in the request and decide if access is allowed or not.

Posting a variety of ATH (FBA) forms on the basis of the POST body can be username / password, read that ASPX page, decode and decide whether access is permitted or No.


javascript - Having 404 Not found issue when posting the data from angular, but it does not give 404 not found error during get request -


यहां मेरी निर्देशिका स्ट्राकैटर है -

ऐप। Js सार्वजनिक - JSON फ़ाइल वाले संसाधन

यहां JSON फ़ाइल प्राप्त करने के लिए मेरा नियंत्रक है

  $ http ({url: url, method: 'GET', हेडर: {'Content-type': 'application / json' }}।) सफलता (फ़ंक्शन (डेटा, स्थिति, हेडर, कॉन्फिग) {$ rootScope.home = डेटा; console.log ($ rootScope.home.quotes);})। त्रुटि (फ़ंक्शन (डेटा, स्थिति, हेडर, कॉन्फ़िगरेशन ) {Console.log ("त्रुटि आती है");});  

उपरोक्त नियंत्रक अनुरोध प्राप्त करने के लिए कोई त्रुटि नहीं देता JSON फ़ाइल नहीं मिली

यहां मेरा डाक नियंत्रक है

  var Url = "संसाधन / JSON / home.json"; $ Http ({method: 'POST', url: url, डेटा: requestObject, headers: {'content-type': 'application / json'}})। सफलता (फ़ंक्शन (डेटा, स्थिति, हेडर, कॉन्फ़िग) {console .log ("यह तब निष्पादित होता है जब कुछ प्रतिक्रिया होती है");})। त्रुटि (फ़ंक्शन (डेटा, स्थिति, हेडर, कॉन्फ़िग) {console.log ("सामग्री का संपादन करते समय त्रुटि आती है");});  

यह www.localhost के रूप में त्रुटि दे: 8000 / संसाधन / JSON / home.json त्रुटि नहीं मिली,

क्या कोई मुझे इस समस्या को हल करने में मदद कर सकता है?

पहले से धन्यवाद


sockets - How to detect disconnection in python, without sending data -


OK, I have a socket and I'm handling a line at a time and logging it. The code below works very well for this in the COAT function I use to send the data to the log. I use this for loop, so I can process a line at a time.

  socket.connect ((host, port)) readbuffer = "" while true: readbuffer = readbuffer + socket.recv (4096). Decode ("UTF-8") COAT ("Receive:" + ReidBuffer) # Buffer Tipe = Strip: (Reidbuffer, "\ n") readbuffer = temp.pop () for the line in temporarily: # one at a time Handle the line.  

I ran into a problem where the server disconnected me, suddenly I had a huge file full of the word "RECEIVING". I know this because when a dragon socket is disconnected, it starts getting blank data.

I have tried to insert:

  if "" == readbuffer: print ("it is disconnected!") Break  

All who immediately broke the loop, and say that it has also been disconnected on a successful connection.

I also know that I can find out the disconnection by sending data, but I can not do this, because whatever I send is broadcast to all other customers on the server, and This is for debugging those customers, so I will interfere with it.

Thank you in advance what I do.

You have to check the result of recv ()

  while true: c = socket.recv (4096) if c == '': break # no more readbuffer = readbuffer + c.decode ("UTF-8") ...  

Java, variable comparison with array data -



मेरे पास एक बयान है I को सरल बनाने के लिए चाहते हैं
if ((s.getId ()! = 970) & amp; (s.getId ()! = 357) & amp; (s.getId ()! = 1323) & amp; (s.getId ()! = 327) & amp; & Amp; (s.getId ()! = 1325) & amp; amp; (s.getId ()! = 1326) & amp; amp; (s.getId ()! = 1327) & amp; amp; (एसजीजीआईडी) ! = 1533) & amp; (s.getId ()! = 1411) & amp; (s.getId ()! = 482) & amp; amp; (एस.जी.आई.डी. (!) = 1532)) {};
आप देख सकते हैं कि यह स्वयं दोहरा रहा है।
मुझे इसे पसंद है:

  arrayType [] arrayName = {970, 357, 1323, 327, 1325, 1326, आदि}; मेरे खराब वाक्यविन्यास के लिए क्षमा करें  

संपादित करें: Urahara का जवाब पढ़ने के बाद मैं (i (! (S.getId () (बराबर (array_name []) {}

इस के साथ आया:

  int [] skillList = {970, 357, 1323, 327, 1325, 1326, 1327, 1533, 1411, 482, 1532}; अगर (! Arrays.asList गलत टैग   

Itemprop = "text">

ArrayList.Contains फ़ंक्शन का उपयोग करें।

  var arrayName = [970, 357, 1323, 327, 1325, 1326] ; If (! Arrays.asList (arrayName)। शामिल हैं (getId ())) {// आईडी सरणी में नहीं थी};  

Is there a standard way of handling logging from an Android app? -


I'm not able to find any good resources, tutorials or open source libraries What is the Android app? Is it normal to send or upload log files from time to time?

Ideally I want to send some messages like a logstash server, but this is not a very common approach. Any advice will be appreciated.

Check in Jithub as they say,

Acra Exception raises, retrieves many reference data and sends them back to the backend of your choice.

Which means that you just send it to you the required data logs.


sql server - How do I insert an item to my table properly? SQL/C# -


Due to my second query error, I have trouble reviewing my review table as my message box (debugging) I keep reading (SE 777, 57547, 4) or even if I play with the query instead of (24, 57547, 4), because when I type in a movie, it will be replaced To use as an int for different tables, the movie id number is my target To put in my table (read as 24, 57547, 4).

  Private Zero InsertReview_Click (Object Sender, EventArgs e) {string filename, connectionInfo; SqlConnection DB; This.listBox1.Items.Clear (); Filename = "netflix.mdf"; ConnectionInfo = String.Format (@ "Data Source = (LocalBible) \ v11.0; Attached FillName = | DataDirectory | \ {0}; Integrated Security = True;", File Name); Db = new SqlConnection (connectionInfo); Db.Open (); SqlCommand CMD = new SQL Commands (); CMD Connection = DB; String moviename = this.textBox1.Text; Moviename = moviename.Replace ("'", "' '); Cmd.CommandText = string.Format (@" Select movie from movies where movie name =' {0} '; ", moviename); Object result = CMD. Exclass ssl (); int id = System.Convert.ToInt32 (results); this.listBox1.Items.Add (id); // to ensure that it has been correctly converted SqlCommand cmd2 = new SqlCommand () ; CMD 2. Connection = DB; Cmd2.CommandText = // second query, this issue posted here string. Format (@ "INSERT INTO Reviews (MovieID, User ID, Rating) Well ({0}); ", id, this.Texbox 1. text;); MessageBox.Show (cmd2.CommandText); // debugging SqlDataAdapter adapter = new SqlDataAdapter (cmd); dataset DS = new dataset (); Adapter.fill (ds); db.Close (); //this.listBox1.Items.Add (Free movie review included successfully!); }  

in your string. Format:

  Cmd2.CommandText = // second query, this issue posting string here. Format (@ "INSERT INTO Reviews (MovieID, User ID, Rating) Value ({0});", id, it.Texbox 1. text;);  

You only have one format item {0} , but you are passing two arguments to enter the string. And you are trying to insert 3 columns of data in the table. I'm not sure how the user ID and ratings are being submitted, but your code should look like this:

  cmd2.CommandText = // another query, the issue came posting string here. Format (@ "INSERT INTO Reviews (MovieID, UIIID, Ratings) value ({0}, {1}, '{2}');", id, user id, rating);  

While doing this dynamic SQL is a very bad way.

You should parameter the query, such as:

  cmd2.CommandText = // another query, here image posting @ "Include in review (movie id, user id, rating ) VALUES (@MovieId, @UserId, @Rating); "); Cmd2.Parameters.AddWithValue ("@ MovieID", ID); Cmd2.Parameters.AddWithValue ("UserId", userId); Cmd2.Parameters.AddWithValue ("Ratings", Ratings);  

excel - How do I check if a cell only contains characters from a specific list? -


I am trying to do a test on a data column to see if there are only special characters in its rows The question in question is 0 - 9 and / . If only they exist, then a must be returned , otherwise an error (or 1 and 0, anything is different) is fine. It should basically look like this (bold column):

https: // i .imgur Com / IrJuZ47.png

I had limited success with the match and the Velukup, but nothing works which works in a category. A formula will be given priority but VBA will also be quiet. Any ideas?

Give it a try UDF () :

  LCL for string L = lane (SI) I = 1 as long as, long as long as the String DM L as public function celltost (as in the version) If I have the celltest = "good" end function  
before the end (SIN, I, 1) if IsNumeric (CH) or CH = "/" then the Seltest = "Not Good" function ends


html - Make textboxes and textareas longer -


I have a table with textboxes and a textbook. I would like to extend the length of these objects horizontally, but I can not seem to do this work.

I tried to use the width on the textboxes and cols textarea but nothing is working yet.

Here is a link to my JSfield for this page: I'm working on:

In your CSS:

  Input, Texture {width: 100%; }  

It should do this so that the width of the input and textare container is raised 100%.

After this, you can then change the container width with CSS. For example, your table . The contact-table is currently set to 200px so that the input and textara are 200px. Setting up your 300px from the contact table will also affect the input and the textrace, because they are set as 100% width.


loops - Matlab: select submatrix from matrix by certain criteria -


मेरे पास एक मैट्रिक्स ए

  ए = [फ़ जादू (10)] ए = 931142103 92 99 1 8 15 67 74 51 58 40 931142103 98 80 7 14 16 73 55 57 64 41 931142103 4 81 88 20 22 54 56 63 70 47 459200101 85 87 1 9 21 3 60 62 69 71 28 459200101 86 93 25 2 9 61 68 75 52 34 459200101 17 24 76 83 90 42 49 26 33 65 459200101 23 5 82 89 91 48 30 32 39 66 37833100 79 6 13 95 97 29 31 38 45 72 37833100 10 12 94 96 78 35 37 44 46 53 37833100 11 18 100 77 84 36 43 50 27 59 पहला कॉलम फर्म कोड शेष कॉलम फर्मों के डेटा हैं, प्रत्येक पंक्ति में किसी दिए गए वर्ष में कॉलम 1 में फर्म का जिक्र है। सूचना है कि हर कंपनी के लिए साल शेष नहीं हो सकते हैं मैं पहले कॉलम के अनुसार उप-मेट्रिकस घटाना चाहूंगा उदाहरण के लिए,  ए (1: 3,2: 11)  के लिए 931142103: 

  ए (1: 3,2: 11) ans = 92 99 1 8 15 67 74 51 58 40 98 80 7 14 16 73 55 57 64 41 4 81 88 20 22 54 56 63 70 47  

उसी के रूप में 459200101 (जो ए (4: 7,2: 11) ) और A (8: 10,2: 11) के लिए 37833100 हो।

मुझे समझ में आ रहा है कि कोड को ऐसा करना चाहिए:

  सूचकांक = खोज (ए (,, 1)); ओ बीएस = आकार (ए (:, 1)); मैं = 1 के लिए: obs, अगर मैं == इंडेक्स (आई ??) ए {i} = ए (??, 2:11); अंत में  

इन जटिल कोडों को सूचीबद्ध करने में मुझे कठिनाइयां हैं: 459200101 और 37833100 उन्हें एक साथ इकट्ठा करने के लिए और मैं अपने submatrix A {i} की पंक्तियों को कैसे लिख सकता हूं?

बहुत बहुत धन्यवाद!

के साथ एक दृष्टिकोण -

 % // अद्वितीय प्रविष्टियां प्राप्त करें ए के पहले कॉलम और 'स्थिर' विकल्प के साथ क्रम% // रखने के लिए, जैसे कि unqA1 = अद्वितीय (A (,, 1), 'स्थिर')% // प्रत्येक ऐसे submatrix का चयन करने के लिए arrayfun का उपयोग करें और एक के रूप में स्टोर करें एक सेल सरणी में सेल%, जो कि अंतिम आउटपुट आउटए = सरफेन (@ (एन) ए (ए (ए, (1) == अनैक ए 1 (एन), :), 1: संख्या (अनैक ए 1), 'यूनी' , 0)  

या यह -

  [~, ~, row_idx] = अद्वितीय (ए (,, 1), 'स्थिर') outA = सरणीफन (@ (एन) ए (पंक्ति_idx == n, :), 1: मैक्स (पंक्ति_आईडक्स), 'यूनी', 0)  

अंत में, आप कॉल के साथ परिणाम सत्यापित कर सकते हैं celldisp (outA)


Powershell: Assign properties to existing array -


I have a one-dimensional array that I get from the matching content command or multi-line text box input. I want to assign an asset to entries in this array, then add more properties to use later in my script.

Something like this:

  $ items = new-object Psobject $ item | Add-member -membertip noteproperty -name name-value notset $ items | Add-member-memberType noteproperty -name percentage-value NotSet $ ​​names = @ ($ textboxInputText.Lines) $ name | % {$ Item | $ $ Name = $ script ($ $ name)} foreach ($ item $ item) {$ percent = {script block} $ item.percent = $ percent}  

I know That's a broken code, but I wanted to give an example of where I was going. I have searched very far, but in fact I can not find what I am looking for.

Edit:

Code target: Get input From a text box or text file (single row entries), those entries in the "Name" property Assign, then add another asset in the array (percent), which will need to be filled in the second block of code. Edit

$ Item) {$ psConsoleFile = "PATH to FILE.pc1" $ variable1 = "Something" $ variable2 = "Something else" $ command = "." "Command1 $ item.name | | Command2 -Switch $ variable1 -Switch2 $ variable2`" "$ Output ScriptBlock =" PowerShell.exe -PinesSolphile $ psConsoleFile -command $ command "}
< P> Its output is as follows:

  powershell.exe -PSConsoleFile "PATH to FILE.psc1" - Command. "Command1 @ {name = name1; Percent =}. Name | Command2-switches1 Something " 

Why is the code to output the full line instead of the name

In addition to this, I have used PS 4.0 for all the implementations of this script

OK, I see a problem here, so you have a string of strings Array that you got from a text document with a multi-line text box form object or gate-content command, but the real What you want in the PSObjects is an array of.

In a string object, you can add extra properties like you want (well, not traditionally, let's just not go there. Because you will not be happy, where things will end, trust me.) Instead, we take that array of stars, and create a PSObject for each string as you want. ForEach-ob Either you want to simplify the loop. Either way, you want to pip your input (either text box or content command) into a pie loop, and you can specify the whole thing in a variable which will later (The percent property will collect all the objects to work with the object) Something like this is what you want to do:

  [array] $ collection = $ textboxInputText.Lines | For <{code> $ store  type is specified as    

I { $ archive [array] so that if you want to index it later, then any issue Should not be, your input should be only one item, and if you want to update the percentages that you can do that can be a forEach loop (either inline or No) by running $ archive

  $ archive | $ {$ Item in the $ archive} {$ Item.Percentage = $ {$} for $ {script} {$ code = $ {script block}}  

or

  blocks}}  

Now, things to note here ... You will not be able to return just $ text to your textbox. You can probably invite the $ archive. The name, but it may require a new version of PS because I do not know how it is backwards compatible. If you use the gate-content command instead of referencing the text box, just replace $ textboxInputText.Lines. Unit { to go-content "c: \ path \ to \ file.txt" | and you should have all the sets.

Edit: OK, you no longer have the problem with the object, but how are you trying to expand its assets within a double quotes using the name You must wrap the $ Item.Name inside $ () to create sub-expression within double quotation marks. That's why you'll see that line:

  $ command = "." Command1 $ ($ item.name) | Command2 - Switch $ variable1 -Switch2 $ variable2` ""  

mysql - Storing data in user table or a new table? -


What is the most effective, best and fastest way: Adding a 'restricted' (boolean) field to the user's table, or Preparing a new brand named 'Restricted'?

If your restricted users only have a single asset (they are banned), then a Go to the area. For example, when he can check that he can access a page, you will be able to do something (in PHP):

  if ($ f ['baned'] ']) {Die ("Get out of here, banned you!"); } Else {// your argument for general, i.e., non-restricted users}  

where $ f returned by PDO's fetch () Array is) or equivalent function.
If you need some special processing for restricted websites (count your tests for your IP logging - and only their people - or, for example, to access your website) that will include other data , Then go to a table that clearly should be in a UserId field in relation to the main user table. Then you must include this table in each query when checking a user.


c# - In Specflow can I run one test as a step of another? -


TL; Dr; How can I make a sample test that tells another test as my first step?

  I have already given a sample test and I want to do another test which is deeper than before, then I prepare a second test which is the first Test runs as its first step and I add extra steps to test deeper functionality.  

Sorry, there is a little sample humor there.

For example, I have a test which pre-sells:

  I have to make a sales order and I open the sales order page and I add a new order Click on button then a new sales order is created  

and I have to do another test, which is a test linking a sales line

and another test Which tests to complete the sale

and so on

all those The test will start with the first four steps in the form of a similar test, which breaks the DRY theory. How can I do this so that the first stage of the 2nd test can be run only on the first test? Like something like this:

  I have run the sales sales test test / here only runs this first test and I add a sales order line then the order total updates  

If every test starts with the same first four lines, and later I realized that I need to change the simplest selling test, then I also go and find and fix Every world will need to Which repeats those four lines.

EDIT: Note that it should also be able to work in these features. As the above general examination is defined in the convenience of the sale. But I will also have a credit feature, and to be able to credit it, we will need to make a sale every time:

  I should give credit for sale and I run a sales sale order Test and I complete the sale and I click the credit button, then the credit is credited to the sale  

As you've already noted, (And that's probably the best option in most situations), but you can also create a step that calls the other steps. [Binding] Public Class MySteps: Phase / Upgradation of this base class is important or will not be available in the following ways [[given ("I have made an order")] Public Zero CreateAdder (given ("I Sales Order"); given ("I open the sales order page"); given ("I click the Add new order button"); Then ("A new sale Order is made ");}}

from which you Can use:

  Scenario: I add another sale I have made an order when I add a sales order line then the order total has been updated  

The advantage of this is that this whole step can be used anywhere in the scenario, not as the starting point. If you need

The phase can then be reused in many features