Saturday, 15 March 2014

javascript - How could I place text inside a document at the script tag? -


I'm thinking that writing in a document with Javascript is possible, instead of using any script tag in the section got document.getElementById ("id") or something like that. Example: I have a form where, when you enter value in the input and press enter, then he writes a text to the document which uses the previously entered values.

Now, I know that it will be easy to move forward and send it to a function with a show on the head, but the way it is set up makes it easy I can write it down the route. So, if anyone knows how to achieve this, please tell me, thank you.

  
B = & lt; Input name = "b" /> & Lt; / Form & gt; & Lt; Hour & gt; & Lt; Script & gt; Function shows (A, B) {[math] a + b = c [math]} & lt; / Script & gt; & Lt; / Div & gt;

You can see what I've done about it so far. If someone can tell me how to write in script using script tags as context, then [script] [math] a + b = c [math] as context.

Attempted explanation result: [math] a + b = c [math] represents the text that I want to put in the document, Because now I do not really have anything to write about, this is the reason that its just sitting there. I want to place it in the document instead of the script tag, people around the function reveal (). How can I put that text in place of the surrounding script tags?

I believe what you are trying to do: script tag To get the function appears () , then enter the string before or after the code .

If this is the case, then try it: (jQuery is used for simplicity)

  var tag = $ ("script"). Filter (function () () () () reverse / rewail (\) /. Test (this.innerText); // Find that script tag which is}}; // function "reveal ()" tag. Mathematics] A + B = C [Mathematical] "); // Your Text - or - $ (" & lt; span> [math] a + b = c [math]   


PS:

If you already have a script tag, then why do not you do it:

  & lt; script & gt; function appears () {Blah ( );} Document.write ("[math] a + b = c [math]"); // tex T will be inserted where // script tag & lt; / script & gt; is located.    

mysql - Error in creating a database table using php -


I want to create a table in the database using php (mysql_querry)

In the table 'n properties Out of the numbers' N, N-2 attribute names are available in the array.

I can not explain where I am getting the array but it looks like this -

Here is the code to execute the string in mysql_querry.

  $ str = "Subscriber table $ register_name (id not not outgrowth, date, date"; $ j = 0; while ($ j   

When I echo $ str, I get this:

  create table $ register_name (id not note auotoncrment, date date, 913310128 Int (100), 0913310129 int (100), primary key (id))   

However, it is giving this kind of error

your SQL There is an error in the sentence - configuration;

I do not understand the problem when I do not use the roll_no array, so it works fine .. Please tell me what is the problem in it.

"Identifiers can begin with a digit, but unless quoted, only digits Can not be with. "

So, you can get a quote of just the name:

  $ str = $ str "`. $ Roll_no [$ j]. "` Int (100), ';   

Or, it prefixes one letter:

  $ str = $ str "C". $ Roll_no [$ j] "Int (100),";    

java - Set limit integers to JTextField -


How to set a limit on how to input the user, I mean that users can only have 2 or 4 integers and do not input such as More

code:

  JLabel dated = new JLabel ("| Date:"); DateD.setBounds (170,270, 120, 25); DateDD = new JTextField (); DateDD.setBounds (235,270, 20, 25); Using  

text

The rule is made as follows: -
  Document filter in class maximum sectors (Private Prime Max Lamp; Public Maximum Sector) (number of maximumLength = 10; // approved characters) @Override Public Zero insertString ( FilterBypass FB, offset int, string string, AttributeSet attr throws BadLocationException {if (maxLength & gt; 0 & amp; amp; amp; amp; Fb.getDocument () getLength () + String .length () & lt; = maxLength) {super.insertString (FB, offset, string, attr);}} @ Override instead of public spaces (filtered FB, int offset, int length, string text, attributate etter) Badlocation throws the expression (if (Fbgate document). GetLength () + text length () - length) & lt; = maximum length) super.replace (FB, offset, length, text, ethers);}}   

Then you DocumentFilter your JTextField component below Can doors set: -

  ((AbstractDocument) dateDD.getDocument ()) setDocumentFilter (New MaximumCharacters ()).    

regex - How to strip out empty/single-character parentheses in a Java string -


I want to leave a single character inside a bracket, for example, in the string "I part (A) and No (AAA) ", the desired result is" I am running and no (AAA) ", where the other brackets are kept because it is too long, how can I do this in Java? I have tried the following but it does not match anything!

  string text = "5 USC meaning 552 (a) (6) (b) and section 1.16 (b)."; Text.replaceAll ("\\ (.? \\)", ""); // "5 USC 552 and Section 1.16" should be returned. "But no!   

I think the problem is how I am saved from backslash and bracket character, but I have tried several changes like" \\ (.? \ \) "There is no benefit, besides, they start working online on regular expression sites, so I'm completely lost. Text ">

Your regex looks OK - have you forgotten to allot the result in one variable?

  text = text.replaceAll ("\\ (.? \\) \"), "");    

with SIP, when to use TCP not UDP? -


I know that UDP and TCP in general (e.g..)

"post-text" itemprop = "text">

Many people usually attach the UPP to VoIP and possibly leave it on it, but in simple terms VoIP Connection and voice data are two parts of the transfer.

SIP is a very light weight protocol, once the connection is established, it is effectively disabled, as long as it does not even happen to a unique event of calling a person. TCP (contrary to the UDP) will actually reduce the traffic on the server by destroying the need; Can (as recommended) UDP for RTP

I could not help but can point out those obvious things that I have seen. for example. The number of devices connecting to the server, as the number grows, the equation bends in the UDP but then you have to consider SIP user agents covering many codec, multimedia, video and screen-sharing. INVITE packets can start large and potentially run on UDP single datagram size, which in turn tilt the equation in favor of TCP.

All that is being said, I hope you have enough information to answer the question.

Hope it helps.

Credit: Great discussion on On SIP:

java - Comma separators in a string of digits -


एक स्ट्रिंग डेटा :

  {4, 15,26,7}   

कोमा सेपरेटर का उपयोग अंकों को अलग करने के लिए किया जाता है।

  this.points = new ArrayList & lt; Integer & gt; (); के लिए (int i = 0; i & lt; data.length (); i ++) {this.points.add (Character.getNumericValue (डेटा.charAt (i))); }   

कॉमा सेपरेटर को छोड़ने और केवल this.points ? >

इसे आज़माएं,

  स्ट्रिंग डेटा = "{4,15,26,7}"; डेटा = data.substring (1, data.length -1); स्ट्रिंग [] अंक = डेटा.split (","); उसकी पॉइंट = नए अर्रे लिस्ट & lt; पूर्णांक & gt; (); के लिए (int i = 0; i & lt; digits.length; i ++) {this.points.add (पूर्णांक। पैरासेन्ट (अंक [i])); }    

Running several scripts in parallel bash script -


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

  • 10 उत्तर

    मेरे पास एक बाश स्क्रिप्ट है उसमें अन्य स्क्रिप्ट शामिल हैं जो श्रृंखला में चलते हैं हालांकि, यह उन सभी को चलाने के लिए समय की एक सभ्य मात्रा लेता है। क्या इन स्क्रिप्ट को समान रूप से चलाने के लिए एक समग्र तरीके से सुधार करने का एक तरीका है? वे एक-दूसरे से स्वतंत्र हैं।

    ऐसा लगता है:

      #! / Bin / bash #some कोड यहाँ cppcheck.sh churn.sh run.sh   

    अपडेट:

      ** git लॉग --pretty = format: --numstat | $ F [2]; END {प्रिंट "$ _ \ t $ c {$ _}" अगर $ F [2]; E = {$ F [2]} + = abs ($ F [0] + $ F [1]) perl- \ N "सॉर्ट कीज़ के लिए% c} '& gt; $ {OUTPUT_DIR} / चार्न.txt** sed -i -e '/ deps / d; / build / d; / translations / d; / test / d' -e 30q $ {OUTPUT_DIR} / चाचर.txt sort -r -n -t $ '\ t' -k2 $ {OUTPUT_DIR} / चार्न.txt -o $ {OUTPUT_DIR} / चार्न.txt "सेट कैनवास का आकार 1200, 800; आउटपुट सेट करें '$ {OUTPUT_DIR} /output.html 'सेट ऑफ बिर्मिन' स्क्रीन पर सेट करें; सेट xtics -90 पैमाने 0,0 में घुमाएगी; सेट यॅबेल 'लाइनों की संख्या (कुल) बदल दी गई'; सेट शीर्षक 'उच्च मंथन स्तर के साथ फ़ाइलें'; सेट बॉक्सविड्थ 0.7; सेट शैली भरे हुए को भरें; सेट करें ग्रील्ड ऑर्डर करें; प्लॉट '$ {OUTPUT_DIR} / बारी' का उपयोग कर 2: xticlabels (1) के साथ बॉक्स "| ग्नुप्लॉट प्रतिध्वनि "समाप्त हो चुका churn.sh!"   

    यह churn.sh के अंदर कोड है बोल्ड कमांड को कार्यान्वित करने के लिए 40 या उससे अधिक सेकंड लेता है। अगर एक मुख्य स्क्रिप्ट में मैं churn.sh & amp; के बाद ampersand डाल दिया है, तो यह कहकर एक त्रुटि फेंकता है कि srd.txt फ़ाइल नहीं पढ़ा जा सकता है (चूंकि यह अभी तक नहीं बनाया गया है) ऐसा लगता है कि यह एक फ़ाइल में आउटपुट सहेजे जाने तक इंतजार नहीं करता है। मैंने उस आदेश के बाद इंतजार की थी, लेकिन यह मदद नहीं करता है।

    और < / कोड> इसे पृष्ठभूमि में चलाने के लिए चाल करेंगे

      cppcheck.sh & amp; चर्न.श & amp; Run.sh & amp; amp; इंतजार करें "सभी 3 पूर्ण" गूंज करें   

    यह उनमें से प्रत्येक के लिए एक नई प्रक्रिया काढ़ा करेगा।

    टिप्पणी में कहा गया है कि बाश भी उपयोगी होगा, यदि आपके पास माता-पिता की लिपि पर चलने के लिए कुछ है, तो उसके बाद ये तीन समाप्त।

    कोई तर्क के बिना यह सभी चाइल्ड प्रोसेस को पूरा करने के लिए इंतजार करेगा, और फिर अभिभावक स्क्रिप्ट।


    आप जिन समस्याओं का सामना कर रहे हैं वे सीधे इस से संबंधित हैं। चर सेट केवल इनके लिए दृश्यमान हैं। इसलिए, अगर आपके पास माता-पिता की लिपि में निर्दिष्ट OUT_DIR है, तो यह बच्चे की स्क्रिप्ट के लिए दृश्यमान नहीं होगा, जब यह बंद हो जाए इस मामले में करने के लिए सही कार्य होगा निर्यात चर एक पर्यावरण चर के रूप में।