Friday, 15 March 2013

Spell Check my Delphi source code -


Earlier I used Visual SssX in Visual Studio and it had a very good spelling that was checking on Likhax was.

Is there something similar to the visual assistant spell checker present in Delphi?

This should be the name of the check method name, class name and specially reinforced and verbatim spelling.

The closest I know is that in the code proofreader


PHP strategies for retrofitting a namespace around 3rd party code -


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

... और हाँ, नाम स्थान का उपयोग न करने के लिए खुद पर पारित होने के लिए समान दावे हैं

मेरे सिर के ऊपर से मैं हर .php फ़ाइल को संपादित करने पर विचार कर रहा हूं और जोड़ रहा हूं:

  नाम स्थान चेहरापैम;  

लेकिन मुझे पता करने के लिए उत्सुक था कि क्या कोई और अधिक सुरुचिपूर्ण समाधान हो गया है। खासकर के रूप में कोड के अतिरिक्त संशोधन जारी किए जाते हैं, मुझे न तो स्पर्श करना होगा; 30 + फ़ाइलें संपादित करें।

एक नाम स्थान केवल एक फ़ाइल के लिए सेट है, और एक फ़ाइल में केवल 1 नाम स्थान। मुझे डर है कि आपके पास ऐसा करने के लिए अन्य समाधान नहीं हैं I [संपादित करें] मैंने अभी जांच की और एक फाइल में कई नामस्थान हो सकते हैं लेकिन आपके पास इसे किसी फ़ाइल के शीर्ष पर स्थित परिभाषित किए बिना एक नेमस्पेस नहीं हो सकता है।


arrays - Optimized method for calculating cosine distance in Python -


I wrote a method to calculate the distance of cosine between two arrays:

  Def cosine_distance A, B): If LAN (A)! = Lane (B): Returns wrong digit = 0 denom = 0 in dinob = i i category (lane (a)): degrees + a = i [i] * b [i] denoma + = abs (a [i]) * * 2 denomb + = abs (b [i]) ** 2 results = 1 - fraction / (sqrt (denoma) * sqrt (dinob)) returns result  

running this one The large array can be very slow. Is there a customized version of this method that will run fast?

Update: I have tried to do all the tips till today, including sliced. Here's the version of the beat to include suggestions from Mike and Steve:

  def cosine_distance (a, b): if len (a)! = Len (b): Increase valueError, "a and b should have the same length" #importes = 1 = 0 denom = 0 = 0 for = 0 in dinob = 0 i optimize the mean: AI = a [i] # This is the result of diploid + = bi * bi = 1 - fraction / (sqrt) only once BI = B [I] fraction + = AI * bi # exponent (barely) denoma + = ai * ai #strip abs () (Denoma) * sqrt (dinob)) Results Results  

If you use SciPy You can use the cosine from Local Distance :

If you can not use SciPy, you can get a little speed by typing your python again (edit: but this does not work Was doing as I thought it would be, see below). Importing izip from math copy to itertools from

  Ort sqrt def cosine_distance (a, b): if LAN (A)! = Lane (b): increase the value, "a and b should be the same length" fraction = sum (tup [0] * tup [1] Izip for a tup (a, b) denom = sum (avalue ** 2 For avalue) dinob = amount (for bvalue in bvalue ** b) result = 1 - fraction / (sqrt (denoma) * sqrt (dinob)) returns result  

A and b The length of the mismatch is better when lifting an exception.

sum (for using the generator quote inside the call)) You can calculate your values ​​with most of the functions being done by C code inside Python. The should be faster than using for the loop.

I have not given time, so I can not guess how fast it can be. But SciPy codes are almost certainly written in C or C ++ and should be as soon as possible.

If you are doing bioinformatics in Python then you should actually use SciPy.

EDIT: Darius Bacon finished my code and found it slow. So I ended my code and ... Yes, it is slow Lesson for everyone: When you are trying to speed things up, do not guess, measure.

Why is the slow attempt to do more work on the C-Internal of Insanity, I tried to do it for the list of length 1000 and it was still slow.

I can not spend much time trying to hack Python cleverly if you need more speed, then I suggest you try SciPy.

Edit: Without time, I have just tested by hand I think that for small A and B, the old code is fast; For long time A and B, the new code is fast; The difference is not large in both cases (now I am wondering if I can trust the timetable on my Windows computer; I want to try this test again on Linux.) I work to get it faster I will not change the code and once I urge you to try a sympiune. : -)


licensing - If I modify and dynamically link against a modified LGLP Lib, do I have to make the changes available? -


I got a bug in LGPL Lib that I currently link in dynamically.

  • If I understand Lib that I make available source files with the application Will it be right?

    You are redistributing the modified code of the LGPL library, so you have to issue the source of that library Will be (your bug fix). This does not mean that you need to release the source code of your entire application for the LGPLLD library.

    Also keep in mind that GPL / LGPL will only give you source code to anyone, which you give to the binary, it is not necessary for you to download the source on the web, put anyone in the world . One sure way to comply is to pack the source of your distribution so that people get it with Binaries, then do not complain that the source was not available.


    python - in protocol with regard to sequence -


    How has this been implemented at a dragon level?

    I have found a thing that has been shown for one part (the last time I should have only the subclassed word, but I did not want to repeat the codebase again, and I I want to know about future context), which looks like something

    self (self, key, value): self._config [key] = value __setig

    but E.g. call

    ex> t = config.Thinger () t.populate () #International method that gives it some useful data If the T: DSTF ()

    is being resulted in 'key' because possibly for `in the protocol 'for the Kashmir getitem ( ) Does the look in the question ey? Do I need to take exceptions to tell it that it is not there? I did not want to do something like this instead.

      Try: keyError: pass pass: doStuff ()  

    except for [deBUG]]

    There is stupidity in 'these': (<1 )

    With a stack of trace prints, I can see that the program calls for configuring instant. Getitem (0)

    However

      t = {'rawk': 1, 'rawr': 2,} t [ 0] # arises keyError 'thing' in t # returning fault  

    it seems Do you want to overload the operator?

    You can do that the method is included in __ :


    java - remove element in dom4j -


      & lt; रूट & gt; & Lt; एल्म आईडी = "1" / & gt; & Lt; एल्म आईडी = "2" / & gt; & Lt; एल्म आईडी = "3" / & gt; & Lt; एल्म आईडी = "4" / ​​& gt; & Lt; / जड़ & gt;  

    मैं id = "2" को dom में छोड़ना चाहता हूं,
    कैसे domj4 अन्य तीन को निकाल सकता है?

    परिणाम:

      & lt; रूट & gt; & Lt; एल्म आईडी = "2" / & gt; & Lt; / जड़ & gt;  

    आपने अब तक क्या किया है? ठीक है, मैं खरोंच से जाना होगा

    • दस्तावेज़ का उपयोग करके DocumentHelper.parseText (xmlStr) प्राप्त करने का प्रयास करें

    • फिर Document.getRootElement ()

    • का उपयोग करके दस्तावेज़ का मूल तत्व प्राप्त करें, मूल तत्व प्राप्त करने के बाद, आप सभी बच्चे के माध्यम से पाश कर सकते हैं Element.getElements () या इसके वेरिएंट्स का उपयोग करने वाले तत्व, और Element.getAttributes () या इसके वेरिएंट्स का उपयोग करके प्रत्येक एलीमेंट की विशेषताओं को जांचें।

    • इसके बाद सभी तीन तत्वों का निर्धारण करना, जिनकी आवश्यकता नहीं है। आप दस्तावेज़ से उन लोगों को निकालने के लिए detach () विधि का उपयोग कर सकते हैं। उदाहरण के लिए elm1.detach () , elm2.detach () , और elm4.detach () । बेहतर अभी भी उन तत्वों की एक सूची बनाते हैं, आप हटाना चाहते हैं, और फिर अलग करें एक लूप में।

    चीयर्स।

    नोट: दस्तावेज़। निकालें (एलिमेंट एएमएम) विधि काम नहीं करेगी, यदि तत्व तात्कालिक बच्चे नहीं है अधिक देखने के लिए।


    .net - Tabcontrol: How can you remove the tabpage title? -


    I have been used to display more than one image file in an application. When I only display one tabpap, I would like to remove the title of TabPep, so I can use that screen space for the image. (This is similar to unchecking "Always show tab bar" in Firefox.)

    Is it possible to do with the taborer? Or is it better to use panel control when I open a single file (tab)?

    Yes, this is possible. Add a new class to your project and paste the code shown below to compile. Drop new control over your form from the toolbox.

      using the system; Using System.Windows.Forms; Public category MyTabControl: TabControl {Private Int mPages = 0; Private Zero checkonpage () {if (Israelwide) {int pages = mpages; Mpages = this.TabCount; If ((Page == 1 & amp; amp; amp; amp; & amp; 1;); (pages & gt; 1 & amp; amp; amp; amp; amp; amp; ; & Amp; amp; amp; amp; mpages == 1)) This RectateHandle (); }} Safe Override Zero OnControlAdded (ControlEventArgs e) {base.OnControlAdded (e); CheckOnePage (); } Safe Override Zero OnControlRemoved (ControlEventArgs e) {base.OnControlRemoved (e); CheckOnePage (); } Hide the tab by trapping the Safe Override Zero WndProc (Ref message message) {// TCM_ADJUSTRECT message if (m.msg == 0x1328 & DesignMode & this.TabCount == 1) m.Result = (IntPtr) 1; And base Weedproc (Ref M); }}