Friday, 15 August 2014

xsd - Add an XML schema to Visual Studio -


I want to support Intellisense while writing the XML configuration file for the APPink section or NIBNET component Log4net, or Unity

(Suppose we have a schema file.)

Yes, it is possible that you need to associate the schema with the document and the XML editor will then provide intellisense.


  • .net - Mocking a Static Class -


    I have a static class that wraps some of the basic methods by winspool:

      Public static class WinSpool {[DllImport ("winspool.drv")] Public static extern int OpenPrinter (string pPrinterName, Outside IntPtr phPrinter, IntPtr pDefault); ... // some other methods here}  

    I want to duplicate them for unit testing, but could not find a pattern for it. (Do all have to save static classes?)

    Yes, stable class usually happens at AAAIK Open Source Mocking framework (like) supports stable class jokes

    If you want to duplicate the static class absolutely and positively, then I am afraid you should go, which is not free is.


    The server could not load DCOM error -


    मेरे पास एक स्थानीय SQL 2000 डेटाबेस है मेरा विनफ़ॉर्म ऐप अचानक मृत्यु हो गई जब सभी एक संग्रहीत प्रक्रिया की कोशिश कर रही थी जो कि परिवर्तित नहीं हुई है। यहां पर तेज़ त्रुटि संदेश है:

    सर्वर: संदेश 7404, स्तर 16, राज्य 2, प्रक्रिया रिकॉर्डअनुक्रम 2, पंक्ति 45 सर्वर DCOM लोड नहीं कर सका।

    तब मैंने देखा कि जब मैं कोशिश करता हूं क्वेरी एनालाइज़र का उपयोग कर सपा को बदलने के लिए, मुझे एक ही त्रुटि मिलती है जब मैंने ALTER आज्ञा को निष्पादित करने की कोशिश की। मैं संग्रहीत प्रक्रिया कांट छांट, कोर कोड कि त्रुटि जब निष्पादित का कारण बनता है छोड़ने:

      GO सेट पर सेट QUOTED_IDENTIFIER पर GO ALTER प्रक्रिया dbo.RecordCurrentUser2 ANSI_NULLS (@xmlUser varchar (8000)) के रूप में शुरू घोषित @Now datetime घोषणा @ChangedRecordCount पूर्णांक --Normally इस पर टिप्पणी की है, लेकिन परीक्षण के लिए, हम कड़ी मेहनत का कोई पैरामीटर मान कोड होगी: सेट @xmlUser = '& lt; उपयोगकर्ता & gt; & LT; उपयोगकर्ता & gt; & LT; EmailId & gt; chad.smith@effedupcompany.com< / EmailId & gt; & LT; अंतिम नाम & gt; चाड & lt; / अंतिम नाम & gt; & LT; FirstName & gt; स्मिथ & lt; / प्रथम नाम & gt; & Lt; आरंभिक / & gt; के & lt DOMAINNAME के ​​& gt; एनए & lt; / DomainName & gt; & LT; खाता & gt; स्मिथ & lt; / खाता & gt; & LT; TelephoneNumber & gt; 179-1458 & lt; / TelephoneNumber & gt; & LT; PeoplesoftId & gt; 031X45 & lt; / PeoplesoftId & gt; & Lt; विभाग & gt; इकट्ठा करने के लिए द्विपक्षीय रिपोर्टिंग & lt; / Department & gt; & Lt; StreetAddress & gt; 58 हिल रोड & lt; / StreetAddress & gt; & LT; PostalCode & gt; 06333 & lt; / PostalCode & gt; & LT; स्थान & gt; मुख्य & lt; / स्थान & gt; & LT; राज्य & gt; एके & lt; / राज्य & gt; & Lt; देश & gt; संयुक्त राज्य अमेरिका & lt; / देश & gt; & Lt; / उपयोगकर्ता & gt; & Lt; / उपयोगकर्ता & gt; ' DECLARE @DocHandle int SET @NOW = GETUTCDATE () - XML ​​दस्तावेज़ का एक आंतरिक प्रतिनिधित्व बनाएँ। EXEC @DocHandle आउटपुट, @xmlUser --Put एक अस्थायी तालिका में एक्सएमएल स्ट्रिंग की सामग्री चुनने EmailId, अंतिम नाम, प्रथम नाम, प्रथमाक्षर के रूप में प्रथमाक्षर, DomainName, खाता, TelephoneNumber, PeoplesoftId, विभाग, StreetAddress, PostalCode, स्थान, राज्य sp_xml_preparedocument, देश, OPENXML से #TempItems जांच OtherTelephone, NonUnisysDomainName, NonUnisysAccount (@DocHandle, '/ प्रयोक्ता / उपयोगकर्ता', 2) के साथ (EmailId nvarchar (80), अंतिम नाम nvarchar (50), प्रथम nvarchar (50), प्रथमाक्षर nvarchar (30) , डोमेन नाम नर्वचर (10), खाता nvarchar (10), TelephoneNumber nvarchar (50), PeoplesoftId nvarchar (50), विभाग nvarchar (50), StreetAddress nvarchar (50), PostalCode nvarchar (50), स्थान nvarchar (80), राज्य चार (2), देश nvarchar (30), OtherTelephone nvarchar (50), NonUnisysDomainName nvarchar (10), NonUnisysAccount nvarchar (10)) अंत  

    निम्न सेवा, मेरी मशीन में चल रहे हैं, हालांकि वे प्रासंगिक नहीं हो सकता है: वितरित लेनदेन समन्वयक (एक स्थानीय डीबी नोट-चल रहा है) COM ++

    मैं हाल ही में कुछ भी जानबूझकर स्थापित नहीं किया था, हालांकि मुझे याद है कि एमएस पैच को देखने से कंपनी नीति द्वारा स्वचालित रूप से लागू किया जाता है, निश्चित नहीं कि यह कैसा था या कैसे पता करें।

    मैं इस त्रुटि को कैसे सुलझा सकता हूं?

    मेमोरी लीक को रोकने के लिए आपका कॉल कहां है?

    एक पर्सेड दस्तावेज़ SQL सर्वर के आंतरिक कैश में संग्रहीत है MSXML पार्सर (Msxmlsql.dll) एक आठवें SQL सर्वर के लिए उपलब्ध कुल स्मृति का उपयोग करता है।

    संपादित करें: SQL Server 2000 से 2008 तक कम से कम


    regex - Javascript - replacing a word using regexp only if there's a space around it -


    A small version of my code type looks like this:

      string = "test test Test Test Test Test "; Replacer = "test"; String = string.releast (new regxp ('+ +', 'gi'), "replaced");  

    Now, I want to change one word only when it is around, this code really works well, but I am thinking that in my case a bottom RegExp ('\ s' + replacer + '\ s', 'gi')

    Why do not you run it:

      RegExp ('\\ s' + replacer + '\\ s', 'gi')  

    opengl - Simulated time in a game loop using c++ -


    I am making a 3D game as a hobby of OpenLL and SDL from scratch in the CD and about this area To learn more about programming.

    Thinking about the best way to simulate time while running the game. Obviously I have a loop that looks like this:

      void main_loop () {while (! Quit) {handle_events (); DrawScene (); ... SDL_Delay (time_left ()); }}  

    I am using SDL Della and Time_th () to maintain the framerate of approximately 33 FPS.

    I thought I needed some global variables

      int current_hour = 0; Int current_min = 0; Int num_days = 0; Uint32 prev_ticks = 0;  

    Then like a function:

      zero handle_time () {Uint32 current_ticks; Uint32 dticks; Current_ticks = SDL_GetTicks (); Dticks = current_ticks - prev_ticks; // Get the difference from the last time // If the difference is more than 30000 (half minute) the pay scale game is minutes (dticks> = 30000) {prev_ticks = current_ticks; Current_mins ++; If (current_mins = 60) {current_mins = 0; Current_hour ++; } If (current_hour> 23) {current_hour = 0; NUM_DAYS ++; }}}  

    and then call the handle_time () function in the main loop.

    It compiles and runs (moment to write time in the console using printf) but I am thinking that this is the best way to do this. What are the easy ways or more efficient ways?

    I mentioned this before in other game related threads, like always, with the suggestions of Glenn Fidelell Follow

    What you want to do is use continuous timestep which you get by depositing the delta of time. If you want 33 updates per second 33, then your constant timestep should be 1/33. You can also call it update frequency by presenting you should reduce the game logic as they are not together. You want the machine to be able to use the short updates frequency as fast as possible while rendering. Here are some sample codes:

      running = true; Unsigned int t_accum = 0, lt = 0, ct = 0; While (running) {while (SDL_PollEvent (and event)) {switch (event.type) {...}} ct = SDL_GetTicks (); T_accum + = ct - lt; Lieutenant = CT; While (t_accum> = timestep) {t + = timestep; / * This is our real time, in millisecond * / T_accum - = timestep; (Std :: vector & gt; unit & gt; :: for iterator en = entities.begin (); en! = Entities.end (); ++ en) {integrated (n, (float) t * 0.001f, Timestep); }} / * This should actually be in a separate thread, a mute x * / std :: vector & lt; Unit & gt; TmpEntities (entities.size ()); For (int i = 0; i & lt; entities.size (+) i) {float alpha = (float) t_accum / (float) timestep; TMPNTI [I] = InterpolateState (Institutions [I] .ST, Alpha, Institutions [IRA] .CRRT, 1.0F - alpha); } Render (tmpEntities); }  

    This controls undersmappeling as well as overspelling. If you use integer arithmetic here, then your game physics must be close to 100% deterministic, even if the machine is slow or Be sharp This is the benefit of increasing time in fixed time intervals. The state used for rendering is making a distinction between previous and present states, where the remaining value of time is used in the accumulation process as the interpolation factor. This ensures that rendering is smooth, no matter how big the timestamp is.


    animation - constraining drag move along a path in iphone -


    I am making an app in which the balls are rolled onto the tracks.
    When we touch and drag the balls around the screen, they should proceed with the tracks if the drag is too far from the track, then it should be closed. Tracks can be any size what is the best appraoch ..?

    It depends on how the track is defined in the program, but it is a CGPath Found that can show it, or create one, the experiment can use CGPathContainsPoint in the touch method and if it is outside the path, then refuse to update the position of the ball.


    user interface - Porting X/Motif GUI application to Windows using wxWidgets -


    Is an Expert built on X / ATP GUI on the Solaris platform possibly possible to use Windows WX-Weddets? If so, is it easier to port wxWidgets than other GUI builders like QT or Visual Studio?

    It is definitely possible to port WxWidgets to a shape application, but you can retain too many code Will not be able to keep In other words, this would be a non-trivial undertaking - but it would be true whether you use wx, Qt or some other (but using a portable framework looks like a better idea if you have unix background but its Required to work under Windows)