Saturday, 15 June 2013

bash - sed - how to remove A-Z from second column -


I'm able to do it in pieces through awk print $ 2, sed [az] etc., but how do I Is this all through a single stream on a single stream?

  host_192.168.0.100 host_192.168.0.100   

current

  host_192.168.0.100 192.168. 0.100   

In addition, 'host' is just a placeholder, I really want 'all' letters that leave numbers / punctuation marks. Edit: Underscore will be good to catch, but I'm sure I can understand that there are some other common examples: abababab-abababab- 000.000.000.0 ab-ab-abababab -abababab-000.000.000.0 01-admin-10.10.10.10 01-admin-10.10.10.10 10.10.10.10-NAT 10.10.10.10-NAT 1test-10.10.10.10 1test-10.10.10.10

Thanks!

Looking at the second example, it seems that you want to appear after the first white space To remove all non-digits, logically Git before the first DI. You need to remove dashes, underscores, even dots, as well as letters; Anything that is not a digit gives this suggestion:

  sed -e 's / [^ 0-9] * / /'   

Quite easy, but meets your criteria:

  $ cat data host_192.168.0.100 host_192.168.0.100 now-now-nowabbab-abababab-2000,000.000.0 Now-now- Ababab-Ababab-2000.000.000.0 $ sed -e '/ s [^ 0-9] * / /' data host_1 92.168.0.100 1982.18.100 al-abbabab-ababab-2000.000.000.0 000.000.000.0 $ < / Code>  

A good part is writing good writing of good regular expression in writing. If you really want to do regular expression (Understand regular expressions such words).


The three major items make life very complex, with numbers and letters, and the following content:

  $ cat data host_192.168.0. 100 host_192.168.0.100 ab-ab-abababab-abababab-000.000.000 ab abbabab-abbabab -000.000.000.0 01-admin-10.10.10.10 01-admin-10.10.10.10 10.10.10.10-NAT 10.10.10.10- NAT 1test-10.10.10.10 1 Test-10.10.10.10 $ sed -e's / [^ 0- 9] * / / '\ & gt; -e s / [^.] * - \ ([0-9] [0-9.] * [0- 9] \) / \ 1 / '\ & gt; -Es / \ ([0-9] [0-9.] * [0-9] \) [^ 0-9.]. * $ / 1 / 'Data Host_1 92.168.0.100 192.168.0.100 Ab-ab-abababab-abababab-000.000.000.0 000.000.000.0 01-admin-10.10.10.10 10.10.10.10 10.10.10.10-NAT 10.10.10.10 1test-10.10. 10.10 10.10.10.10 $   

sed The script receives 3 free clean expression before, as before, removes any non-digit immediately after the space is. It does not require tweaking.

01-admin - line though untouched by that; The second regular expression follows a blank, sequence of non-dots followed by a dash, and then occupy the starting sequence with one digit, continuing with the interleaved points and dots, and ending with a digit, with changing it Matching string dash, remembering points and points is important for that task; If you are not careful, then * is too greedy (for example, s /. * \ ([0-9] [0-9.] * [0-9] ) / \ 1 / key digit has been closed from the IP-address component). I'm assuming that sed does not have a non-greedy quantifier such as *? ; If your version does, you can come up with a different answer (but this version will also work) you may need to zoom that pattern to handle other extraordinary matters; Please do this for yourself, do not edit this question.

The third regular expression deals with the following -NET and other such content; It remembers the sequence of digits and points (beginning and ending with the digits) and after that, remembering the digits and the points, instead of the string of memories, after a non-digit, non-dot character and any other trailing material is. It does not require much more tweaking.

Sample Grails 2.14 app not working in Tomcat -


  Grails 2.1.4 टॉमकेट 7.0.37 जावा 1.7 विंडो 7   

मैं ग्रहण में नमूना Grails ऐप बनाया है, मैं रन एप्लिकेशन के साथ चलाने के लिए यह ठीक काम कर रहा है और ब्रशर में भी खोल सकता है।

लेकिन एक ही आवेदन के लिए, मैं grails के साथ .war फ़ाइल का निर्माण: maven-install और मैं तैनात करने के लिए कोशिश कर रहा हूँ, लेकिन मैं त्रुटि नीचे हो रही है:

मार्च 26, 2013 11:56:26 org.apache.catalina.core.StandardContext startInternal गंभीर: प्रसंग [/HelloGrails-0.1] पिछले त्रुटियों की वजह से स्टार्टअप विफल रहा है मार्च 26, 2013 11:56:26 PM org.apache.catalina.loader.WebappClassLoader चेकथाफल लोकलफार्म लेकसेवर: वेब एप्लिकेशन [/HelloGrails-0.1] ने प्रकार की कुंजी के साथ एक थ्रेडलोकल बनाया [org.codehaus.groovy .runtime.GroovyCategorySupport.MyThreadLocal] (मूल्य [org.codehaus.groovy.runtime.GroovyCategorySupport$MyThreadLocal@644aa32b]) और के प्रकार [java.lang.ref.SoftReference] (मूल्य एक मूल्य [java.lang.ref.SoftReference @ 601e8f7d]) लेकिन वेब अनुप्रयोग को रोक दिया गया था जब इसे हटाने में विफल रहा। संभवतया मेमोरी रिसाव की कोशिश करने और उससे बचने के लिए समय के साथ थ्रेड्स का नवीनीकरण किया जा रहा है मार्च 26, 2013 11:56:26 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: वेब अनुप्रयोग [/HelloGrails-0.1] प्रकार की कुंजी के साथ एक थ्रेडलोकल बनाया [org.codehaus.groovy.reflection.ClassInfo.ThreadLocalMapHandler ] (मूल्य [org.codehaus.groovy.reflection.ClassInfo$ThreadLocalMapHandler@639ca35]) और के प्रकार [java.lang.ref.SoftReference] (मूल्य [java.lang.ref.SoftReference@3c0a60c4]) एक मूल्य लेकिन करने में विफल रहा इसे हटा दें जब वेब अनुप्रयोग रोक दिया गया था।

कृपया मेरी मदद करें ..............

धन्यवाद, रवि

वेब-इनफ / क्लासेस में लॉगिंग। प्रॉपर्टीज़ बनाओ निम्नलिखित सामग्री के साथ:

 <कोड> org.apache.catalina.core.ContainerBase। [कैटालिना] .level = जानकारी org.apache.catalina.core.ContainerBase। [कैटालिना] .handlers = java.util.logging.ConsoleHandler   

अपाचे को फिर से शुरू करें और स्टैकट्र्रेस को देखें

oauth - What sort of information is accessible from a user's Google account using OAuth2.0? -


If you receive a user to log in to your website using Google's authorization, What information can you get about? In particular, can you get their advertising preferences that Google collects?

I do not know of any Google APIs A user's ads preferences are shown. You can see your ads preferences with the manager, but the authorized person does not have an API to allow anyone else to see the preferences.

sublimetext2 - SublimeREPL to python -


How can I find a python for Python in Sublime Text 2? My use (Python 3.3 on Windows 7):

"default_extend_env": {"PYTHONPATH": "C: // Python 33"},

This

error message:

Error Message: P>

Error

I do not know that you still need it, but according to someone else may be

You have settings - & gt; Package Settings - & gt; SublimeREPL - & gt; Settings - Users

and add this option:

  {"default_extend_env": {"PATH": "{PATH}; C: \\ Python 27 "}}    

xml - How to use XPath to find the closest ancestor in a ancestor-or-self nodelist -


I have a structure with such recursive elements:

  & lt; A & gt; & Lt; P & gt; & Lt; A & gt; & Lt; / A & gt; & Lt; / P & gt; & Lt; A & gt; & Lt; P & gt; & Lt; A & gt; & Lt; C att = "val" /> & Lt; / A & gt; & Lt; / P & gt; & Lt; / A & gt; & Lt; / A & gt;   

If you are in the form of a C-node, there is $ currentNode, when I use Express

     

I get an anonymous list of nodes that match the expression What I need to always get the node to be closest to the tree, in the branches the deepest or highest level.

Unfortunately, I could not use XPath 2 max function:

     

Note that the closest node is not always above the reference, just above the top ...

Any suggestions appreciated!

I think you ordered the nodes Get to the former from the parent. Try the $ currentNode / ancestor-or-self :: a [1] to get the parent of c att = "val".

flash - What's the reason for interface to exist in Actionscript-3 and other languages -


What does this interface mean? Even if we apply an interface to a class, we have to re-declare its functionality every time we implement it in a different class, so what is the interface of the interface or interface in another language thanks < /p>

I agree with the answers originally posted so far, just a little bit to add.

To answer the easiest answer, yes, there are interfaces in other languages. Java comes to mind immediately, but I'm pretty sure that to create an interface in all OOP languages ​​(C ++, C # etc) There are some mechanisms involved.

As Jake has said, you can write the interface in the form of "contracts". What will be accomplished to separate the work. To say a fiction that I am working on A and You are working on C, and working on Bob B. If we define B as the interface for B, then we can define B quickly and relatively easily. B, Implementation), and all go on our way. I can assume that A to B can be a code, you can get it from C. You can code B, and when done with Bob B, we can simply plug it.

This Jugg1es point. The ability to swap the entire functional piece has been made easier by "dependency injection" (if you do not know this phrase, please Google). That's right, you create an interface that usually defines what will happen, say a database connector. For all database connectors, you want to be able to connect it to the database, and run the query, so that you can define an interface that says that the class "connect ()" method and a "duke (stringing) ) "Should be. Now, Bob explains that the MySQL writes the implementation for the database, now your customer says that we only pay 200,000 for new servers and they will run Microsoft SQL so that you can take advantage of it with your software Databases connector is needed.

In real life, I have a friend who runs meat packing / distribution company in Chicago. The companies that have created their software / hardware setup for scanning packages, and telling things for weight and exchange, that they have to upgrade to new OS / server and new hardware to keep them with software. Modularly not written, allowing them to maintain the rear compatibility. I have been in this boat long ago, telling someone that XYZ needs to upgrade to get ABC functionality which will make my job easier by 90%, in any way, in the real world, guess People do not always use these things and it can cut you in the ass.

jquery - Why doesn't this work - jsonp and REST Easy? -


जेएस कोड

  & lt; html & gt; & Lt; शीर्ष & gt; & Lt; script src = "http://code.jquery.com/jquery-1.9.1.min.js" & gt; & lt; / स्क्रिप्ट & gt; & LT; स्क्रिप्ट & gt; $ .getJSON ("http: // localhost: 8080 / gbsshop / rest / auth / test / xyz? कॉलबैक =?", फ़ंक्शन (डेटा) {चेतावनी ("52");}); & Lt; / स्क्रिप्ट & gt; & Lt; / head & gt; & Lt; / html & gt;   

आराम से आसान तरीका

  @GET @ POST @ पथ ("/ test / {param}") @ उत्पाद ({MediaType.APPLICATION_JSON}) सार्वजनिक स्ट्रिंग रिटर्न मेसेज (@PathParam ("परम") स्ट्रिंग msg) {System.out.println ("~~~~~~~~~~~~~" + msg + "~~~~~~~~~~~~ "); वापसी "हिल्लो" + msg; }   

मुझे लगता है कि सर्वर को कॉल मिलता है लेकिन ब्राउज़र "अनचाहे सिंटेक्स त्रुटि: अप्रत्याशित पहचानकर्ता" के साथ विफल रहता है

किसी भी मदद की सराहना की जाती है। समय के लिए धन्यवाद।

3.x संस्करण में बॉक्स से बाहर आना आराम करें: < Blockquote>

यदि आप जैक्सन का उपयोग कर रहे हैं, तो Resteasy में JSONP है कि आप प्रदाता के org.jboss.resteasy.plugins.providers.jackson.JacksonJsonpInterceptor (Jackson2JsonpInterceptor जोड़कर अगर आप जैक्सन 2 प्रदाता का उपयोग कर रहे हैं) को जोड़कर चालू कर सकते हैं की तैनाती। अगर प्रतिक्रिया का मीडिया प्रकार है json और कॉलबैक क्वेरी पैरामीटर दिया गया है, तो प्रतिक्रिया कॉलबैक पैरामीटर द्वारा परिभाषित विधि की विधि कॉल के साथ एक जावास्क्रिप्ट स्निपेट होगी। उदाहरण के लिए:

GET / resources / stuff? Callback = processStuffResponse इस प्रतिक्रिया का उत्पादन करेगा:

processStuffResponse () यह jQuery के डिफ़ॉल्ट व्यवहार का समर्थन करता है।

आप कॉलबैक पैरामीटर गुण को सेट करके कॉलबैक पैरामीटर का नाम बदल सकता है।

हालांकि ऐसा लगता है कि यह

इसलिए foo ({"foo ":" बार "} foo ({" foo ":" bar "}) के बजाय गाया गया है और इसका कारण" अनचाहे सिंटेक्स त्रुटि: अनपेक्षित पहचानकर्ता " त्रुटि

मैंने एक ठीक से एक submimtted है और उम्मीद है कि यह अगले रिलीज में मिलना चाहिए 3.0.12

मुझे पता है कि इस qustion बहुत पुराना है, लेकिन यह पहले पृष्ठ पर दिखाया गया है जब आप resteasy jsonp समस्याओं की खोज करते हैं, तो मैंने इसे अपडेट करने का निर्णय लिया