Posts

Showing posts from September, 2013

c++ - How can you detect if two regular expressions overlap in the strings they can match? -

I have a regular expression container, I want to analyze them to determine if they It is possible to produce a food string. In the case of this use, the lack of writing your own Regex engine, is there an easy way to solve this problem in C ++ or Python? There is no easy way. Unless your regular expression only uses the standard features (Perl lets you embed the arbitrary code in Milan, I think), you can generate from each one that is available for RE matches. Enters all the stars in a solid way. Looking at any pair of NFA, the intersection is empty if the intersection is not empty, some string matches (and vice versa) matches the RE. The standard decidability proof is to determine them in the first place, and then to build a new DFA whose states are two pairs of two DFA, and whose last state, those two states in fact that pair Are the last in their original DFA. Alternatively, if you have already shown the NFA supplement to calculate, then you can get the intersection by

algorithm - How to intelligently degrade or smooth GIS data (simplifying polygons)? -

I have a wide American county map from a dataset. I represent strikers, more boxes, less "noise to represent geographic features. "How can I get figures, how can I sample, smooth or degrade data - in this case only county boundaries and state lines, but maybe even in the general case? Sampling time may be provided if it can be done efficiently, or a parallel data set can be generated and stored. I am using, and lines are multi-polylines generated by shp2pgsql - but any solution where you take a squaggli line and reduce it to the smooth line of almost equal importance of human interpreter Very useful. The problem of simply throwing points is that you can distort the shape of the original polygon. One better way is to get it from the other direction; Start with the original approximation of the polygon and then refine it towards its complex shape upwards. An excellent example of this approach is that you start with two sides drawn from a complete polygon. Add one

resources - Eclipse indexer implementation -

I want to implement the Eclipse plugin, which parses. Property files and misses them with a key for quick search of these files. It should work similar to Open Type or Open Resource, but with the Properties key. I do not know what is the best practice to implement such a plugin, should it work as a builder? Is it self-registered for workplace changes, and should parse files on the changes? How quickly can I get all * .properties files through the resource API? To apply such a feature, I would recommend: Scan everyone, on the first run. The files in the workspaces by using the following code in the workspace. The results need to be retained on the disk in some way, so you do not have to scan it at every start. IWorkspace workspace = ResourcesPlugin.getWorkspace (); Workpace.getRoot (). Accept (New IRSOSOS Visitor () {Public Boolean Visit (IRSSOS Resource) {// Process Processing}}, IRSOsRDAPTHNFINETET, Incorrect); In this way you Will not interfere with them,

Simple math statements in bash in a for loop -

I am doing a lot to bash scripting and it is usually to avoid all costs, but I have to write a Bash script to execute a few simple things on a remote cluster. I have a problem for the following loop: {1..20} in <{p> i {1..20} E for tax in {1..20} (i * i + j * j) ** 5. & Lt; --- Pseudo code! Done Can you help me with this simple math? I have thrown $ everywhere and can not write it properly if you can help me understand how how to designate loops allocated in / bash and interpreted Bash math The limits (how do you square root?) I would be very grateful. Thanks! Here's a decent solution: for i in { 1..20} {1..20} Do the h for "scale = 3; sqrt ($ i * $ i + $ j * $ j)" | BC will output: 1.414 2.236 3.162 2.236 [... etc ...]

c# - TextBox with automatic culture formatting? -

I am trying to create a text box that only allows positive integer input, and it's a culture-specific formatting Should display the input automatically (in this case N-US, hence it should use the ',' symbol as the separator for large numbers). Therefore: An entry of 1000 in the text box should be shown as '1,000' An entry of 1,000 should be shown in this way, but it should be correctly ... Currently, no automatic formatting is done in the first case, and the second case turns an error from the validation rule. Implemented that the input is correct (which uses TryParse as a standard Check if the number is entered). I'm embarrassed to think about globalization and internationalization, so I'm wondering if there is some culture magic, I can work to isolate it. It The code-back to the text box is xaml: (Object value, CultureInfo cultureInfo) {UInt64 popValue; If (value == faucet) {new verification returns return (true, empty); } Else if

Parsing string interpolation in ANTLR -

I am working on a simple string manipulation DSL for internal purposes, and I want to support the language string string I would like to use in Ruby. For example: name = "bob" msg = "hello $ {name}!" Print (msg) # Print "Hello Bob!" I am trying to implement my parser in ANTLRv3, but with the use of ANLR I am very inexperienced so I am unsure of implementing this facility. So far, I have specified my string of text in laser, but in this case I have to clearly handle the interpolation material in the parser. The literal grammar of my current string looks like this: STRINGLITERAL: '' '(StringEscapeSeq | ~ (' \\ '|' '' | '\ r '|' | \ N ');' 'String StringEscapeSeq:' \\ '(' t '|' '' '' '' '' '' '' | '\\' | '$' | ('0' .. '9')); To handle the string in the pars literally, everything else sh

mysql - How to order data randomly -

I have the following MySQL, I want to drag the data in random order. Can I be taught in any way how can I please do it. $ Q = $ this-> Db- & gt; Query (include 'selection p. *, C. Et cattenam as F.P bytes; Category C at CID = Pc Series_id where c. Name = "front lom" and p.stats = "active") ; $ Q = $ this- & gt; Db- & gt; Query ('Selection P *, C. Leave P as Products with At CATAIN C Cd = P C category_ID where c = name = "front lower" and p.state = "active" in order Rand ()); You can use MySQL function to do this, note that it will actually perform slowly on a huge dataset (about ~ 10) in the MySQL table each The line will pick up a random number, so that the table can be large. A safe way to do a SELECT count (*) from the FROM table and a random number to pick up and LIMIT 1 to pick up the nth line, Make a query with n if you only need 1, or it will not work if you do not get results in that order

sql - Transpose a row into columns with MySQL without using UNIONS? -

I have a table that is similar to the following: id | Cat | A_bove | Top_level | 0 'printer' hardware 'computer' I want to be able to write a query, without using unions , which will return a result set to me this table What does it mean to move columns into rows, that is, I should have the result: id | Cat | 0 'printer' 0 'hardware' 0 'computer' Is it possible in MySQL? I can not go to the application level and can not execute it because I am feeding them in a search engine which will be an ID-based index. Various other DBMSs have something like PIVOT and Unpip. I would appreciate any insights missing something. Mahmud PS I am considering the re-normalization of the database as the last option because it will not be a trivial task. Thank you! I got out of this book, page 284-286: Mann Take that your table name is foo . First, pivot : create table smoke (count int); Insert that row as several rows because

iphone - can we property/synthesize to a sqlite3 *database object? -

मेरे पास कोड स्निपेट है, जो इस तरह से है ... #import & lt; sqlite3.h & gt; @ इंटरफेस डाटाबेस क्लास: एनएसओब्जेक्ट {sqlite3 * डेटाबेस; } @प्रॉपर्टी (नॉनैटोमिक, रिटेन) डेटाबेस; ////// यह ////// @एन्वन्वयन फ़ाइल में; #import "DatabaseClass.h" @implementation DatabaseClass @synthesize डेटाबेस; ////// यह /////// @end मेरा प्रश्न क्या मैं यह कर सकता हूँ (टिप्पणी की चीजें)। और अगर नहीं तो काम क्या है? अनुभवजन्य परीक्षण से पता चलता है कि < कोड> @ प्रॉपर्टी (गैर-रचनात्मक, बनाए रखना) डाटाबेस; काम नहीं करता (विशेष रूप से, संकलन नहीं करता है)। हालांकि, @property (nonatomic, असाइन करें) sqlite3 * डेटाबेस; करता है।

local - How to identify if currently logged in user is an LDAP user in Solaris -

I want to know whether the user currently logged in to Solaris is an LDAP user or a local user. Any command? or any runtime functions such as Getpname, getpwnam which tells a feature that it is an LDAP user or local user after the user's login? Ldaplist will tell you that the user has an entry in the LDAP database. This does not resolve the case where the user has an entry in the / etc / passwd file too. ldaplist passwd user name

c++ - How do I modify the internal buffer of std::cin -

I am writing a software that is std :: cin P> But it's unlikely that I'm trying to avoid the possibility that the password be pageted from memory to disk, so that I can write the password as soon as std :: cin I want to modify the buffer, with it M is done. Now I have this: std :: cin.clear (); Std :: stringstream ss; SS & lt; & Lt; "00000000000000000000000000000000000000000000"; Std :: cin.rdbuf (ss.rdbuf ()); Std :: cin.clear (); But I'm pretty sure this is bad because it does not take into account the current size of the can buffer. P> To get the beginning and end of buffer you < You can use the code> gptr () and egptr () . EDIT: As Charles Bailey told, it is preserved that my assumption is that if you want a stream buffer that you can clear your content on specified content, You want to apply that comes from one of the standard stream buffer classes, but a clear () member (or whatever name you find convenient)

visual studio - How to open file in existing Vim instance instead of getting "existing swapfile " warning -

I want Vime to reuse the current instance at present if it exists. Generally, Vim pops up a warning about an existing swap file. Specifically, this is to switch between Vime and Visual Studio (I know about Vimu, but this does not work with Visual Studio Express.) Poster's solution: Solution: A plugin in standard distribution of VIM It is: Runtime / Macro / Updating. Just copy it to the Wim Plugin directory. Visual Studio also for unity Description: in VIM to add as the external device and assigned convenient keyboard shortcuts: Title : Vim command: C: \ Program Files \ Vim \ vim70 \ gvim.exe argument: + $ (CurLine) "$ (ItemPath)" Initial Directory: $ (SolutionDir) Note I use slightly different settings so that the cursor is set to VS columns and centered in Vim: Argument: + "Call cursor ($ (CurLine), $ (CurCol))" + " Valid ZZ " $ (ItemPath) Initial Directory: $ (FileDir) Then set VS to: To effectively use bot

c++ - IContextMenu3 HandleMenuMsg2 is never called -

I try to apply a shell extension that IContextMenu3 and IShellExtInit , and I'm inserting the menu item in the method section but the method described in your project is called HandleMenuMsg2 or HandleMenuMsg . Can anyone please tell me what is required to get the code> HandleMenuMsg2 call My ATL object is implemented like that: // CTestPlugin class ATL_NO_VTABLE CTestPlugin: public CComObjectRootEx & lt; CComMultiThreadModel & gt ;, Public CComCoClass & LT; CTestPlugin, & amp; CLSID_CTestPlugin & gt ;, Public IshellExtInit, Public IContextMenu3 {Public: CTestPlugin (); ~ CTestPlugin (); HRESULT Final Construct (); Zero final release (); Public: DECLARE_REGISTRY_RESOURCEID (IDR_TESTPLUGIN) DECLARE_NOT_AGGREGATABLE (CTestPlugin) BEGIN_COM_MAP (CTestPlugin) COM_INTERFACE_ENTRY (IShellExtInit) COM_INTERFACE_ENTRY (IContextMenu) COM_INTERFACE_ENTRY (IContextMenu2) COM_INTERFACE_ENTRY (IContextMenu3) END_COM_MAP () DECLARE_PROTECT_FINAL_CONSTRUC

javascript - using jQuery AJAX with asp.net webservices always goes to error: instead of success: -

समस्या मेरे पास ए एएसएक्सएक्स वेब सर्विस फाइल (उसी वेबसाइट पर) पर एजेक्स अनुरोध प्रतिक्रिया जो वापस आती है, वह संगत नहीं है, हालांकि, "सफलता" कॉल बैक के विपरीत "त्रुटि" jQuery कॉलबैक को लगातार चलाता है। स्थिति कोड 200, 12030, और 12031 के बीच अलग-अलग होता है। कॉलबैक के लिए संदेश का responseText असंगत रूप से [रिक्त] और वास्तविक XML के बीच भिन्न होता है जो कि जेएसएन वेब सेवा रिटर्न मैं कोड को डीबग कर दिया, और webservice वास्तव में किसी भी अपवाद के बिना निष्पादित किया गया है। एएसपीएक्स कोड // संक्षेप के लिए छोड़ा गया कोड & lt; script type = "text / javascript" & gt ; JQuery (दस्तावेज़) .ready (कार्य () (jQuery.ajax ({type: "POST", contentType: "application / json; charset = utf-8", यूआरएल: "callDequeue.asmx / dequeue", डेटा: "{ } ", डेटा प्रकार:" जेसन ", सफलता: फ़ंक्शन (संदेश) {चेतावनी ('सफलता:' + संदेश। प्रतिक्रिया पाठ);}, त्रुटि: फ़ंक्शन (संदेश) {चेतावनी ('विफल:' + स

basic matlab help -

I'm doing strange work if I change the value 202 to variable B and 207 to B. Then by adding B + B to me Returns the correct answer 409. Now if I decrease B then gives me 0 instead of 5. If BTU does not use 202-207 (variable and A) then it gives me -5. What could be? EDIT: It also gets awkward. I have just seen that matlab gives me ab = 0 when I give it data matrix A = data (1,1), b = data (2,1) I give 202 and 207 values. If I assign directly to the standards and it does a normal job a = uint8 ( 202)); B = UIT8 (207); & Gt; & Gt; A-b ans = 0> & gt; 202-207 Answer = -5

sql - Insert Group By count results into a table -

How can you include a group with the result of counting in a group? I am trying to include a list of names with the count for each Thank you! You create a special query that gives you results you want, then you just insert it in front of Put on. Name: Name in Name (name, CNT), name (*) Name from person group Name:

c# - Spreadsheetgear.IWorkbook/workbook object. How Do I retrieve the length of the workbok? -

विकास प्लेटफार्म: .NET 2.0 प्लेटफार्म: एएसपी.NET स्प्रेडशीटियर: 2008 भाषा: सी # वहां है मैं दस्तावेज़ीकरण और सफलता के कई प्रयासों के माध्यम से गया। मैं बचत कर रहा हूँ कार्यपुस्तिका को SaveToStream विधि का उपयोग कर जो कार्यपुस्तिका को सीधे पृष्ठ में भेज रहा है। Response.OutputStream जो तब ब्राउज़र से बाहर निकल गया है। लेकिन चूंकि इस ऑब्जेक्ट के प्रकार स्ट्रीम है, यह सार क्लास लंबाई की संपत्ति को लागू नहीं करता है और इसे बाल क्लास में ढालता है जैसे मेमोरीस्ट्रीम नल वापस करेगा। दोनों मामलों में ऐप एक अपवाद फेंकता है। मुझे बाइट्स में लम्बी कब्जा करने की आवश्यकता है ताकि हमारे आवेदन में कार्यप्रदर्शन समीक्षा प्रयोजनों के लिए प्रवेश किया जा सके। मेरा उद्देश्य बचाना है उस स्ट्रीम को किसी अन्य ऑब्जेक्ट की प्रतिलिपि बनाने और यदि केवल संदर्भ का उपयोग करके संभव हो तो हम मॉड्यूल के स्मृति पदचिह्न को अनुकूलित करने की आवश्यकता करते हैं जो एक्सेल स्प्रैडशीट्स को एक्सपोर्ट में निर्यात करता है। यदि लंबाई की संपत्ति कार्यान्वित नहीं की जाती है, तो आप संपूर्ण स्ट्रीम को मेमोरीस्ट्रीम म

python - Raise unhandled exceptions in a thread in the main thread? -

There are some similar questions, but no one needs to answer me. If I make the thread through the threading Threads , which then throw exceptions that are unchecked, those threads are terminated. I want to keep the default print of exception details with stack trace, but also brought down the entire process. I believe that it is possible to catch all the exceptions in the thread, and it can be repeated on the main thread object, or it is possible to execute the default exception handling manually, and then a SystemExit . What is the best way to go about this? I wrote, in this way there is a lot to be included in this way. You do this on your worker thread: Try: self Except exceptions = self.do_something_dangerous (), e: import sys self.exc_info = sys.exc_info () and you do this on your main thread: < Pre> if self.exc_info: increase self.exc_info [1], none, self.exc_info [2] back self. Result The exception will be seen in the main form as if this work

iphone - New image taken with camera different than same image loaded from camera roll? -

When a user gets a new image taken with the camera and saves its checksum, Reloading the image From the camera roll, the checksum is different. Could it be because because the image saved in the camera roll is in JPG format, which is damaged, and therefore its pixel is different? I am trying to use checksum to find out that it is a single image: how can one overcome this situation by any idea? Do I need to save it as a GPG, then read it in memory so that I can get the same byte which will later get me from the camera roll? If I do, then I will also need to make sure that I save the same JPG format as a camera roll ... Thanks! Patrick I'm not an iPhone expert, but I know that while saving JPEG, many "quality" "Parameter, and if an image is encoded with slightly different parameters in JPEG format, then the pixel value will vary. So long as you can not image an image in JPEG, the same process as the properly camera roll, changing the image for JPEG is no

ruby - Tracking fitness in a genetic algorithm -

I'm still hacking on my old Ruby for the dead (I know, I know, bring back the post Stop trying to stop the dead chuck) but the code has got a little bit by hand and now I am working on a genetic algorithm to ensure that the last battle for survival is being prepared and how much to die with fitness There is a battle till the time. So, I have found its basic elements; How do I adjust the attributes of the game and get the solution of the solution, I do not understand how it is to store fitness so that I know that I have tried a combination before. I can not find very genetic code to see the code alone which I can read well about what he is saying. Does anyone have an idea how this is done normally or just an algorithm that can help me in the right direction? I do not understand how to store fitness so that I know that I have tried a combination before. In a GA solution generally you are not concerned about generating the same "solution" when the rate of imp

C macro/#define indentation? -

I'm curious why I format almost all macros in such a way: #ifndef FOO # Define FOO #endif Or this: #ifndef FOO #define FOO #endif But never: #ifndef FOO #define FOO #endif (Also, vim's = The operator only feels that the first two are counted as correct.) Is it between the compilers due to portability, or is it just a standard practice?

Update ms access database via vb.net -

How can I do this? I have a code code already, but it seems that it does not really work right here. Here's how my program works. I input an ID number (unique) on the text box and the click on the search button entries that correspond to the ID number are then displayed on the other text box. And then I try to manually edit one of the entries (by changing its letter or name) then I click the update button. Here's the problem: it actually updates the entry but it creates a mirror of the entry with a different ID number (may be automatically generated). So basically the MS Access database will now have an old entry and an updated version of the entry. If you want, I can show you my code as long as I will be assured of your reputation in this site. Show the code, it looks like you instead of Update By using . OK, check this link You think that disappearing 'This line will fail without the OleDbCommandBuilder. Builder.GetUpdateCommand () ago ada

codeigniter - How can I simplify this PHP? -

I have the following model functions with PHP. I know that I am repeating myself. Can anybody simplify this code anyway? function getTopMenus () {$ data [0] = 'root'; $ This- & gt; Db- & gt; Where ('parentid', 0); $ Q = $ it- & gt; DB- & gt; Get ('menu'); ($ Q-> num_rows ()> 0) {foreach ($ Q-> result_array ($ line as) {$ data [$ row ['id']] = $ row ['name '];}} $ Q- & gt; Free_Ralt (); $ data return;} function getheadMenus () {$ this-> db-> where (' parentid ', 0); $ Q = $ -> DB-> Receive ('menu'); if ($ Q-> num_rows ()> 0) {foreach ($ Q-> result_array (as the $ line) {$ Data [] = $ line;}} $ Q- & gt; Free_Ralt (); $ data return;} getrootMenus function () {$ this-> db-> where ('parentid', 0) ; $ Cue = $ it- & gt; db- & gt; get ('menu'); ($ Q-> num_rows ()> 0) {foreach ($ Q-> Results_re ( $ Line [$ data [$ row ['id']] = $ r

javascript - Why doesn't Internet Explorer render this page smoothly? -

Take a look at this page in IE 8: It looks fine for the first time, but Try to rotate on an item and then move your mouse again from the grid. Before After Note that besides the black border on the right side of the yellow item, the font looks different. How can I fix this? I will depend on all my money that it is due to your table based layout ... Try to use DIV instead. Here is a great example of changing all your tables / cells with the divisions: Check it in IE8 and you will see that you now have No problem ...

python - Call method from string -

If I have a python class and want to call it a function, depending on one variable, How will i I could think of it after the following: class CallMe: # Class Diff app (): # method one ... def foo (): # method two ... variable = "app "# CallMe.variable calling method () #Colling app () But is it not possible to do any other way of doing this? You can: Getattr (Columns, Variables ) () is an underlying method, it gives the value of the multiplied name of the object. In this case the value is a method object that you can call from ()

Avoid slicing of exception types (C++) -

I am preparing an exception hierarchy in my library for C ++. "Hierarchy" are 4 classes derived from std :: runtime_error I would like to avoid exception classes so that the copy constructor can be preserved. But apparently GCC requires the copy maker to throw their names, so the complainant about the secure copy constructor is complained. Visual C ++ 8.0 compiles exactly the same code. Is there any portable way to reduce the skiing problem for exception classes? Does the standard say anything about whether any implementation may require copy constructor of a class, which should be thrown away? I want to clear the exception hierarchy from your library separately. std :: exception Hierarchy as much as possible, and always get some exceptions from within that hierarchy. You may want to read, read, and read in particular. "Forcing Users to Catch By Context" , I'm not aware of it a well. The only way is that I have come up with an hour or play (this i

php - Extra changeColumns in Doctrine generate-migrations-diff -

I am generating migration between different yaml schema files: i.e. running: symphony Principle: Generated - Migrations-diff and the resulting migration file has a complete number of changes in column calls which were not included in the final schema file. For example, if you run Generate-Migration - whatever changes your schema file changes, you should get blank () function. However, the result for me is a change call column for almost every table in my database. Am I doing something wrong or is this a bug? Generate-migration-diff does not separate two different yaml files; it actually does not separate your model and its Compares the yaml file and then generates the migration based on the difference. If you are in sync with your yaml and classes, then your workflow should change the schema: Change the yaml file Generate - Migration-FIF To separate your current (replaceable) model with its (unchanged) model, it will generate a migration file in your principle /

Performance cost of Java dynamic proxy -

Many modern frameworks (Spring, Hibernate) provide very good dynamic behavior with the use of Java dynamic proxy, but what is the exact performance cost associated with it? Are the Sun Standards Available for JVM? Some signals: (Observe comments too) < / Li>

javascript - Can I change a value in parent page's JS from iframe's JS? -

I have a page with 3 iframes and this page loads JS files containing Var stayFifty = new boolean (wrong); And this function, which changes on the basis of this boolean On this page, I have an onclick function defined in an iframe toggle = function () {parent.stayFifty = new boolean (! (StayFifty.valueOf () )); }; Added to an IMG tag with onclick = "toggleFifty ();" But when I click on the IMG tag, the togglefactory function does not seem to be in the fire. I believe that something to do with this is how the togglefactive function is trying to remain frozen. Fuzzy Variables Can anyone explain how to fix this issue and a little bit about the scope of the scope? I tried to use the information from it but it seems that I do not understand anything. When you change the value of the stayFifty variable, then the original < / Code> Do not Remember Toggle = Function () {parent.stayFifty =! Parent.stayFifty; }; BTW, note that you do not ne

php - Cakephp comment form input keeps the same value after i press add -

I have created a blog site "Beginner Cake Php With A Newbie Profession" - David Golding. I have the comment view listed below: & lt; Div class = "comment form" & gt; & Lt ;? Php echo $ form- & gt; Create ('Comment') ;? & Gt; & Lt; Fieldset & gt; & Lt; Legend & gt; & Lt ;? Php __ ('add comment') ;? & Gt; & Lt; / Legend & gt; & Lt ;? Php Acor $ form- & gt; Input ('name'); Counterpart $ form-> Input ('content'); Counterpart $ form-> Input ('post_id'); ? & Gt; & Lt; / Fieldset & gt; & Lt ;? Php echo $ form- & gt; End ('send') ;? & Gt; & Lt; / Div & gt; & Lt; Div class = "verb" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt ;? Php echo $ html- & gt; Link (__ ('list comments', true), array ('action' => 'index')) ;? & Gt; & Lt; / Li & gt; & Lt;

C# - Explicit Interfaces with inheritance? -

आउटपुट: B-> नमस्कार! स्पष्ट से यह नहीं होना चाहिए:? ए-> हैलो! स्पष्ट से क्यों स्पष्ट नहीं (आईहेलो) एक कॉल IHello.Hello () कक्षा ए से? इंटरफ़ेस IHello {शून्य हेलो (); } वर्ग ए: आईहेलो ​​{सार्वजनिक वर्चुअल शून्य हैलो () {Console.WriteLine ("ए->" नमस्ते! "); } शून्य IHello.Hello () {Console.WriteLine ("A-> स्पष्ट से हैलो!"); }} वर्ग बी: ए, आईहेलो ​​{सार्वजनिक ओवरराइड शून्य हेलो () {कंसोल। वीडलाइन ("बी->"!!);; } शून्य IHello.Hello () {Console.WriteLine ("बी-> स्पष्ट से हैलो!"); }} वर्ग कार्यक्रम {स्थिर शून्य मुख्य (स्ट्रिंग [] एआरजी) {ए एक = नया बी (); ((IHello) क) .Hello (); }} नहीं, इसे नहीं करना चाहिए। कॉल करने के लिए नमस्कार टिप्पणी के बराबर है - एक IHello प्राप्त करने का मार्ग कोई बात नहीं है (जब तक कि उसे निष्पादन-समय की जाँच या रूपांतरण की आवश्यकता नहीं होती); संकलित समय प्रकार बस IHello या तो तरीका है, और इंटरफ़ेस मैपिंग वही है जो आपको वहां मिलता है। जब एक अंतरफलक स्पष्ट रूप से प्रकार पद

c# 3.0 - How can I import a csv file into Excel spreadsheet? -

I have not found a clue about this and hopefully you can help with some utility code. Do I have a comma delimited file and I have to import it in AXA? Any thoughts? It is for Windows as an application in C # 3.5. Thank you You want to look at the OLE automation. You will intimate and control Excel application objects from your C # code.

php - Using JavaScript to Modify a Page on the Fly based on <select> contents -

So, I've got a form and a inside the form . Which is based on the selection (which is option & gt; selected), I have to change the contents of the form on the fly (i.e., before the user clicks anything). For example, if the user selects the Photo upload option, a file upload box will appear, and if they select text entry , This file upload box will appear instead of a text box. Thank you. function swapDiv (index) {var html = ''; Assign html var based on the index {... // index; } Div.innerHTML = html; // div html html allocations} select.onchange = function () {swapDiv (this.selectedIndex); }

command line - run Matlab in batch mode -

It seems that there are two ways to run a mailback in batch mode: First: unavailable DISPLAY matlab & gt; Matlab.out 2 & gt; And 1 & lt; & Lt; EOF Plot (1:10) Exit the print file EOF The second option uses the option "-r MATLAB_command": matlab -nojvm -nosplash -r MyCommand Are these two equal? What is the "& lt; EOF" in the first method and what is the last "EOF"? Thanks and connection! The first method is only standard output & gt; Matlab.out and standard error 2 & gt; And 1 in the file matlab.out . Then it is passing input to MATLAB (this is not specific to MATLAB, it is normally a method of passing multiple lines as the input of command line programs). Syntax After a unique identifier, then your text, finally, can end up with unique IDs you can open it on: Cat -r option begins on MATLAB and immediately executes the given details. This is some command or path The name of the scrip

PHP boolean TRUE / FALSE? -

I do not understand this. If I write: function myfunction () {...... if ... return true; If ... return is wrong; } Why can not I use it: $ result = myfunction (); If ($ result == true) ... if ($ result == wrong) ... Or I have to use it: $ Result = myfunction (); If ($ result == 1) ... if ($ result == 0) ... or this: $ result = myfunction (); If ($ result) ... if (! $ Result) ... I can not fully understand your question, but you can do use any of the examples provided with the following alerts: If you (If = a == TRUE) (or, because the comparison of true is redundant, just if (a) ), then you should understand PHP will evaluate several things as truth: 1, 2, 987, "Hello", etc.; They are all "true" values. It is rarely an issue, but you should understand it. However, if the function can return more than true or false , you may be interested in === Using the === compares the type of variable: "a" == true is

iphone - How can I make my UIScrollView move only when I drag it? -

I do not want to scroll the UIScrollview. But only when I pull her away is the only step. So that when I stop it will take the fingers of it I have kept several images about it. previously answered

windows - How can I create a sleep function in 16bit MASM Assembly x86? -

I am trying to create a sleep / delay process in the 16bit MASM assembly x86 that is, print a letter on the screen Every 500ms I've done the research, it seems that there are three ways to achieve this - I would like to use one that uses the CPU clock pocket. Please note that I'm running Windows XP on Mac through VMWire Fusion OS X Snow Leopard - I'm not sure that it affects anything. Can someone point me in the right direction, or can I provide a piece of code that I can do? Thanks! The code I get should print 'A' on screen every moment, but it does not work (I want to use milliseconds in any way). Top: MOV AH, 2C INT 21 MOV BH, DH; DH is the second GETSEC current :; Loops BAH MOV AH, 2C INT21 CMP BH to the last second is not equal to the last in DH; Comparison of Loop Exit and 'A' JNE Printa JMP Gatessek Printata: MOV AH, 02 MOV DL, 41 IN 21 JMP Top EDGE: After the advice of GJ , Here's a method just call it Daily Proxy Timer: MOV

mysql - Connect with a database over the LAN -

How to connect to a database on LAN? I have a computer's name > Users 'Your System Remotely Connects to MySQL DB. You can use the instructions to do this.

How to pass server urls to Watir Ruby unit tests run by Rake under Thoughtworks Cruise -

I am currently creating a suite of water trials for my pure web application. I have made walker tests in Thattvracks Cruise continuously using the racks. What is the best way to pass multiple server URLs in water trials, so I can run tests against many different environments? Like I only store server URLs in one variable if one If there are more than, then it can be useful. You can store them in a file (format is popular) What is the problem you are trying to solve? URLs are changing a lot?

How to escape the % sign in C's printf? -

How do you avoid% while using printf in C? printf ("hello \%"); / * Do not like it * / You saved it by posting the double '%' Use this example: %% Use your example: printf ("hello %%"); The escape sign of '%' is for printf only if you do: four [5]; Strapepi (A, "%%"); Printf ("This is the value of one:% s \ n", a); It will print: This is the value of one: %%

ruby on rails - Is it possible to see via which child class was a parent's static method called in Java? -

A small background first. I am looking at the possibility of applying Ruby's Active Record in Java as clearly and briefly as possible, to do this, I will be allowed to call the following types of method: Person person = person.find ("name", "mike"); Whatever is sorted out: ActiveRecord.find (person class, "name", "mike"); This plan is to provide an active record to the person, which will have a stable search method with two parameters (column, value). This method will need to know that it was called through the person. There is no other domain class like searching and car. Find and Call Find (class, string, object) method to perform actual operation and call. The problem is going on in I through the detection of the child of the active cell which was called the Stable Search Method (two Ultimate). The following is a simple test case: Public class A {Public static zero testMethod () {// Need to know if A.testMethod (), B.t

.net - Extension method for fill rectangular array in C# -

I want the extension method to write to fill the multi-dimensional rectangular array. I know how to do the array with a certain number of measurements: fill the public with a static void & lt; T & gt; (This t [source], t value) {for (int i = 0; i Can I write a fill method for all multi-dimensional rectangular array? You can change the fixed dimension parameters in an array parameter so you can add extensions to any array. Then I repeated through each position of the array. Fill the public static void & lt; T & gt; (This array source, t-value) {fill (0, source, new tall [source rank, value]); } Fill in constant void & lt; T & gt; (Int dimension, array array, long [] indexed, t value) {var LowerBound = array.GetLowerBound (dimension); Var upper bound = array.getupperbound (dimension); For (int i = low bound; i & lt; = upper bound; i ++) {index [dimension] = I; If (dimension

Hibernate, C3P0, Mysql Connection Pooling -

I recently switched Apache DBC connection pooling to C3P0 and to see that I have connection timeout problems I did not do this in the past with DBCP and Tomcat, so I am thinking that this is a configuration problem or a driver issue. Whenever I waste the server for a while, I think some content will not be sent (as the server can not connect or do anything). When I refresh the page, all the contents are there. Does anyone recommend using MySQL connection pool because I am using MySQL anyway? What are your experiences with the MySQL connection pool? Walter If you have a database of timeout connections after a certain time of inactivity , They are already closed and when borrowing from the pool, they are unusable if you do not want to reconfigure your database server or not When you borrow from the pool, check the connection with the test query (C3P0 and other connections) G) can configure. You can find more detailed information in Edit: Surely you are right, it is also

Custom Error Handling in ASP.NET MVC -

I have tried to apply the answer listed here: which came from this blog post: All I get is an empty page I step through the debugger and hold me the exception, the error is called the controller method and see the return to execution, but then I do not see anything in the web browser. Firebug tells me that I got back 0 byte feedback from the server and the URL has not been changed to the error controller. any idea? No problem, I got the answer. Copy and paste error in my example is called error, in instances it is called index.

linux - Jboss war redeployment Zipexception -

सभी, सर्वर: jboss-5.1.0 जावा संस्करण: jdk1 .6.0_14 परिनियोजन विधि: चींटी v1.7 - त्रुटि: 08: 40: 04,260 चेतावनी [ज़िप एंट्री कॉन्टैक्ट] इग्नॉरिंग: संदर्भ को दोबारा शुरू करने में विफल: vfszip: /home/username/jboss-5.1.0.GA/server /default/deploy/deployment.war java.util.zip.ZipException: ज़िप फ़ाइल को खोलने में त्रुटि त्रुटि तब होती है अगर सर्वर चल रहा है और मैं एक चींटी परिनियोजन चलाता हूं स्रोत कोड यह सब हमारे सर्वर पर छः के माध्यम से किया जा रहा है। मैंने हमारी JBOSS सेटिंग्स की खोज की है, लेकिन इस त्रुटि से छुटकारा पाने के लिए कठबोली सही लगती है। विचार? अपडेट: ये हमारी परिनियोजन विधि है & lt; लक्ष्य नाम = "तैनात" निर्भर = "युद्ध" विवरण = "- & gt; तैनाती लक्ष्य (प्रारंभ में खाली)" & gt; & Lt; copy file = "scripts / xmlscript.groovy" todir = "$ {jboss.bin.dir}" ओवरराइट = "सच" / & gt; & Lt; कॉपी फ़ाइल = "grails-app / views / xmlservice / current.xml" todir = "$ {jboss

parsing - Check sql script valid -

As part of a release, we load PL / SQL scripts against a database. Recently someone has written a code from the end of a line to ; left, which was called the second script, so it meant that the script did not work. Because it was not the cause of any error, it was not a part now, it took a lot of time to know what had happened. I want to check those scripts, either ; are missing at the end or after a / , it is made more complex because 'line' in the script can actually extend more than one line if this statement Is the statement or block of. For me it seems like this, I need to parse the scripts and then tell that they meet. I have found and wondered if this could be a way of doing this because it seems that this is just a step to learn for a simple test. Does anyone know an easy way or any other device, eclipse plugins etc. that I can use to check the lines in the script which is ; either end or after the / line? Update We do most of the stuff already. Sc

php - Continue not going to loop start -

I'm having trouble understanding this bug. Here's the code: function filter_optionsfordash (array $ data, $ dash) {$ filtered_options = array (); $ Lane = stellen ($ dash); Foreign currency ($ k = $ value as $ data) {if (substr ($ k, 0, $ len) === $ dash) {$ option_name = trim (str_replace ($ dash. '_' , '', $ T)); Switch ($ option_name) {case 'displayColumns': $ value = explosion (',', $ value); break; Case 'DesleteTit': $ option_name = 'title'; break; Case 'ID': Case 'Module': Case 'Action': Case 'Configure': Case 'to_pdf': Continue; break; } $ Filtered_options [$ option_name] = $ value; }} Return $ Filtered_options; } What I'm trying to do here is to filter some values ​​from the array (in this case it will be $ _ POST ) given Name ( $ dash ), but I want to filter people with 'id', 'module', 'action', 'configure' or 'to_pdf'. So th

php - how to populate the second drop down using the selected value in first drop down? -

Say I have two drop-doses that are populated during my JSP load & Lt; Id = "group" name = "group" & gt; Select - First Drop Down & lt; Option value = "0001" & gt; 1 & lt; / Options & gt; & Lt; Option value = "0002" & gt; 2 & lt; / Options & gt; & Lt; / Select & gt; & Lt; Select ID = "Sub Group" name = "square" & gt; - Second drop down & lt; Option value = "0001-000"> A & lt; / Option & gt; - Option Price 001 & lt; Option value = "0001-010" & gt; B & lt; / Option & gt; Sub group associated with & lt; Option value = "0001-020" & gt; C & lt; / Option & gt; & Lt; Option value = "0001-030" & gt; D & lt; / Options & gt; & Lt; Option value = "0001-040" & gt; E / option & gt; & Lt; Option value = "0002-000"> F. & lt; / Options &a

Turning Off Timestamp Formatting in MySQL -

I have several timestamp columns that I need to use with mixed time zones. Users are set to set the time zone in the language that I am using for front-end so that I need a MySQL to return UNIX timestamps from a selective *. Is there a way to stop auto formatting while retrieving data from the MySQL timestamp column? YYYY-MM-DD HH: MM: SS timestamp column in MySQL Is the default representation for I do not believe you can change it at a global level. Two options: One SELECT * , SELECT *, UNIX_TIMESTAMP (your_timestamp_column) your_temstamp In the form, which will add a unix-formatted your_timestamp column for the result. Create a view for each table () that does the same thing, for example select your website *, select UNIX_TIMESTAMP ( Your_timestamp_column) as your_unix_timestamp your_table; You can SELECT * your_view and get your UNIX timestamp without adding your questions. Reference:

asp.net - How to compare two XML files and add missing elements using c# -

Occasionally, one or more XML elements are missing from the XML file. Right now, I am thinking that comparison of an XML file is compared to a master XML file (with all elements) and if any element is missing, then add that file to the XML file from the master file. How do I get this or any other better idea? One of these looks around the Microsoft site is the best library XmlDiffPatch library I found you get more information But it essentially allows you to compare two documents, find all the differences and then apply those differences. is very useful for inserting XML files to send across a network

c - audio to 8-bit text sample conversion -

I have an interesting question today. I need to change some Pokemon audio files. The list of 8-bit samples (0-255 values) I am writing the regularity of an assembly on the MC6800 chipset For which these sounds will be required. I am planning to include an array with 8-bit samples, when a function is called during the program loop. Does any audio files (wav / mp3) differ from a comma-list 8-bit text sample values? Or anything from this relative method? Thanks in advance! You can use a command-line to convert files to raw, unsigned 8-bit Can use "socks" device or audacity audio editor mono audio file. In Audacity 1.3 or higher, open the audio, then select Export, select "Wave, AIFF, and other uncompressed type formats", then click Options ... - then "Other. .. "for the format, for" Raw "header, and 8-bit PCM as encoding. (Sorry, unsigned is not available.) Try sock with command-1 for 1 channel, -t for raw, unsigned line-for-

install - Error when Updating/Installing software in Eclipse 3.4.2 -

I am trying to install the plug-in to update the installed software and to get a new installment 3.4.2 . Whenever I try to update / update, I get this error: "An unexpected error occurred while preparing for the operation. Org.eclipse.core.runtime.AssertionFailedException" < P> Description: "An error occurred while preparing for unexpected operation. Null argument:" log file entry org.eclipse.core.runtime.AssertionFailedException: null Logic: at org.eclipse core.runtime.Assert.isNotNull at org.eclipse.core.runtime.Assert.isNotNull (Assert.java:86) (Assert.java:74) org.eclipse.equinox.internal.provisional.p2 On .metadata.ProvidedCapability & Lt; Init & gt; On org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.createProvidedCapability (MetadataFactory.java:189) (ProvidedCapability.java:25) .io.MetadataParser on org.eclipse.equinox.internal.p2.metadata.repository $ ProvidedCapabilityHandler & Lt; Init & gt; (MetadataP

sql - How do you retrieve the new keys from an INSERT INTO SELECT FROM query? -

Is there a way to recover all the keys of new inserted records used in any INSAT ... Select from query? entry @myvar Populate dbo.argetTable in table (id int) INIDED IN. Select @mivor * from dbo.SourceTable SELECT * FROM @MyVar

iphone - Can I limit the character set for a UITextField? -

I have a bitmap font that does not contain any letters, such as pronunciation characters (é î ü etc) or symbols such as " ¥ "or © which I'm using to display the user name in a game for highscore table. Is it possible to limit the UI keyboard to certain characters, or only certain characters are allowed in the UTIPField? Or do I have to roll my input mechanism? I'm thinking and old school, arcade style, once a "thing" a letter will be fine. You can try to use the following UITextFieldDelegate method: < Code> - (BOOL) textField: (UITextField *) textField shouldChangeCharactersInRange: (NSRange) Category Replacement String: (NSString *) string;

odbc - Using 4-part naming to do insert to DB2 from SQL Server 2005? -

We are using DB2 9.1 on Linux and SQL Server 2005, and the IBM DB2 ODBC driver. We have the linked server to DB2, from SQL Server, I can do the following: - I link a new table on the DB2-I, OK exec ('Table vs. testiciliabI (T1_DEV_USER_XXXX) In TESTSylviaB (field1 int)). Part 4 can use it to use naming, as long as I leave the second part and put everything in the upper case, choose * from * LINKDB2..DEV.TESTSYLVIAB * - I can use Exec (Which is from the nearest) exec ('insert.t DEVTestSylviaB (field1) value (1)') on LinkDB2 - but I can not insert it through the naming of standard 4 part, like this: LINKDB2 .. Enter the DEV.TESTSYLVIAB values ​​(1) I get the "Driver not enabled" error message Is: Linked Server "LINKDB2" for Oeli DB provider "MSDASQL" return message "[IBM] [CLI Driver] CLI0150E Driver not capable. = SlC00" made. Message 7343, Level 16, State 2, Line 1 OLE DB Provider "MSDASQL" table for linked serve

Does SQL Server even look at a table when joining on a variable that returns false? -

If I join table A in table A in this way ... Select A * Exclude from External A to A.Id = BAID and @param = 'some value' and @love is not equal to 'some value' The server also tries to match the record from Table B or is it sufficient to know that this situation will never be true? As a general rule, SQL For the @ scheme > Therefore, in a particular context, you can know that when a different value of the @ If the outer joining table can never be checked , you should not rely on it for the right. Note that probation means that the actual values ​​are searched in the table. Metadata information will be checked always for example you can not be cheated to join a table and can not ask if it does not exist. Specifically, do not try to create a single query, where there should be two separate sites).

Google Query from Java? -

I am writing a Java program, and I need a function, which is given a string, Google returns the number Returns that query returns made from search How can I do this? (Instead of bonus points for the same answer, but with bing .) For example, googleHits ("Is anyone actually going so far That even even the decision to use is more visible? ") 131,000,000 will return (or even many). Related: I" Your What does the "suggestion programmatic approach? (Like "Search", "Your Surge" returns "Did you Circus ?") found: You can legally use Google AJAX Feed API through your funny interface: Bing is still a developer Program where you can call against their API in a JSON / XML or SOAP case:

c# - Strange Console MoveBufferArea IOException -

I was making a "reverse console" (so that the written row is attached to the top instead of the bottom) I have a console Stuck on a very strange behavior. MovBufferArea method: static zero main (for (var_linesWritten = 0; _lines written & lt; 1000; _lines written ++) {var _height = Math Minimum (console.bufferhit - 1, _line written); console.mob buffer area (0, 0, console buffer wide, _heit, 0, 1); console.setcorption (0, 0); console.light line ("line {0} aaaaaaa", _ Links written); Console.ResetColor ();}} When I call it a certain number, then it is a system .IO.IOException says: "This command is processed Enough to do I'm not aware that this buffer depends on the quantity of the area moving around, the number of lines written before the exception changes, as I have changed the console, buffer width properties. I'm running 7 7x64 @ korei 7, 6GB DDR3, so storage problems can not be a problem ... Do anyone have any clue? Which can be wr

Zend Framework: How and where to create custom routes in a 1.8+ application? -

I have not created a custom route before, but in the end I need one. My question is: How can I make a path, and where do I create it? I am using Zend Framework 1.9.6. Here's how I did it. There may be a better method, but I think it is as easy as it is: # /application/bootstrap.php protected function _initSpecialRoutes () {$ router = Zend_Controller_Front :: GetInstance () - & gt; GetRouter (); $ Router- & gt; Ad-root ('Verify', New Zend_Controller_Router_Route ('Verify /: Tokens', Array ('Administrator' = & gt; 'Account', 'Action' => 'Verify'))); $ Router- & gt; Add-root ('arbitrary-path-name', new Zend_Controller_Router_Route ('special / path /: variable name', array ('admin' = & gt; defaultcontrollername ',' action '=>' defaultactionname '))) ; }

ajax - creating custom pages with jquery php -

There are 3 tabs at the top of my page. I.e Home | Profile | + Now I think the user (+) can create his own custom page when clicking on the icon / button ... !! How can I do this in a way: 1: How can I get a php AJAX 2: User enters the page name; AJAX is requested on a PHP script 3: PHP script creates a page in the DB with submitted title. 4: with Ajax response; You can redirect the user to the newly created page and edit it. There may be many solutions to it.

c++ - Generic VC++ vs g++ query -

I have trouble understanding compiler. The following code works under G ++ in Unix, but VC + Under this it will not even compile. Why can any reason provide any reason? #include & lt; Stdio.h & gt; # Include & lt; Iostream & gt; #include & lt; String.h & gt; using namespace std; Int main () {string tmp_nw_msg, crc_chksum, buffer; Cout & lt; & Lt; "Enter the string:"; Cin & gt; & Gt; Buffer; If (strollon (buffer c_st ())> 15) {tmp_nw_msg = buffer sbbit (1,12); Crc_chksum = buffer concert (13,2); Cout & lt; & Lt; "N / W msg:" & lt; & Lt; Tmp_nw_msg & lt; & Lt; Endl; Cout & lt; & Lt; "CRC Chaksam:" & lt; & Lt; CRC_Chixam & lt; & Lt; Endl; } And {cout & lt; & Lt; "Error" & lt; & Lt; Endl; } Std :: cin.get (); Return 0; } The following error has been thrown by VC ++, but this work is fine in G ++. Error 1 error C2679: binary '>&g

ajax - Javascript error -

Error: Invalid regular expression flag b source file: line: 4, column: 1 source code: url: / html / Error: Home / Blog, $ ("# blog"). Click (function () {var url = $ (this) .attr ("href"); $. ({Url: / home / blog, type: "POST", success: function (html) {$ ("# SomeDiv "). Attachment (html);}}); }); I do not know what the error is, should my URL be in the string? What am I missing? You want the url to be "home / blog"