Tuesday, 15 September 2015

In C, char array and string array in c shows different size, but when compared they are same -


In the attempt of four arrays in C, I came up with this problem.

  void main () {four buffers [5] = {'s', 'd', 'f', 'd', 'f'}; Four [5] = "SDFDF"; Printf ("% d \ n", * A == * buffer); Printf ("% s \ n", buffer); Printf ("% d \ n", (int) string (buffer)); Printf ("% d \ n", (int) string (a)); }  

is output

  1 sdfdf sdfdf 5 6  

The main problem is that '\ 0' , correctly defines 5 character string and To get started with the initial list, it should be

  four buffer [6] = {'s', 'd', 'f', such as  char  From an array, 'D', 'F', '\ 0'};   

The second version in your code is incorrect because the array can only store 5 characters, again

  char a [6] = "SDFDF"; Instead of 5 * /  

/ * ^ 6 you can not expect any work after that part of the code to work, when you have lost '\ 0 '.

printf () with "% s" spcifier and strlen () expect previous special value '\ 0' or 0 if you want, to stay there, when it is not, then these functions apply undefined behavior because they go beyond the end of the array There are '\ 0' . Searching for


html - PHP <ul> <li> database -


I get a & lt; I am tring to put a picture, title and rating of each film within the array in ul & gt; & Lt; Li & gt; But I can only put it in the first film, title and rating.

  & lt ;! DOCTYPE html public "- // W3C // DTD XHTML 1.0 strict // n" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> & Lt ;? Php require_once 'init.php'; Need_once 'sessionCheck2.php'; $ Query = $ con - & gt; Leave Query ("SELECT movies.id, movies.image, movies.movie_name, AVG (user_movie_ratings.rating) as ratings from movies, User_movie_artings movies in doubles. User_movie_writing.movi_id group.im movies"); $ MovieTitle = Array (); While ($ line = $ query-> fetch_object ()) {$ movieTitle [] = $ line; }? & Gt; & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Title & gt; Home and lt; / Title & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = ISO-8859-1" /> & Lt; Link rel = "stylesheet" type = "text / css" href = "styles.css" /> & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "wrapper" & gt; & Lt; Div id = "header" & gt; & Lt; Div id = "h1" & gt; & Lt; / Div & gt; & Lt; Div id = "login" & gt; & Lt ;? Include Php // 'loginCheck.php' ;? & Gt; & Lt ;? Php included 'login.php' ;? & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div id = "movies" & gt; & Lt ;? Php foreach ($ movieTitle $ as Movie):? & Gt; & Lt ;? Php echo "
  • . '& Lt; Img src = "'. $ Movie-> Image." "/ & Gt; ';? & Gt; & lt; div class =" CFF "& gt; & gt; Php echo $ movie- & gt; movie_name;? & Gt; & lt; / div & gt; Lt; div class = "s11 c999" & gt; Rating: & lt ;? php echo round ($ movie- & gt; rating);? & Gt; & lt; / div> & lt ;? php echo & Lt; / Li & gt; & Lt; / Ul & gt; "?; & Gt; & lt; / div & gt; & lt ;? php endforeach;? & Gt; div id =" footer "& gt; This footer is & lt; / Div & gt; & gt; / div> & lt; / body & gt; & lt; / html & gt;

node.js - request.post continues to override content-type as content-type: application/x-www-form-urlencoded when form-data is being specified -


We have a client API call for which it must be sent as a post form-data. When we run calls via Chrome's Postman Extension, we specify form-data, and if we specify the x-www-form-urlxod, then it is executed successfully by returning an error. This is expected.

However, when we try to run the "request" NPM package to handle the post, we will continue to get an error message from the API, which is unfortunate to us. Do not direct us from what is wrong. But we see that when requested that the requested title item looks like this:

_header: 'POST / API / client / coupon / add HTTP / 1.1 \ r \ n authorization : Original [auth string redacted] \ r \ nhost: beta1.client.com \ r \ ncontent-type: application / x-www-form-urlencoded \ r \ n Content-Length: 172 \ r \ n Connection: Alive \ r \ n \ r \ n ',

our node. Js code looks like this:

  // create coupon code coupon = {code: "abcde1234"), discount: "33", type: "percent"} var request = requirement ('request '); Request.post ({url: "https://beta1.client.com/api/coupon/add", header: {"authorization": auth, "content-disposition": "form-data; name = 'data' "}, Form: coupon}, function (error, feedback, body) {if (! Error and response.statusCode == 200) {console.log (body)}});  

Am I wondering why content-type header continues to read "application / x-www-form-url encode" when we have the content of 'form-data' The arrangement is provided. I feel that if I can remove the content type header, then it should work - but how to do it?

Any insights will be appreciated.

content-type header application / x-www- Form-urlencoded because you are using form in your post request.

  request.post ({url: "https://beta1.client.com/api/ coupon / add", header: {"authorization": auth, "content-disposition": "Form-data; name = 'data'"}, form: coupon}, function (error, response, body) {...});  

To control it, you must add content as body as given below.

  request.post ({Url: "https://beta1.client.com/api/coupon/add", header: {"authorization": auth, "content-disposition": "Form-data; name = 'data'"}, body: coupon}, function (error, reaction, body) {...});  

eclipse - Hibernate error while compiling -


I am attempting to include Hibernate v4 in my dynamic web project in Eclipse I am using Maven for Dependency I have written all the code and have created unit sections and mapping XML files but on the building project I get this error

  This project was not created because its build path is incomplete Javax Class F for .name Il eluded. Fix the build path, try creating this project. MyProject  

I wrote the hibernate youth class as:

  import org.hibernate. SessionFactory; Import org.hibernate.boot.registry.StandardServiceRegistryBuilder; Import org.hibernate.cfg.configuration; Import org.hibernate.service.ServiceRegistry; Public Class Hibernate Youths {Private Status Session Session. Factory = buildSessionFactory (); Private Static Session Facial Fabrication (FACT) {try (sessionFactory == empty) {configuration configuration = new configuration (). Configure (Hibernate Utility Class.getResource ("/ hibernate.cfg.xml")); StandardServiceRegistryBuilder Service RegistryBuilder = New StandardServiceRegistryBuilder (); ServiceRegistryBuilder.applySettings (Configuration .getProperties ()); ServiceRegistration ServiceResearch = ServiceRajistBiller Builder (); SessionFactory = Configuration .buildSessionFactory (serviceRegistry); } Return session; } Catch (Throttle Pre) {System.err.println ("Initial Session. Factoring Failure." + East); New ExceptionInInitializerError (ex) Throw; }} Public stable session - Factory getSessionFactory () {Return Session Factory; } Public static void close () {getSessionFactory () Close (); }}  

EDIT: I get this error on the GetSessionFactory method call in the shutdown method. Anyone know what the problem might be?

It is not available on the class build path as it says, you have to fix the build path. Do this by giving a package that is javax.naming.Referenceable.

What makes me feel strange is to rewrite the hibernate unit? There is probably nothing that you want to do here. And I'm not getting any explanation why you write your own.

I recommend forgetting the hibernate uplit class and starting the hibernate framework completely.


hadoop - How to use Yarn to allocate more resources to a job -


I have some different functions to run on a Hadoop cluster. I need some resources and something else, eg . remember. I would like to run these tasks together on my cluster because it supports yarns. I think if I only collect jobs in the cluster, then the yarn automatically decides the processing requirements, although I myself I want to specify how can I use the API or command line to specify every work resource requirements?

You can set up memory by using JobConf for mapper and reducer, from the command line or Can do in your driver's class.

Set these properties to a specific setMemoryForMapTask and there are more information and usage details in SetMemoryForredSetsk (Long MEM)

.


Update error rails (stack level too deep) -


मुझे एक विशेषता स्वीकृत अद्यतन करते समय रेल में एक त्रुटि का सामना करना पड़ रहा है। स्वीकृत एक बूलियन प्रकार coloumn है।

यह कोड है:

  def प्रतिक्रिया अगर params [: प्रतिक्रिया ] @ इंवेट = आमंत्रित करें: आमंत्रित करें (आमंत्रित: '2') @ आमंत्रित.अपडेट (स्वीकार किए जाते हैं: परम [: प्रतिक्रिया]) रेंडर नहीं है: सच अंत समाप्ति  

ट्रेस (छवि के लिए खेद है) ):

यहां छवि विवरण दर्ज करें त्रुटि स्टैक स्तर बहुत गहरा है

मुझे लगता है कि जब आप update कार्रवाई कर रहे हैं और पासिंग कर रहे हैं पराम [: प्रतिक्रिया] , किसी भी तरह से यह प्रतिक्रिया क्रिया को शुरू कर रहा है और एक अनंत लूप में गिरता है, जो 'स्टैक लेवल बहुत गहरी' त्रुटि को बढ़ा रहा है

समस्या को ठीक करने के लिए प्रतिक्रिया को बदलें update_response या कुछ और।

  def update_response यदि पैरामीटर [: प्रतिक्रिया ] @ इंवेट = आमंत्रित करें: आमंत्रित करें (आमंत्रित: '2') @ आमंत्रित.अपडेट (स्वीकार किए जाते हैं: परम [: प्रतिक्रिया]) कुछ रेंडर नहीं करती: सच अंत समाप्ति  

जैसे ही मुझे कोई स्पष्टीकरण मिलता है, इस उत्तर को अपडेट करें।


opengl - glGetUniformLocation using a lot of CPU -


Is it normal when I call glGetUniformLocation in my render loop only once , Then the CPU usage process goes up to 30-40%? Should I call this method only once and store space in memory?

This is my code:

  glutton shader :: getUniform (const std :: string and name) Const {return glGetUniformLocation (m_programId, name.c_str ()); }  

Should I call this method only once and store Should store location in?

Yes, this will be the usual procedure either, or experiment.


linux - Ansible playbook with pbrun not working -


प्रथम- playbook.yml:

  --- - होस्ट: सभी कार्य: - नाम: test shell: chdir = / home / tibco pbrun su - tibco sh test.sh sudo: yes  

त्रुटि:

  [root @ c0043724 उत्तरदायी ] # नोटिबल-प्लेबुक-वीवीवी प्रथम-प्लेबुक.इम -यू बालप --कक-पास -सी पैरामीटर एसएसएच पासवर्ड: प्ले [सब] ****************** *************************************************************************************** तथ्य ************************************************** ************ & lt; c0043725.itcs.hp.com & gt; उपयोगकर्ता के लिए प्रतिष्ठान कनेक्शन: पोर्ट 22 से सीए 20043725.itcs.hp.com पर & lt; c0043725.itcs.hp.com & gt; REMOTE_MODULE सेटअप & lt; c0043725.itcs.hp.com & gt; EXEC / bin / sh -c 'mkdir -p $ HOME / .able / tmp / ansible-tmp-1426531409.47-88648204897709 & amp; amp; Chmod a + rx $ HOME / .able / tmp / ansible-tmp-1426531409.47-88648204897709 & amp; amp; गूंज $ HOME / .ansible / tmp / ansible-tmp-1426531409.47-88648204897709 '& lt; c0043725.itcs.hp.com & gt; PUT / tmp / tmpNP2qY2 /home/balp/.ansible/tmp/ansible-tmp-1426531409.47-88648204897709/setup करने के & lt; c0043725.itcs.hp.com & gt; EXEC / bin / श -c 'LANG = en_US.UTF-8 LC_CTYPE = en_US.UTF-8 / usr / bin / अजगर /home/balp/.ansible/tmp/ansible-tmp-1426531409.47-88648204897709/setup; rm- आरएफ /home/balp/.ansible/tmp/ansible-tmp-1426531409.47-88648204897709/ & gt; / dev / बातिल 2 & gt; & amp; 1 'ठीक: [c0043725.itcs.hp.com] टास्क: [परीक्षण] * ************************************************** ************** & lt; c0043725.itcs.hp.com & gt; उपयोगकर्ता के लिए प्रतिष्ठान कनेक्शन: पोर्ट 22 से सीए 20043725.itcs.hp.com पर & lt; c0043725.itcs.hp.com & gt; REMOTE_MODULE आदेश chdir = / घर / TIBCO pbrun सु - TIBCO श test.sh #USE_SHELL & LT; c0043725.itcs.hp.com & gt; EXEC / bin / श -c 'mkdir -p $ HOME / .ansible / tmp / ansible-tmp-1426531412.61-87821666758998 & amp; & amp; Chmod a + rx $ HOME / .able / tmp / ansible-tmp-1426531412.61-87821666758998 और amp; amp; गूंज $ HOME / .ansible / tmp / ansible-tmp-1426531412.61-87821666758998 '& lt; c0043725.itcs.hp.com & gt; PUT / tmp / tmpNgfy06 /home/balp/.ansible/tmp/ansible-tmp-1426531412.61-87821666758998/command करने के & lt; c0043725.itcs.hp.com & gt; एक्सईसी / बिन / श-सी 'सुडो-के एंड एंड amp; Sudo -H -S -p "[sudo, ansible, key = torjbeltprhcmjkqbwcakmroqrxvfiai] पासवर्ड:" -u रूट / बिन / श-सी "इको उत्तराधिकारी- torjbeltprhcmjkqbwcakmroqvfiai; LANG = en_US.UTF-8 LC_CTYPE = en_US.UTF- 8 / usr / bin / अजगर /home/balp/.ansible/tmp/ansible-tmp-1426531412.61-87821666758998/command; rm- आरएफ /home/balp/.ansible/tmp/ansible-tmp-1426531412.61-87821666758998/ & gt; / Dev / null 2 ​​& gt; और 1 "'असफल: [c0043725.itcs.hp.com] = & gt; {"बदल गया": सच है, "सीएमडी": "पीबुन सु - टीबको श test.sh", "डेल्टा": "0: 00: 00.024 944", "एंड": "2015-03-16 18: 43: 33.371752" , "आरसी": 127, "प्रारंभ": "2015-03-16 18: 43: 33.346808", "चेतावनी": []} स्टेडरर: / बिन / श: pbrun: कमांड नहीं मिला पागल: सभी होस्ट पहले से विफल हो चुके हैं - PLAY RECAP को रद्द करना ******************************************************************************************* *********************** पुन: प्रयास करना, उपयोग: --limit @ / जड़ / प्रथम playbook.retry c0043725.itcs.hp.com: ठीक है = 1 बदल = 0 तक नहीं पहुंचा जा = 0 में विफल रहा है = 1  

आप कृपया ठीक करने के लिए मदद कर सकते हैं?

बेहतर डिबगिंग के लिए अधिक जानकारी की आवश्यकता है लेकिन मेरा अनुमान है कि आप ऐसा करने के तीन अलग-अलग तरीकों को मिश्रण करने की कोशिश कर रहे हैं।

  • कुछ कस्टम उपकरण pbrun कहा जाता है (मुझे लगता है कि यह आपके द्वारा बनाई गई कुछ स्क्रिप्ट / आपके ऑप्स पीपीएल आप सुडो एक्सेस)
  • सु कमांड में आप निष्पादित कर रहे हैं।
  • आप sudo: yes < / Code>।
  • (इस तथ्य का उल्लेख नहीं करने के लिए कि आप प्लेबुक को root के रूप में चला रहे हैं, जो मूल रूप से दूरस्थ मशीन के रूट के रूप में कनेक्ट होगा (जब तक कि आप इसे कहीं ओवरराइड नहीं करते

मैं आपको pbrun और sudo > Test.sh को अपनी प्लेबुक में और तीनों के सु करने के लिए एक ही रास्ता बरकरार रखें।

- संपादित करें -

I मान आप पहले से ही पता है abt sudo_exe

में पैरामीटर
  # विकल्प sudo कार्यान्वयन के लिए परिवर्तन इस sudo_exe = sudo  

spark java - Openshift error 503 with sparkjava -


I am trying to create a simple web page that uses the openshift platform and sparkjava which gives me a steady HTML The file is in the 'src / main / resources / public' folder (I have created the application using the following command, but when I navigate to the location ", the page returns under error

The service is temporarily unavailable, server temporarily maintained Unable to serve your request due to downtime or potential problems. Please try again later.

The command used to make the app:

Class upstart {public static zero main (string [] args) {String IP_ADDRESS = Sys Tem .ETenv ("OPENSHIFT_DIY_IP"); int PORT = Integer.parseInt (System.getenv ("OPENSHIFT_DIY_PORT")); SetIpAddress (IP_ADDRESS); Setport (PORT); Static file location ("/ public"); Receive ("/", new root () {public object handle (request request, response response) {response.redirect ("index.html"); return "";}});}

}

Can anyone help me troubleshoot this problem?

I got an issue resolving in the end. The problem was:

The script was initially not started, stopped and deployed properly.


java - Stopping stacktrace on a JOptionPane -


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

  • 23 उत्तर

मैं एक को रोकने की कोशिश कर रहा हूँ स्टैकट्र्रेस जो मेरी रिक्त जांच को सुन नहीं पा रहा है।

  यदि (राशि दर्ज! = नल) {amntEntered = Double.parseDouble (मात्रा दर्ज); } और अगर (राशि दर्ज की गई! = "") {AmntEntered = Double.parseDouble (मात्रा दर्ज); } और अगर ((राशि का नाम दिया गया == शून्य) राशि एंटर == "")) {System.out.print (""); }  

इस कोड के साथ, यह स्टैकट्र्रेस को रोकना चाहिए जो कि जब मैं कोशिश करता हूं और यॉप्शनपैन से रद्द कर देता हूं (राशि निर्दिष्ट की गई है जिसमें एपॉप्शन फ़ंक्शन को असाइन किया गया है) - एंटेंट है डबल बराबर।

आपका तर्क थोड़ी दूर है, पहले बंद, Java स्ट्रिंग एस की तुलना बराबर (..) :

  से की जाती है, अगर (राशि दर्ज! = शून्य) {amntEntered = Double.parseDouble (एंटर मात्रा); // क्योंकि आप राशि की तुलना कर रहे हैं "" और आप जांचते हैं कि क्या यह रिक्त है / / मुझे लगता है कि यह एक प्रकार की स्ट्रिंग है जिसका अर्थ है कि आप इसे दोहरे में नहीं डाल सकते हैं } और यदि (! राशि दर्ज.एक्सेल्स ("")) {// यदि यह पहले चेक / बीत चुका है तो इसका मतलब है कि एंट्रंट की गई राशि शून्य है और यह एक NullPointerException एंटेंट का निर्माण करेगी = डबल। पीआरडीएडबल (राशि एंटर); } और अगर ((राशि का नाम दिया गया == शून्य) राशि दर्ज किया गया.एक्सियल ("")) {// यहां पर यदि प्रविष्टि रिक्त है, तो दूसरी जांच // अभी भी निष्पादित की जाएगी और एक NullPointerException // जब आप उपयोग करेंगे दोनों से पहले चेक || और बाद || सिस्टम.आउट.प्रिंट ("") को निष्पादित किया जाता है; }  

आप किसी भी अपवाद s:

  के साथ जांच और सौदा कैसे कर सकते हैं, यदि (राशि दर्ज! = नल) & Amp; amp; amp; amp;! राशि दर्ज.आसटाटा ()) {{कुछ DoubleVariable = डबल। पीआरएसएड डबल (मात्रा दर्ज); } पकड़ (NumberFormatException ई) {someDoubleVariable = 0; E.printStackTrace ()}} और यदि (राशि दर्ज की गई == शून्य || (राशि दर्ज की गई है! = नल और amp; amp; राशि दर्ज.आवेदन ())) {someDoubleVariable = 0; }  

इस उदाहरण में, क्योंकि मैं & amp; amp; & amp; amp; का उपयोग कर रहा हूं, जैसे ही उनमें से एक false जिसका मतलब है कि अंतिम <कोड> और अगर यदि राशि दर्ज किया गया है तो शून्य है राशि दर्ज की गई है। ईसैप्टी () निष्पादित नहीं किया जाएगा


java - How to display a contents from an Array List in a string? -


I am starting to use Java and I do not know how the system outputs content from my array list To make a private void () (Room City Center, boot, Tesco, library, home; // city center to make room = new room ("city center") Shoes "= new room (" drug store in boot ", material); Tesco = new room (" Tesco's ", material) Library = new room ("in city library", content); home = new room ("at home", content);

Note where 'content' says Where I am trying to display objects in the room.

This is where I started my array list

  new = milk (new) "); Paracetamol = new object (" paracetamol "); book = new objects (" book "); money = new object (" money "); tesco.addObjects (milk); bo Ots.addObjects (paracetamol); library.addObjects (book); home.addObjects (money);  

The array list itself is in a different class and looks like this

  Public Array List & Lieutenant; Objects & gt; material;  

So what am I trying to do, the system prints the contents of each room. Any help is welcomed and appreciated :)

First you have toString your "Objects" (), Which represent the contents of your room, thus you can give a friendly description for each "objects".

Inside your object class:

  @Override public string toString () {return "Object:" + object name; After this, you can override the toString () method of your room class so that you provide your details of the room, in which case you are in your "materials" arrelist. You want to do all the printing by printing  

You can do the following in your cell orbit:

  @ Override to public string toString (return) "Content in the room" + Content String (); }  

An ArrayList has a toString method that will call the toString () method for each element in the list. In our case, each element is an "objects", which we only override the string () method, so that's what we really wanted.

Now when you call:

  System.out.println (Tesco)  

This output will be:

In-room content: Object: Milk

jquery - How to hide required message instantly when input field is not empty -


An input is filed after clicking on the "submit" button, it is empty, it will show an essential message like "This field is required". After touching the input, and after typing anything, the required message should be terminated when typing anything on the input field, this input field is not empty. But, I can not hide that message instantly when typing. It has been hidden after clicking on the submit button again but, I have to hide immediately when it has been filed and is no longer empty. how to do this? I've used it:

  if ($ ('# field'). Val () == '') {$ ('. Required') Show (); } And {$ ('. Required'). Hide (); }  

update

 

Code> $ ('body'). ('Click', 'button', submit form); . $ ('# Field') KeyUp (isFormValid); Function isFormValid () {if ($ ('$'). Val () == '') {$ ('. Required') Show (); return false; } And {$ ('. Required'). Hide (); Back true; }} Submit form of form () {if (isFormValid ()) {Warning ('form is valid'); } And {warnings ('form is not valid'); }}

UPDATED


You have to do the same and then click on the click that you are making on click.

Something like this

$ ('body'). ('Click', 'button', form check); . $ ('# Field') KeyUp (formCheck); Function form check () {if ($ ('$'). Val () == '') {$ ('. Required') Show (); } And {$ ('. Required'). Hide (); }}

here is a


java - Javac -Xlint:deprecation log -


  आयात करें java.util.Date; सार्वजनिक कक्षा का नमूना {सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग ... आर्ग) {दिनांक दिनांक = नया दिनांक (); Println (date.getMinutes ()); }}  

अगर मैं javac -Xlint: deprecation Sample.java का उपयोग करता हूं, तो मैं निम्नलिखित नापसंद लॉग प्राप्त कर सकता हूं।

  पूर्व: java.util.Date में [deprecation] getMinutes () नापसंद कर दिया गया है।  

यहां, नापसंद विधि, क्लासनाम और पैकेज नाम स्पष्ट रूप से समझाया गया है। जब मैं जावा 7 में एक ही कमांड निष्पादित करता हूं, तो मुझे केवल पदावनत क्लासनाम और विधि का नाम नहीं पैकेज नाम मिल सकता था।

  Ex: [deprecation] getMinutes () तिथि में पदावनत किया गया है।  

क्या कोई ये बता सकता है कि जावा 7 में इन बदलावों की शुरुआत क्यों की गई है? जावा 7 को भी इसी तरह के पदावनत लॉग को जावा 6 के रूप में देने के लिए कोई भी संभव है?


shell - AIX Clear contents of files larger than 100 MB -


I am looking for all the files to be cleared in a directory that has exceeded 100 MB I have an AX box And it is creating logs that are quickly replenishing space. I do not want to delete the file just want to clear the contents.

When the prod file is not open, you can use

  Find your logger type-type F -size + 100M -exec cp / dev / null {} \;  

Edit, view comments:
When M flag is not supported on your system, enter a longer number.


jstl - Custom Tag to use another JSPs in your JSP based on conditions -


I have a requirement where I need to include JSP in some JSP, and the path of JSP that I need to include Depends

I used getJspContext (). Include (), but it corrupts future requests.

That's why I started using getJspBody (). (String Writer Writer). / P>

The problem I am facing will execute GSP content in the custom tag, which is something like this:

  <% @ include file = "addressForm Jsp "% & Gt;  

However, I have to specify the path of JSP in the tag so that I can make different paths depending on different conditions.

I checked but I did not get it

P> This is my favorite way of including JSP:

    

and you can trigger the url parameter ($ {...} has a variable in the stuff).

  & lt; C: import url = "$ {path} / $ {} form .jsp" />  

In this example, $ {path} is a variable that you can set and with $ {form} If you want to play with this type, make sure that you can add it to the top of your JSP page:

  & lt;% @ taglib uri = "http: // Java.sun .com / jsp / jstl / core "prefix =" c "%>  

There are many examples and tutorials about the use of JSTL and "Core" tag libraries here:


ftp - Building embedded system with no reliable internet connection -


I'm not sure how to find it on the Internet, I tried some searches but never got help , So I'll just ask here. (If it has already been answered then sry!)

I am creating an embedded system that runs on windows. I will collect some data and send it to the Internet for reading at home. I am most likely to connect my system (which keeps moving) using 3G connection from the internet and sends data. I plan to use an FTP server with a Hamachi connection to send the files to another PC and it will be automated, so only one person's action will be to read the data at home. I tested and it all works fine when I use a reliable connection, such as when I go home.

My question is, will this work when my 3G connection drops and how can I make this system reliable? If the data is down and I send it back online, then I want to submit the data, but I do not know the system will automatically connect (I can not 'connect' to manually connect 'person' ) Or in Hamachi

Also, is there a better, more reliable or simpler way to send data than Hamachi + FTP?

Thx,

Edit: Adding More Information I am collecting data with LabVi VI to save this data in a file (TSTT, CSV or whatever) , To send the file up and to read the file is another six and some graphs and etc. have been displayed. Labwave has a datasocket for sending some data to the internet, but I am not familiar with these Internet protocols, it says that I can use FTP, HTTP and others. What is paid and what can I do for free?

Also, more reliable or simpler way than sending Hamachi + FTP to data?

E-mail (SMTP) can be easy to use? The advantage of this is that the sender and receiver are not required to be at the same time.


python - Heroku django "OSError: [Errno 2] No such file or directory: '/static/static'" -


I'm new to Django and Heroko. It's an error when I happen to have some of my Git repository. Suggest that I need to change Thank you in advance

(website) C: \ user \ website \ src> Haroko Run Dragon management and collect - Noinput is running Dragon management. Py collectstatic --noinput for attached terminal ... top, run 16 9 0

  trace Track (most recent call last): File "manage.py", line 10, & lt; Module & gt; Execute_from_command_line (sys.argv) file "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__ .py", line 385, in the execute_from_command_line utility. Execute () file "/ app / .heroku / python / lib / python2.7 / site-packages / django / core / management / __init__ .py", line 377, in self.fetch_command (sub command) .run_from_argv (self .argv) file "/ app /.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 288, run_from_argv in self.execute (* args, ** option. __ dict__ file "/ app / .exe output = self.handle (* args, ** option) file" / app / / / Python / lib / python2.7 / site-packages / django / core / management / base.py ", line 338 hello / python / lib / python 2.7 / site-package / django / core / management / bases", line 533 , Handle returns self Handley_Nogs (** Options) file "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, handle_noraj collected = self. Collect () file "/app/.heroku/py Thon / lib / python2.7 / site-packages / django / contrib / staticfiles / management / command / collectstatic.py", line 98, path to find, finder. List in storage (self.ignore_patterns): file "/ app / .heroku /python/lib/python2.7/site-packages/django/contrib/staticfiles/finders.py", for paths in line 111, utils.get_files List (storage, unselected_pattern): file "/ app / .oroku / python / lib / python2.7 / site-packages / django / contrib / staticfiles / utils.py", line 27, get_files In directory, files = store.listdir (location) file "/app/.heroku/python/" for listing in OSILDR (path) in listdir, lib / python2.7 / site-packages / django / core / files / storage. Py ", line 270, OSError: [Error 2] There is no such file or directory: '/ static / static'  

settings.py

  STATIC_URL = '/ static /' # Template Location TEMPLATE_DIRS = (os.path.join (os.path) .dirname (BASE_DIR), "static", "templates"),) DEBUG: MEDIA_URL = '/ media /' STATIC_ROOT = Os.path.join (os.path.dirname (BASE_DIR), "st tick", "static-only") MEDIA_ROOT = os.path.join (os.path.dirname (BASE_DIR), "static", "media ") STATICFILES_DIRS = (Os.path.join (os.path.dirname (BASE_DIR), "static", "static"),)  

Currently, it seems that the error is a directory from STATICFILES_DIRS var point that does not exist:

  STATICFILES_DIRS = (os.path.join (os) .path.dirname (BASE_DIR), "static", "static")  

Visit your DNS project directory, find the static repository and focus on the entire space. After this, edit the STATICFILES_DIRS variable in settings.py shetat it points to this location.

For me (which does not mean that it should be similar to you), it looks like:

  STATICFILES_DIRS = (os.path.join (BASE_DIR, ../myapp/static '),)  

html - How to set a child element border in my case -


I am trying to align my child element range within a td in the same width as the td boundary.

For example

  & lt; Table class = "table" & gt; & Lt; TR & gt; & Lt; Td> ABC & lt; / Td> & Lt; Td> ADC & lt; Div class = "child" & gt; & Lt; / Div & gt; & Lt; / Td> & Lt; TD & gt; Trial & lt; / Td> & Lt; TD & gt; Trial & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Trial & lt; / Td> & Lt; Td> 45g & lt; / Td> & Lt; TD & gt; Block & lt; / Td> & Lt; Td> Trial & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Trial & lt; / TD & gt; & Lt; TD & gt; Trial & lt; / TD & gt; & Lt; TD & gt; Swap & lt; / TD & gt; & Lt; TD & gt; Trial & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;  

CSS - with bootstrap.

  table {border-fall: heirs; Border-spacing: 5px; } .table & gt; Thesaurus & gt; Tr & gt; Td {status: relative; Border: Solid 3px red; Padding: 0; }. Kids {boundary-left: solid 3px green; Border-right: solid 3px green; Width: 100%; Height: 10px; }  

Actually, I want to cover the TD boundary of the child element of the TD boundary, so the green border is at the top of the red border, is it possible?

Rather than setting the width of 100%, the block style display width, then the width Set negative margins:

  .child {border-left: solid 3px green; Border-right: solid 3px green; Height: 10px; Margin: 0 -3px; }  

See it here:


Windows batch string comparison in if statement wrong? -


I try to write a small batch file that will react differently depending on a parameter. Unfortunately the "if" statement whch does not seem to work as expected in the form of 2 strings:

  @echo will close if "% 1" == "" Goto use echo " Parameter:% 1 "IF / I"% 1 "==" START "{echo" Why the hell is% 1 == starting? " SET parameter = geto start: and if / i "% 1" == "pause" {SET parameter = stop goto: execute} echo "parameter% 1% invalid": use echo "synapsis:" echo "switchservices Start "Stop" Goto: EOF: SET SERVICEMENME = DNSSH SET file name = Dnscache.exe Call:% parameter% _Service goto: EOF: stop_Service Echo ... stop service ... net stop% servicename% if (ERRORLEVEL GTR 0) Call: Kill_Service sc config% servicename% start = disabled service closed. Exit / b: kill_Service taskkill / f / im% filename% exit / b: Start_Service Echo ... Starting Service ... sc config% servicename% start = auto net start% servicename% exit / b: EOF  

The result is:

< Pre> c: \ users \ kollenba \ documents \ temp> KapschServices.cmd xxx "Parameter: xxx" "Why the hell is XXX == Start? "... the service is starting ... [SC] ChangeServiceConfig ERFOLG Der Enfford Denst Wurde's Rate Gateartate.

I do not understand why the condition

  If / I "% 1" == "Start"  

does any sign that does not work as expected?

Precondition: Batch File "Net Start "command must be executed with administrator permissions to allow. Used OS: Windows 7

We in batch If not, do not use the statement if the statement, instead of the parenthesis, then replace it:

  IF / I "% 1" == "START" {echo "hell why% 1 == is starting  == "START" (echo "why hell is% 1 = start?" Set parameter = start geto: execute) if / I "% 1" == "STOP" (SET parameter = stop goto: Exic)  

You stopped the service before echo .

And a bonus tip: You do not really need to label : EOF because goto: EOF always gets you at the end of the file Will


php - Why does this database script not return any results? -


I have a problem, and I can not correct myself with the help of a friend.

The basic thing is that I am trying to do this, call a PHP script with 2 arguments: username and subscriptionid .

The PHP script should read "User" by a user named "User", then user ID by user name, in another table, called subscriptionlog , check what the user id is and If so, see that he has an entry with subscriptionid . If so, print the "status" variable of that table.

Here's my code:

  & lt ;? Php // checkkey.php? User = ZeD & subid = 2 - & gt; Called as $ ServerName = "localhost"; $ Username = "username"; $ Password = "password"; $ Dbname = "database"; $ Uname = $ _GET ["user"]; $ Subid = $ _GET ["subid"]; // Create connection $ conn = new mysqli ($ servername, $ username, $ password, $ dbname); // Check connection if ($ conn- & gt; connect_error) {dead ("Connection failed:". $ Conn-> connect_error); } $ Sql ​​= "Subscription in the Selection Position where subscriptionid = '$ subid' and userid = (user user name WHERE user name = '$ uname')"; $ Result = mysqli_query ($ sql); If ($ result === incorrect) echo ("error with bitch SQL"); While ($ line = mysqli_fetch_assoc ($ result)) {echo $ line ["status"]; } $ Conn- & gt; Close (); ? & Gt;  

It just leaves the page blank, there is no echo at all.

Try adding at the top of your page:

  error_reporting (E_ALL); Ini_set ("display_errors", 1);  

So you can see that you have an error.