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.


java - How to send fixed voltage Android audio jack -


I have a small device that operates using smartphone audio jack. For the operation of the device I want to send a certain amount of voltage to the audio jack. I'm using AudioTrack in MODE_STREAM I have a buffer which I wrote a sine signal of fixed frequency which have been found.

This audio sends a single voice to the jack. Does this mean that the output voltage is fixed or changes according to the sign signal? Is there a way to ensure that the output voltage of the audio jack is at a fixed value?

Thank you!

would seem to answer my question that AC output control voltage sound volume level And this tool seems dependent. Thanks for the comment!


python - Recursively build a list based on length and another list -


I'm trying to make my own version of an octa, and if you try to add different size points , As one level of depth is going down, it will overwrite everything, so it will remove any information on large blocks.

I thought the best way to fix this would be to look back at the previous point, and rebuild the list below to the depth of the new point though, I really can not know that this How to make the list, despite the fact, it is very easy to think about the output after that.

Here is the data that needs to be created with an example in the Start and End list, I need it ["Nodes", (Coordination), "Nodes", (Coordination). .] where each coordinate contains every item in the structure list until it reaches the end.

  structure = [(-1, -1, -1), (-1, -1, 1), (-1), 1, -1), (-1, 1) , 1), (1, -1, -1), (1, -1, 1), (1, 1, -1), (1, 1, 1) 'nodes', (1, 1, 1) , 'Nodes', (-1, -1, -1)] end = ['nodes', (1, 1, 1), 'nodes' (-1, -1, -1), 'nodes', ( 1, -1, -1), 'nodes', (1, 1, 1), 'nodes', (-1, -1, -1) 1, 'nodes', (-1, -1, 1)] Length = Lane (end) -Len (start)  

This is an extreme example (to be in depth to 4 0), and 4096 will produce different values, although 99 % Time This will not be something bigger in this way, so the performance should not be taken too much. In the case of

Example of starting and ending values, I do not need the values ​​of each length, they all require maximum length, such as -

 < Code> ['nodes', (1, 1, 1)), 'nodes', (-1, -1, -1), 'nodes', (-1, -1, -1), 'nodes' (-1, -1, -1), 'nodes', ('-1, -1, -1)', 'nodes', (-1, -1), -1), 'nodes', (-1 , -1, 1), 'nodes', (-1, -1, -1), 'nodes', (-1, -1, -1), 'nodes', (-1, -1, -1) )] ['Nodes', (1, 1, 1), 'nodes', (-1, -1, -1), 'nodes', (-1, 1, -1), 'nodes', (- 1, -1, -1), 'nodes', (-1, -1, -1), 'nodes', (-1, -1, -1)] # 4002 value later ['Nodes', (1, 1, 1), 'nodes', (-1, -1, -1), 'nodes', (1, 1, 1), 'nodes', (1, 1, 1 ), 'Nodes', (1, 1, 1), 'nodes', (1, 1, 1)]  

I had an attempt but I realized it was not really recursive Here, it is anyway -

  newThing = {} for the range I (length / 2): Try: # Set it to the previous level so that you can add new text [I ] = Excluding NewType [i-1]: # Close New Ting [I] = {} For Category (Lennon (Structure)): newThing [i] [j] = start # J Add structure structure to each for new structure (new structure): [new] 

Everyone really needs to have every list during the runtime, so if it is found on one platform where it can print all the combinations from within the loop, which would be great, because memory is not stored at all

Since there is no answer, I thought that The easiest way to get around will be a recurring event, and be lucky. It will continue to build lists until they hit the maximum length and return them all once.

  def recursiveList (current input, combination, length): newInputList = [] for input in currentInput: if lane (input) & lt; Combination: To combine in combination: newInputList + = recursiveList ([Input + [input [0], combination]], combination, length) Other: newInputList.append (Input) back to new InputList  
< P> Use the values ​​posted in the question, recursiveList ([start], structure, len (end)) 4096 will return the correct value

It seems very fast Also, there are time outcome results -

64 lists: 0.0000057 seconds / 512 list: 0.00048 seconds / 4096 list: 0.004 seconds = 32768 list: 0.032 seconds

< / Html>

java - Cannot refactor Android Studio Project -


I copied the current project of Android studio into a new directory. I am using the same coding for another app.

I open the project in Android Studio, and I click on the "Java" folder, but it does not show any file inside (they appear in the hard drive).

When I click on "Refactor" on the "Java" folder, the following message appears: "Can not refactoring. The selected directory is not inside the project".

Does anyone help me in solving this, thank you

This project was imported into a non-empty directory.

The following steps:

Assume that you want to copy the project: MyProject1

  1. Paste from your directory and into the empty folder.

  2. Make sure that you close myProject1 from Android Studio files> Close Project

  3. Open an existing Android Studio project

  4. Locate the new directory, where you have pasted the MyProject1 folder, then ask " MyProject1 "folder, if there is a" MyProject1 "folder, it will not work.

  5. Now select MyProject1 folder and proceed.

  6. This graduate will start building build.

  7. After making a successful you can start refactoring.


Why is java.util.regex.Matcher start() and end() returning extra characters in this case? -


I am generating some regexes dynamically and result in matching results with another string post-hoc in my application I am here. I am taking the initial and end indices of a match, then changing the each letter of each one and adjusting the offset for the next matches. Although in a match of many other successfully matched / replaced cases I saw that my starting and ending index contains an additional character.

Here is the code that I am using to create regexes:

  Pattern.compile ("[^ a-zA-Z] + (? & Lt; Mail & gt; "+ pattern. Question (search [i]) +") [^ a-zA-Z] + ")  

where an additional character is added

search [i] = "on daily basis"

[^ a-zA-Z] + ( It is relevant text that is

      

Matching on daily basis with

I have a desired output

  on a daily basis  

This is the output which I get from matcher.group ( "Match"), although when I debug the beginning () and end () results from the same maturing context, I get 356 and 375 respectively (this is in the context of full text), but you can see that the difference These two numbers are 19, whereas the string is only 16 characters "on a daily basis"

I'm assuming that I have an account for \ Q and \ E pattern The Shykta. questions? But then where is the third extra extra character coming from? And why is this particularly in this pattern / target string case?

Is there any other unrelated cause of discrepancy that I see? As a result, it is expected that you [^ a- ZA-Z] + . Therefore, although the actual text length is 16 , then the total length of the matched string will be different.

Although the matching text will be returned to that group, it will begin to match the full match index end () similar to the method, from the last index of the string of the match Index will be the last one.

If you want to start and end the index of the matched group, you can assign the group name to both start (string) and the end (string) Method

Try it in a small string, and you will know.

  string search = "on daily basis"; String tourism = "on daily basis."; Pattern pattern = Pattern.compile ("[^ a-zA-Z] + (? & Lt; mail & gt;" + pattern quote (search) + ") [^ a-zA-Z] +"); Matcher matcher = pattern.matcher (toMatch); If (matcher.find ()) {System.out.println (matcher.group) Length ()); Println (matcher.start ()); Println (matcher.end ()); Println (matcher.group ("match") length ().); Println (matcher.start ("matches")); // Your expected result is System.out.println (matcher.end ("match")); }  

So in the above example, the length of the group is different from the length of the full match (which you get as a result).


angularjs - ng-if doesn't prevent URLs in inner HTML from being evaluated -


मेरे पास कुछ HTML है जो ng-if टैग के साथ सशर्त है।

पूर्व> & lt; div ng-if = "localVideoExists" & gt; & Lt; वीडियो आईडी = "वीडियो प्लेयर" नियंत्रण src = '{{localVideoSrc}}' शैली = "अधिकतम-ऊंचाई: 400px;" / & Gt; & Lt; / div & gt;

एनजी-अगर निर्देश में शर्त को true के रूप में मूल्यांकन नहीं करता है। मुझे लगता होगा कि इसका मतलब है कि अंदरूनी HTML कभी भी DOM में नहीं जोड़ा जाएगा हालांकि, मेरा वेब सर्वर लॉग

/ {{localVideoSrc}}

के रूप में कई अनुरोध दिखाता है, इसलिए कुछ कारण है कि वीडियो टैग को पॉप अस्तित्व (हालांकि मुझे इसे DOM ) में कभी नहीं मिला है और यह अभी तक मूल्यांकन वाले कोणीय टेम्पलेट स्ट्रिंग {{localVideoSrc}} के आधार पर एक वेब अनुरोध बना रहा है। मैं इस व्यवहार को रोकने के लिए प्रतीत नहीं कर सकता वास्तव में, मेरे नियंत्रक में पहली पंक्ति है:

  $ scope.localVideoExists = false;  

मैंने अब भी किसी भी कार्यक्षमता को अक्षम कर दिया है, जो कभी भी localVideoExists से true को सेट कर देगा।

"post-text" itemprop = "text">

इसका कारण यह है कि DOM <के बाद का कोणीय लोड / कोड> लोड हो गया है इसलिए एंबेरडर सक्रिय होने से पहले HTML को पार्स किया जाता है और निष्पादित किया जाता है । इसलिए, ब्राउज़र एनजी-अगर के अंदर HTML को लोड करता है और {{localVideoSrc}} के लिए अनुरोध करता है।

इस तरह से रोकने के लिए व्यवहार की, ng-src का उपयोग करें:

शायद, आपको सुरक्षा की वजह से सेवा का उपयोग करना होगा।


c++ - Identity of template aliases -


टेम्पलेट उपनामों के सेट पर विचार करें:

  टेम्पलेट & lt; class T & gt; Foo = T * का उपयोग कर; टेम्पलेट & lt; कक्षा T & gt; बार = टी * का उपयोग कर; टेम्पलेट & lt; कक्षा T & gt; Buz = foo का उपयोग करके & lt; T & gt; टेम्पलेट के & lt; टेम्पलेट & lt; वर्ग & gt; कक्षा टीटी & gt; संरचना आईडी {}; Id_foo = id & lt; foo & gt;; Id_bar = आईडी & lt; बार & gt;; Id_buz = id & lt; buz & gt ;;  

क्या id_foo , id_bar , id_buz समान या विभिन्न प्रकार हैं? क्या foo , बार , buz समान या अलग टेम्पलेट हैं?

विभिन्न कंपलर्स के उस पर अलग राय है।

  • जीसीसी 4.9 व्यवहार buz जैसा कि foo
      • >

        अध्याय 14.5.7 "उपनाम टेम्पलेट्स" में मानक सी +11 अस्पष्ट है।

        जैसा कि सवाल में बताया गया है, यह एक मानक है।

        14.5.7 [temp.alias] के मौजूदा शब्द प्रतिस्थापन के बाद टाइप-आईडी के साथ एक उपनाम टेम्पलेट के विशेषकरण की तुल्यता

        यही है: foo , बार का कोई विशेषकरण और buz एक ही प्रकार का प्रतिनिधित्व करेगा। लेकिन इसमें कोई गारंटी नहीं है कि, जब एक टेम्पलेट पैरामीटर के रूप में उपयोग किया जाता है, foo , बार और buz विनिमेय हैं।


  • javascript - Select box: add value as class to div -


    I have this form where visitors can choose the letter type; It is necessary to add the value of that latetepe as a class; So we can style it in a stylesheet to preview the letter style.

      & lt; P class = "form-row form-row-wide addon-wrap-2094-lettertype-of-text" & gt; & Lt; Select class = "addon addon-select" name = "addon-2094-lettertype-of-text" & gt; & Lt; Option value = "" & gt; Choose an option ... & lt; / Options & gt; & Lt; Option data-value = "" value = "lucida-caligraphy -1" & gt; Lucida Caligraphy & lt; / Options & gt; & Lt; Option data-value = "" value = "verdana-2" & gt; Wordana & lt; / Option & gt; & Lt; Option data-value = "" value = "bakersville-old face-3" & gt; Backersville Old Face & lt; / Options & gt; & Lt; / Select & gt; & Lt; / P & gt;  

    I already have a javascript

      $ ('addon-select'). ('Option', function () {var selected = $ (this option) .find ('option: selected'). Val (); $ ('product-add-on-make-it-personal'). AddClass $ (This) .val ());}) );  

    This adds value to the JavaScript div. Product-add-on-make-it-personal; But there are 2 problems:

    • The previous square is not being removed; There are also other classes; So I can not do the deleted square in the total
    • There is one more option on the page after that. I can use class.addon-wrap-2094-lettertype-of-text of p-tag above to ensure that I trigger on the right selection box. Click on "$" ("change.exe")


    tsql - How search first position on SQL? -


    I have a problem, I can not find the price status in my table, for example: I have the table:

      ProdID InstID APY C3M2.5K 11920 0.3 C3M2.5K 11246 0.25 C3M2.5 of 11626 0.25 C3M2.5K 12081 0.15 C3M2.5K 11224 0.05 C3M2.5K 11311 0.05 C3M2.5K 11460 0.05 C3M2.5K 11164 0.03 C3M2.5 of 11394 0.01  

    Code:

     from  select * from table where APY = 0.05  

    select me Required that will be the display:
    Calculation (APY) - this is: 9
    APY in the first place - this is: 5
    Thank you for your help.

    You can use this query:

      In the form of CTE (choose Fiction = (Select number (*) FROM dbo.TableName), Pos = ROW_NUMBER () Over (based on ID), ProdID, InstID, APY from dbo.TableName) SELECT TOP 1 Position of API = 0.05  

    Demo:


    java 8 - Setting up Tomcat on DIY OpenShift app for use with Java8 -


    I'm trying to set up a DIY application on OpenShift which uses Java 8 and Tomc. I was going to make a mint until I found it on OpenSoft.

    I wanted to use Tomcat 8 to avoid any problem with Java 8, but at that time I went back to using Tomcat 7. As I have not created it without ant, I tried to install, which gave me the following error:

      Fatal: Any git repository (or mounting to any parent) Point to / var / lib / openshift) file system limit restriction (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).  

    Is there another way to create Tomcat 8, or is there any DIY app using the Tomcat 7? Or any other way of using Java 8 with Tomsk on OpenSoft?

    This works once for me (), right now I try to use it again But Tomcat's URL has broken. I'm looking for a new one.

    Edit

    found:

    EDIT More stuff. Use the openshift blog post that you use to configure server.xml, so that your Tomcat will use the correct port.


    c++ - Same symbols in different libraries and linking order -


    मेरे पास 2 पुस्तकालय हैं: test.1 और test.2 । दोनों पुस्तकालयों में एक एकल वैश्विक extern "c" void f (); फ़ंक्शन है, विभिन्न कार्यान्वयन के साथ (सिर्फ एक cout परीक्षण के लिए)

    मैंने निम्नलिखित परीक्षण किया:

    टेस्ट 1 डायनेमिक लिंकिंग: अगर मैं libtest.1.so और फिर libtest.2.so निष्पादन योग्य के makefile में और फिर f (); में मुख्य , libtest.1 .so- & gt; f () कहा जाता है।
    अगर मैं मेसेफाइल में आदेश बदलता हूं, तो libtest.2.so- & gt; f () को

    कहा जाता है >

    टेस्ट 2 स्टेटिक लिंकिंग: बिल्कुल स्थिर पुस्तकालयों के साथ ऐसा होता है

    टेस्ट 3 डायनेमिक लोडिंग
    लाइब्रेरी के रूप में मैन्युअल रूप से लोड किया गया है, सब कुछ अपेक्षित रूप से काम करता है।


    मुझे कई परिभाषाओं के लिए एक त्रुटि की उम्मीद थी, जो जाहिर नहीं हुआ।

    इसके अलावा, यह एक-परिभाषा-नियम को तोड़ता नहीं है, जैसा कि स्थिति अलग है।

    यह भी निर्भरता-नरक नहीं है (यह इससे संबंधित नहीं है) , और न ही किसी भी प्रकार के असफलता ..

    तो, यह क्या है? अपरिभाषित व्यवहार? अनिर्दिष्ट व्यवहार? या यह वास्तव में लिंक करने के आदेश पर निर्भर करता है?

    और क्या ऐसी स्थितियों को आसानी से पहचानने का कोई तरीका है?


    संबंधित प्रश्न:



    संपादित करें मैंने दो और परीक्षण किए, जो इस यूबी की पुष्टि करते हैं:

    मैंने एक दूसरा फ़ंक्शन जोड़ा शून्य जी () में test.1 और NOT में test.2

    गतिशील लिंकिंग और का उपयोग कर। < / Code> libs, ऐसा ही होता है - f को उसी तरीके से कहा जाता है, g भी निष्पादन योग्य है (अपेक्षित रूप से)।

    लेकिन स्थिर अब जोड़ने से चीजों में बदलाव होता है: यदि test.1 है से पहले test.2 , कोई त्रुटि नहीं है, दोनों कार्यों से परीक्षण 1 को कहा जाता है।
    लेकिन जब ऑर्डर बदल जाता है, तो "कई परिभाषाएं" त्रुटि आती है।

    यह स्पष्ट है, "कोई निदान आवश्यक नहीं है" (@ मार्कब का उत्तर देखें), लेकिन यह "अजीब" जो कभी-कभी त्रुटि होती है, कभी-कभी - यह नहीं है।

    फिर भी, इसका जवाब बहुत स्पष्ट है और बताता है सब कुछ ऊपर - यूबी।

    यह बिल्कुल एक परिभाषा नियम का उल्लंघन करता है मामलों 1 और 2 3 के मामले में, जब आप स्पष्ट रूप से यह निर्दिष्ट करते हैं कि यह कार्यान्वित करने के लिए फ़ंक्शन का कौन सा संस्करण हो सकता है या नहीं। ओडीआर का उल्लंघन अनिवार्य व्यवहार है, कोई नैदानिक ​​आवश्यकता नहीं है।

    3.2 / 3:

    हर प्रोग्राम में हर गैर-इनलाइन फ़ंक्शन या चर का एक परिभाषा होगी जो कि ओडीआर उस प्रोग्राम में उपयोग किया गया; कोई निदान आवश्यक नहीं है।


    c++ - VLC can't load simple openCV video filter -


    I have written a simple opencv test video filters for VLC I had built without errors, but VLC Launch I have:

    core libvlc Warning: modules can not be loaded `/vlc_build/vlc/modules/.libs/libnormalization_cpp_plugin.so '(/ vlc_build / vlc) / modules /. Lbs / libnormalization_capie_plugin SO: undefined symbol: _ZTVN2cv11_InputArrayE)

    I Opansivi 3.0.0-beta and VLC Media Player 3.0.0-Jiaiti Vetiniari (Revision 2.2. 0-git-2564-gc8549fb)

    The main function for changing the frame-by-frame video is:

     <>> static image_T * filterNormalizeEqui (Filter_T * P_Filters, Picture_T * P_pic) {IplImage * p_img; Int i_planes = 0; CvPoint pt1, pt2; Filter_sys_t * p_sys = p_filter- & gt; P_sys; Mat frame; frame_hist_aamric; Of vector & lt; Mat & gt; Channel; // the picture_t IgnImage without partitioning error p_img = cvCreateImageHeader (cvSize (p_pic- & gt; p [0] .i_pitch, p_pic- & gt; p [0] .i_visible_lines), IPL_DEPTH_8U, 1); Kwsetdta (P_yng, P_pic- & gt; p [0] Kp_piksels, P_pic- & gt; p [0] Ki_pic); Frame = severomate (P_img); CvtColor (frame, Frem_hist_ameriyl, COLOR_BGR2YCrCb); IplImage * z_img = new IplImage (frame_hist_edit); CvGetRawData (z_img, (uchar **) and p_pic- & gt; p [0] .p_pixels, NULL, NULL); Return p_pic; }  

    I think, this fails on the cvtColor () function call and it is possible for incorrect vlc-image (p_pic) for opencv (mat frame) processing. I did not find any suitable solutions on the web. The mistake was found in the wrong linking OpenCiv Libs during VLC build.


    PHP: $_GET is unable to fetch the URL query parameters -


    I'm trying to bring URL query parameters using the $ _ GET method as below I:

    URL: www.xyz.com?pagewanted=2 $ pageview = $ _GET ["PageWrite"]; The value of "pageview" is echo: ". $ Pagewanted;

    Output: The value of the pawkwad is:

    What is the problem not being able to get the value of the query? Can it be a server problem?


    ios - How to work around header not found in xcode -


      #include "missing.h"  

    मेरे पास एक पुस्तकालय है हैप्पी फ़ाइल है जो कि ढाँचा के पूर्ण संस्करण में है, लेकिन मैं उस पुस्तकालय को शामिल करता हूं लेकिन लाइट संस्करण में मैं उस पुस्तकालय को लिंक नहीं करना चाहता हूं।

    लेकिन जब आप ग़लत फाइल में शामिल हों निर्माण जारी न करें, यह एक त्रुटि दिखाएगा कि शीर्षलेख "missing.h" नहीं मिला है।

    मैं इस समस्या को कैसे पूरा करूं? यह कहना चाहें कि यदि हेडर नहीं मिला है तो इसे बिल्कुल भी शामिल नहीं है

    आप पूर्वप्रक्रमक निर्देशों का उपयोग कर सकते हैं।

    <पूर्व> # अगर पूर्ण_VERSION #include "missing.h" #endif

    linq - MVC3 dynamic number of checks in where clause -


    In my opinion, I have several selections with a list of server names. The number of servers will be dynamic and will change quite a bit. .

      & lt; Select name = "server" class = "selectioncucker" multiple data-live-search = "true" & gt; & Lt; Optgroup label = "prod5" & gt; & Lt; Options & gt; VS12 & lt; / Options & gt; & Lt; Options & gt; ... & lt; / Options & gt; & Lt; / Optgroup & gt; & Lt; Optgroup label = "UAT6" & gt; & Lt; Options & gt; VS13 & lt; / Options & gt; & Lt; Options & gt; ... & lt; / Options & gt; & Lt; / Optgroup & gt; & Lt; / Select & gt; In the controller I need a filter for some static number against the KPIK and DNA server name (KPI.KPIserver), which will be selected by the user from multiple selections. How to add in the way given below, where the directive number of the clause is checked in the KPISarver, e.g.  

    Where kpi.KPIkey == "CPU Usage" || Kpi.KPIkey == "I / O Operation" & amp; Amp; Kpi.KPIserver == "VS12" || || Kpi.KPIserver == "VS13" || Kpi.KPIserver == ...

      [HTTP post] Public Performance Index (FormCollection FS) {INMERABLE & lt; Kpi_master & gt; AllKPI = Faucet; Try kpi in {AllKPI = db.kpi_masters where kpi.KPIkey == "CPU Usage" || Kpi.KPIkey == Choose "I / O operation" copy; } Hold (exception e) {log. Error ("KPI Post Error:" + E. Message); } View return (allKPI); }  

    If you have a certain field being checked, then it is easy enough .

      var key = new list & lt; String & gt; () {"CPU Usage", "I / O Action"}; Var Server = New List & lt; String & gt; () {"VS 13", "SERVERX"}; ..... allKPI = allKPI = DP.PPI_Master's whereby keys from kPI.Compatible (kpi.KPIkey) || Server. (Kpi.KPIserver) includes kpi;  

    linux - Why does "expr $n - 1" work, but "expr $n -1" doesn't? -


    I have a small problem if you want both of the test script here is a job

      #! / Bin / bash N = 40 while echoing to ["$ N" -gt 0] = $ NN = `expr $ N - 1` done  

    This does not work anymore

      #! / Bin / bash n = 40 while ["$ N" -gt 0] do $ NN = $ expr $ N -1 'done  

    The problem looks like this line N

    bash, version 4.2.45 (1) -release (x86_64-redhat-linux- Gnu)

    - 1 Two words are -1 One word is $ N - 1 An expression is $ N -1 with no two predictions.

    Do you know what to do, okay?


    javascript - Want to use Google map api on localhost -


    After

    I have encountered a problem with my Google Map API while getting the nearest location

    < P> code :.

      var header = {'access-control-permission-origin': '*', 'content-type': 'application / jason'}; Var request = {method: 'get by' url: 'Https://mapskgoogleapiskcom/maps/api/place/nearbysearch/json?location=-33k8670522,l5lkl957362&radius=500&types=food&name ? = Cruise & amp; Key = AIzaSyCLf2OhSgKKOju1hpUBirFtZ-W26zObyVI sensor = false ', header: header} $ http (request) .success (function (d) {warning (d)});  

    Error:

    XMLHttpRequest can not load ... = Food & amp; Name = cruise & amp; Key = AIzaSyCLf2OhSgKKOju1hpUBirFtZ-W26zObyVI sensor = false. No accessible on the requested resource-Control-Allow-Origin "header does not exist, therefore, does not allow Genesis response HTTP status code was 405.

      var headers = { 'access -kantrol-allow-origin': '*', 'Content-Type': 'Application / Jason'}; Var request = {url: 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=cruise&key=AIzaSyCLf2OhSgKKOju1hpUBirFtZ -W26zObyVI? Sensor = false ', header: header) $ http.get (req.url, header) .success (function (d) {alert (D)});  

    sql - Select Query to Get Unique Cells in Two Columns -


    I have a SQL Server database, which logs weather device sensor data.

    The table looks like this:

    ID instrument sensor ID 1 1 1 42 2 1 1 3 3 1 2 30 4 2 2 5 5 1 2 3 4 26 7 3 1 23 8 3 2 1

    In return, the following query should be returned:

    ID deviceind sensor ID 2 1 1 3 3 1 2 30 4 2 2 5 5 2 1 1 7 3 1 23 8 3 2 1

    Sensors must be unique for each device. That is, in columns, the value must be the device ID and the sensor ID (line-wise).

    If I am not clear enough then I apologize.

    If you do not want to specify the value amount as the desired code , You want to take the "arbitrarily" row of each "DeviceId + SensorId" - Group:

     with  as the CTE (SELECT Id, DeviceId, SensorId, Value, RN = ROW_NUMBER (with the participation by DeviceId, the sensor ID by the ID DESC) dbo.TableName) SELECT id, device ID, sensor ID, value from CTE where the ID  

    This is a group Ochc returns row with the ID if you want a different result you ORDER need to change BY ID DESC Demo: (Your results)


    jquery - webkit-touch-callout : none is not working iOS 8 -


    I have a menu bar with a html list and link and a press event with some hammer

    < P> I tried two things:

    1. Add to property CSS:

      / P>

        - WebKit-touch-callout: No one;   

      Prevent the spread of the incident:

        $ item.hammer (). ('Press', function (event) {event.preventDefault (); event.stopPropagation (); ...}); Either the work is not working, probably because Safari grabs the incident in front of me.   

      This CSS property appears as if this dash is missing: / P>

        -webkit-touch-callout: none;  

    javascript - issues using e.target.tagName or .prop in ie8 -


    I have the following logic that I did well in all browsers except the I8,

     < Code> $ ('.has_tags li'). Click (function (e) {if ($ (this) .hasClass ('tag_clicked') and e.target.tagName! == 'LABEL') {$ (this) ('$ $ $ $ $ $ $$$$$$ = 'LABEL') {$ (this) .addClass ('tag_clicked'). Children ('Input'). Prop ('checked', true);}}); In a nutshell, it checks whether a list element is clicked, if it advertises that category, then checks the current list of styles and related inputs, however, if The label inside the element of this list is clicked, it ignores it because it is equivalent to clicking on the click on the checkbox checkbox, however, I88 handles it well when the list element is clicked. Power, but when it is done, click on the label, then nothing happens. I   

    I propose to add an event to INPUT and trigger it when you click on the light ('Click', function (e) {var $ target = $ (e.target); var $ input = $ (this). Find ('input'); if ($ target. Length = $ target.closest ('label') Length) $ input.prop ('check',! $ Input.prop ('check')). Trigger ('change') ;}); $ ('Has_tags input'). ('Change.checkbox', function (e) {var $ input = $ (this) .closest ('li'); if (this.checked) {$ input.addClass ('Tag_clicked')}} and {$ Input.removeClass ('tag_clicked')}}}). Trigger ('change.checkbox');


    android - Global Variable Magically Getting Set To Null?? -



    android - Global Variable Magically Getting Set To Null?? -

    i using smsreceiver class receives sms , sends sms main activity utilize in map application. in onreceive method toast , value fine, when seek utilize variable later downwards code reverse geocode coordinates address global variable null 1 time again :(

    the method called showonmapclicked on line 324 variable null again.

    the sms beingness sent ddms.

    somebody please help, cant figure out!

    onreceive class:

    bundle com.example.maps; import android.content.broadcastreceiver; import android.content.context; import android.os.bundle; import android.telephony.smsmessage; import android.widget.toast; import android.content.intent; public class smsreceiver extends broadcastreceiver { @override public void onreceive(context context, intent intent) { //adding bundle extras used main class bundle bundle = intent.getextras(); smsmessage[] msgs = null; string str = "sms "; //adding sms array stored if (bundle != null) { object[] pdus = (object[]) bundle.get("pdus"); msgs = new smsmessage[pdus.length]; (int = 0; < msgs.length; i++) { msgs[i] = smsmessage.createfrompdu((byte[])pdus[i]); if (i == 0) { //appending info string displayed str += msgs[i].getoriginatingaddress(); str += ": \n"; } str += msgs[i].getmessagebody().tostring(); } toast.maketext(context, str, toast.length_long).show(); //creating new intent intent mainactivityintent = new intent(context, mainactivity.class); mainactivityintent.setflags(intent.flag_activity_new_task); context.startactivity(mainactivityintent); //making intent broadcast main class , putting in displayed intent broadcastintent = new intent(); broadcastintent.setaction("sms_received_action"); //setting name of string "sms" broadcastintent.putextra("sms", str); context.sendbroadcast(broadcastintent); //stops sms going straight inbox this.abortbroadcast(); } } }

    main activity class:

    bundle com.example.maps; //daniel tromp - assignment 2 - 12002076 //imports days! import java.io.ioexception; import java.util.list; import java.util.locale; import com.example.maps.r; import com.google.android.gms.common.connectionresult; import com.google.android.gms.common.googleplayservicesclient; import com.google.android.gms.location.locationclient; import com.google.android.gms.location.locationlistener; import com.google.android.gms.location.locationrequest; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.mapfragment; import com.google.android.gms.maps.model.latlng; import android.app.activity; import android.app.alertdialog; import android.content.broadcastreceiver; import android.content.context; import android.content.dialoginterface; import android.content.intent; import android.content.intentfilter; import android.location.address; import android.location.geocoder; import android.location.location; import android.os.asynctask; import android.os.bundle; import android.telephony.smsmanager; import android.text.inputfilter; import android.text.inputtype; import android.text.method.digitskeylistener; import android.util.log; import android.view.view; import android.widget.edittext; import android.widget.linearlayout; import android.widget.progressbar; import android.widget.textview; import android.widget.toast; //implementing needed services public class mainactivity extends activity implements googleplayservicesclient.connectioncallbacks, googleplayservicesclient.onconnectionfailedlistener, locationlistener { // initializing needed globals location mlocation; string addresssms; string addresstext; public googlemap mmap; private textview maddress; private progressbar mactivityindicator; private locationclient mlocationclient; broadcastreceiver smssentreceiver, smsdeliveredreceiver; intentfilter intentfilter; // milliseconds per sec private static final int milliseconds_per_second = 1000; // update frequency in seconds public static final int update_interval_in_seconds = 5; // update frequency in milliseconds private static final long update_interval = milliseconds_per_second * update_interval_in_seconds; // fastest update frequency, in seconds private static final int fastest_interval_in_seconds = 1; // fast frequency ceiling in milliseconds private static final long fastest_interval = milliseconds_per_second * fastest_interval_in_seconds; // define object holds accuracy , frequency parameters private locationrequest mlocationrequest; private broadcastreceiver intentreceiver = new broadcastreceiver() { @override //on receiving message, textview set sms message public void onreceive(context context, intent intent) { addresssms = intent.getstringextra("sms"); //toasting variable displays sms message toast.maketext(getbasecontext(), addresssms, toast.length_long).show(); } }; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); setupmapifneeded(); maddress = (textview) findviewbyid(r.id.address); // app loads, address bar displayed mactivityindicator = (progressbar) findviewbyid(r.id.address_progress); // setting map type hybrid mmap.setmaptype(googlemap.map_type_hybrid); // create locationrequest object mlocationrequest = locationrequest.create(); // utilize high accuracy mlocationrequest.setpriority(locationrequest.priority_high_accuracy); // set update interval 5 seconds mlocationrequest.setinterval(update_interval); // set fastest update interval 1 sec mlocationrequest.setfastestinterval(fastest_interval); /* * create new location client, using enclosing class handle * callbacks. */ mlocationclient = new locationclient(this, this, this); //creating new intent intentfilter = new intentfilter(); intentfilter.addaction("sms_received_action"); registerreceiver(intentreceiver, intentfilter); } private void setupmapifneeded() { // null check confirm have not instantiated // map. if (mmap == null) { mmap = ((mapfragment) getfragmentmanager().findfragmentbyid( r.id.map)).getmap(); // check if successful in obtaining map. if (mmap != null) { // map verified. safe manipulate map. } } } // when application started @override protected void onstart() { super.onstart(); // connect client. mlocationclient.connect(); } private class getaddresstask extends asynctask<location, void, string> { context mcontext; public getaddresstask(context context) { super(); mcontext = context; } protected string doinbackground(location... params) { geocoder geocoder = new geocoder(mcontext, locale.getdefault()); // current location input parameter list location loc = params[0]; // create list contain result address list<address> addresses = null; seek { /* * homecoming 1 address. */ addresses = geocoder.getfromlocation(loc.getlatitude(), loc.getlongitude(), 1); } grab (ioexception e1) { log.e("locationsampleactivity", "io exception in getfromlocation()"); e1.printstacktrace(); homecoming ("io exception trying address"); } grab (illegalargumentexception e2) { // error message post in log string errorstring = "illegal arguments " + double.tostring(loc.getlatitude()) + " , " + double.tostring(loc.getlongitude()) + " passed address service"; log.e("locationsampleactivity", errorstring); e2.printstacktrace(); homecoming errorstring; } // if reverse geocode returned address if (addresses != null && addresses.size() > 0) { // first address address address = addresses.get(0); /* * format first line of address (if available), city, , * country name. */ addresstext = string.format( "%s, %s, %s", // if there's street address, add together address.getmaxaddresslineindex() > 0 ? address .getaddressline(0) : "", // locality city address.getlocality(), // country of address address.getcountryname()); // homecoming text homecoming addresstext; } else { homecoming "no address found"; } } protected void onpostexecute(string address) { // set activity indicator visibility "gone" mactivityindicator.setvisibility(view.gone); // display results of lookup. maddress.settext(address); } } // when connection made live updates public void onconnected(bundle databundle) { // display connection status toast.maketext(this, "connected", toast.length_short).show(); // start periodic updates mlocationclient.requestlocationupdates(mlocationrequest, this); } // when new coordinates set ddms, map alter // location , new address public void onlocationchanged(location location) { // study ui location updated latlng latlng = new latlng(location.getlatitude(), location.getlongitude()); mmap.movecamera(cameraupdatefactory.newlatlng(latlng)); mactivityindicator.setvisibility(view.visible); /* * reverse geocoding long-running , synchronous. run on * background thread. pass current location background task. * when task finishes, onpostexecute() displays address. */ (new getaddresstask(this)).execute(location); } @override public void onconnectionfailed(connectionresult arg0) { } @override public void ondisconnected() { } // click on button read me file know how utilize // application public void readmeclicked(view v) { // create dialog pop , explain application user alertdialog alertdialog = new alertdialog.builder(this).create(); // read // update alertdialog.settitle("read me"); alertdialog .setmessage("my app created able send out emergency sms individual contain emergency message current location. using ddms, coordinates can input , app go specific location , pull right address of location"); // making dialog show alertdialog.show(); } public void getfromlocationclicked(view v) { alertdialog.builder alertdialog = new alertdialog.builder( mainactivity.this); // setting dialog title alertdialog.settitle("emergency sms"); // setting dialog message alertdialog.setmessage("enter emergency contact number"); final edittext input = new edittext(mainactivity.this); linearlayout.layoutparams lp = new linearlayout.layoutparams( linearlayout.layoutparams.match_parent, linearlayout.layoutparams.match_parent); input.setlayoutparams(lp); alertdialog.setview(input); // setting positive "continue" button alertdialog.setpositivebutton("continue", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { string testing = input.gettext().tostring(); getfromlocation(testing); } }); // setting negative "cancel" button alertdialog.setnegativebutton("cancel", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { dialog.cancel(); } }); // showing alert message alertdialog.show(); }; public void getfromlocation(string straddress) { geocoder coder = new geocoder(this); list<address> address; seek { address = coder.getfromlocationname(straddress, 5); if (address != null) { address location = address.get(0); double reclat = location.getlatitude(); double reclng = location.getlongitude(); latlng p = new latlng(reclat, reclng); toast.maketext(getbasecontext(), p + "", toast.length_long) .show(); mmap.animatecamera(cameraupdatefactory.newlatlngzoom(p, 16)); } } grab (ioexception ie) { ie.printstacktrace(); } } //showing value when show button clicked public void showonmapclicked(view v) { //when toasts, addresssms value null!?? toast.maketext(getbasecontext(), addresssms, toast.length_long).show(); //getfromlocation(addresssms); } public void showtoast(string message) { string test = message; toast.maketext(getbasecontext(), test, toast.length_long).show(); } // click button start generate emergency sms public void sendaddressclicked(final view v) { alertdialog.builder alertdialog = new alertdialog.builder( mainactivity.this); // setting dialog title alertdialog.settitle("emergency sms"); // setting dialog message alertdialog.setmessage("enter emergency contact number"); final edittext input = new edittext(mainactivity.this); linearlayout.layoutparams lp = new linearlayout.layoutparams( linearlayout.layoutparams.match_parent, linearlayout.layoutparams.match_parent); input.setlayoutparams(lp); alertdialog.setview(input); input.setfilters(new inputfilter[] { // maximum 2 characters. new inputfilter.lengthfilter(10), // digits only. digitskeylistener.getinstance(), // not strictly needed, imho. }); // setting positive "continue" button alertdialog.setpositivebutton("continue", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { // setting sms message , adding current // location gathered map. string textmessage = input.gettext().tostring(); // checking if phone number not blank if (textmessage.isempty()) { // if phone number not entered toast.maketext(getbasecontext(), "cannot blank. come in phone number.", toast.length_long).show(); sendaddressclicked(v); } else { entermessage(textmessage); } } }); // setting negative "cancel" button alertdialog.setnegativebutton("cancel", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { dialog.cancel(); } }); // showing alert message alertdialog.show(); }; // method send emergency method , current location private void sendsms(string phonenumber, string message) { // sending sms emulator number input smsmanager sms = smsmanager.getdefault(); sms.sendtextmessage(phonenumber, null, message, null, null); } // 1 time user has input number, message asked public void entermessage(final string number) { // creating dialog input emergency message alertdialog.builder alertdialog = new alertdialog.builder( mainactivity.this); // setting dialog title alertdialog.settitle("emergency sms"); // setting dialog message alertdialog.setmessage("enter emergency sms"); final edittext input = new edittext(mainactivity.this); linearlayout.layoutparams lp = new linearlayout.layoutparams( linearlayout.layoutparams.match_parent, linearlayout.layoutparams.match_parent); input.setlayoutparams(lp); alertdialog.setview(input); input.setinputtype(inputtype.type_class_text); // setting positive "send sms" button alertdialog.setpositivebutton("send sms", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { // write code here execute after dialog // setting sms message , adding current // location gathered map. string textmessage = input.gettext().tostring(); string sms = textmessage + "\n\n" + "my current address is: " + addresstext; string phonenumber = number; // checking see if sms blank if (textmessage.isempty()) { toast.maketext(getbasecontext(), "cannot blank. come in emergency sms.", toast.length_long).show(); entermessage(phonenumber); } else { // sending variables through sendsms // method sent sendsms(phonenumber, sms); } } }); // setting negative "cancel" button alertdialog.setnegativebutton("cancel", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { // write code here execute after dialog dialog.cancel(); } }); // showing alert message alertdialog.show(); }; }

    try overriding onsaveinstancestate(bundle bundle) method in mainactivity , utilize logs see if getting called before info getting wiped out. suspect you'll see getting called. if so, save 'globals' in bundle , retrieve them overriding onrestoreinstancestate(bundle bundle)

    the doc should help how save , restore. whenever activity needs killed memory or orientation change, oncreate called , 'globals' can lost way.

    this might help more details.

    android sms google-maps-android-api-2

    javascript - how to allow geolocation in web page -



    javascript - how to allow geolocation in web page -

    i have been trying run code latitude , longitude. ie browser shows message geolocation services not supported, , chrome says 'this page has been blocked tracking location' after set location setting in chrome allow sites track. please help.

    <html> <head></head> <body> <input type="button" id="btnsearch" value="search" onclick="dosomething();"/> <script> function dosomething(){ if (navigator.geolocation) { navigator.geolocation.getcurrentposition(handle_geolocation_query); function handle_geolocation_query(position) { alert('lat: ' + position.coords.latitude + ' ' + 'lon: ' + position.coords.latitude); } } else { alert("i'm sorry, geolocation services not supported browser."); } } </script> </body> </html>

    change scope of handle_geolocation_query() outer, , should work. works on ie , firefox after changes.

    <html> <head></head> <body> <input type="button" id="btnsearch" value="search" onclick="dosomething();"/> <script> function dosomething(){ if (navigator.geolocation) { navigator.geolocation.getcurrentposition(handle_geolocation_query); } else { alert("i'm sorry, geolocation services not supported browser."); } } function handle_geolocation_query(position) { alert('lat: ' + position.coords.latitude + ' ' + 'lon: ' + position.coords.latitude); } </script> </body> </html>

    javascript html5 geolocation

    Python redis pubsub: what happen to types when it gets published? -



    Python redis pubsub: what happen to types when it gets published? -

    pub.py

    import redis import datetime import time def main(): redis_host = '10.235.13.29' r = redis.client.strictredis(host=redis_host, port=6379) while true: = datetime.datetime.now() print 'sending {0}'.format(now) print 'data type %s' % type(now) r.publish('clock', now) time.sleep(1) if __name__ == '__main__': main()

    output:

    sending 2014-10-08 13:10:58.338765 info type <type 'datetime.datetime'> sending 2014-10-08 13:10:59.368707 info type <type 'datetime.datetime'> sending 2014-10-08 13:11:00.378723 info type <type 'datetime.datetime'> sending 2014-10-08 13:11:01.398132 info type <type 'datetime.datetime'> sending 2014-10-08 13:11:02.419030 info type <type 'datetime.datetime'>

    sub.py

    import redis import threading import time import datetime def callback(): redis_host = '10.235.13.29' r = redis.client.strictredis(host=redis_host, port=6379) sub = r.pubsub() sub.subscribe('clock') while true: m in sub.listen(): #print m #'recieved: {0}'.format(m['data']) = datetime.datetime.now() print 'recieved: %s @ %s' % (m['data'], now) print 'data type %s' % type(m['data']) dur = 1 print 'it took %s receive' % dur def main(): t = threading.thread(target=callback) t.setdaemon(true) t.start() while true: print 'waiting' time.sleep(30) if __name__ == '__main__': main()

    output:

    {}: ./sub.py waiting recieved: 1 @ 2014-10-08 13:09:36.708088 info type <type 'long'> took 1 receive recieved: 2014-10-08 13:09:37.629664 @ 2014-10-08 13:09:37.630479 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:38.630661 @ 2014-10-08 13:09:38.631585 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:39.632663 @ 2014-10-08 13:09:39.633480 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:40.633662 @ 2014-10-08 13:09:40.634464 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:41.634665 @ 2014-10-08 13:09:41.635557 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:42.635662 @ 2014-10-08 13:09:42.636673 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:43.642665 @ 2014-10-08 13:09:43.643441 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:44.643663 @ 2014-10-08 13:09:44.644582 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:45.644667 @ 2014-10-08 13:09:45.673734 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:46.672918 @ 2014-10-08 13:09:46.673874 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:47.673913 @ 2014-10-08 13:09:47.675014 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:48.674920 @ 2014-10-08 13:09:48.675804 info type <type 'str'> took 1 receive recieved: 2014-10-08 13:09:49.675912 @ 2014-10-08 13:09:49.677346 info type <type 'str'>

    the type changed datetime.datetime str possible preserve type because trying find duration cant subtracte datetime obj str?

    see http://pymotw.com/2/pickle/

    i think must serialize datetime object in published channel, deserialize when reading sub.

    i noticed commented on solution :) http://stackoverflow.com/a/20400288/152016

    edit:

    you store epoch seconds in key , avoid serializing! (if publish datetimes).

    python redis redis-py

    PHP Regex using the \Q \E syntax -



    PHP Regex using the \Q \E syntax -

    i reading on regex's , says: all characters between \q , \e interpreted literal characters. e.g. \q*\d+*\e matches literal text *\d+*.

    so tested out:

    $pattern = '/\q~!@#$%^&*()_+|}{?><,./\][":';\e/'; $string = '~!@#$%^&*()_+|}{?><,./\][":';'; preg_match( $pattern, $string, $matches ); echo "<pre>"; print_r($matches); echo "</pre>";

    it gives me error:

    parse error: syntax error, unexpected '~' in /applications/xampp/xamppfiles/htdocs/xampp/web_development/new_study_2014/regex.php on line 3

    why not working stated above?

    you forgot quote ' within patterns:

    $pattern = '/\q~!@#$%^&*()_+|}{?><,./\][":';\e/'; ^--start string #1 ^--end string #1 ^--start string #2 $string = '~!@#$%^&*()_+|}{?><,./\][":';'; ^---end of string #2 ^---your error, because it's outside of string

    php regex

    javascript - server based bokeh plot update -



    javascript - server based bokeh plot update -

    i using bokeh embed chart html template served flask. using autoload server method returns script embedded html template renderer.

    what next update plot via ajax type request, via button click on hte same page, without having replace whole script came along first time page loaded. seems should possible update plot id or similar chart changes without brute forcefulness of replacing whole script each time. possible , how done?

    thanks!

    hi possible, difficult. working on pr:

    https://github.com/continuumio/bokeh/pull/1274

    that merged in next few days (today's date: 2014.10.19) create things easier. adds "bokeh.index" contains top level objects, can reach in , grab info sources more , update them. there follow on pr create illustration describe:

    https://github.com/continuumio/bokeh/pull/911

    it may few weeks before have time finish one, suggest subscribing issue on gh can updated when ready.

    javascript python flask bokeh

    javascript - asp:button ocmmandName disable post back -



    javascript - asp:button ocmmandName disable post back -

    my website dynamically loads info list dynamically loaded dropdownlist in each item.

    my button within of each item uses commandname execute code take value dropdownlist within of same item , it. (by using system.web.ui.webcontrols.datalistcommandeventargs e parameter)

    my problem is, 1 time pick dropdownlist , click on button, performs post-back , takes "currently selected value" ddl, has been reset first 1 because of post back...

    how can solve this?

    i have tried putting onclientclick="return false;" onto button, seems stop commandname running @ all...

    i have tried usesubmitbehavior="false", not stopping problem.

    any ideas? thanks.

    javascript c# asp.net

    java - Is OracleDataSource.getConnection thread-safe? -



    java - Is OracleDataSource.getConnection thread-safe? -

    i thought finding reply easy...but not much.

    does know if oracledatasource.getconnection method thread safe?

    i not mean connection objects returns, calling of getconnection itself.

    specifically, method: http://download.oracle.com/otn_hosted_doc/jdeveloper/905/jdbc-javadoc/oracle/jdbc/pool/oracledatasource.html#getconnection()

    the docs , class doesn't explicitly but, beingness how connection pool, i'm inclined believe is.

    this problem discussed in java concurrency in practice (brian goetz):

    4.5.1. 􀀃interpreting 􀀃vague􀀃 documentation

    many􀀃 java􀀃 technology􀀃 specifications􀀃 are􀀃 silent,􀀃 or􀀃 at􀀃 least􀀃 unforthcoming,􀀃 about􀀃 thread􀀃 safety􀀃 guarantees􀀃 and􀀃 requirements􀀃 for􀀃 interfaces􀀃 such􀀃 as􀀃 servletcontext,􀀃 httpsession,􀀃 or􀀃 datasource.

    ...information servlets...

    one􀀃 can􀀃 create 􀀃a 􀀃similar 􀀃inference􀀃 about􀀃 􀀃jdbc􀀃datasource􀀃 interface,􀀃 􀀃represents 􀀃a􀀃 pool 􀀃of 􀀃reusable􀀃 database􀀃 connections.􀀃 a􀀃 datasource􀀃 provides􀀃 service􀀃 to􀀃 an􀀃 application,􀀃 and􀀃 it􀀃 doesn't􀀃 make􀀃 much􀀃 sense􀀃 in􀀃 the􀀃 context􀀃 of􀀃 a􀀃 single threaded 􀀃application. 􀀃it 􀀃is􀀃 hard 􀀃to 􀀃imagine 􀀃a 􀀃use 􀀃case 􀀃that 􀀃doesn't 􀀃involve 􀀃calling 􀀃getconnection 􀀃from􀀃 multiple􀀃 threads. 􀀃and, 􀀃as 􀀃with 􀀃servlets, 􀀃the􀀃 examples 􀀃in 􀀃the 􀀃jdbc􀀃 specification 􀀃do 􀀃not 􀀃suggest 􀀃the 􀀃need 􀀃for 􀀃any 􀀃client side􀀃 locking􀀃 in 􀀃the 􀀃many 􀀃code 􀀃examples 􀀃using 􀀃datasource.􀀃 so, 􀀃even 􀀃though 􀀃the􀀃 specification 􀀃doesn't 􀀃promise􀀃 􀀃datasource􀀃 is􀀃 thread-safe 􀀃or 􀀃require􀀃 container 􀀃vendors 􀀃to 􀀃provide 􀀃a 􀀃thread-safe􀀃 implementation,􀀃 by􀀃 􀀃same 􀀃"it 􀀃would 􀀃be 􀀃absurd 􀀃if 􀀃it􀀃 weren't"􀀃 argument, 􀀃we􀀃 have􀀃 no􀀃 choice􀀃 but􀀃 to􀀃 assume􀀃 that􀀃 datasource.getconnection􀀃 does􀀃 not􀀃 require􀀃 additional􀀃 client-side􀀃 locking.􀀃 ...

    java oracle thread-safety

    java - Regarding REST Path Conflict -



    java - Regarding REST Path Conflict -

    i creating 2 methods(get) in rest service in url first method of form

    /a/b/{parameter}?start=1 & end=100 & name="some value"

    and sec method

    /a/b/{parameter}

    when run code gives conflict. can please suggest me how these can configured methods , create query paramters optional?

    thanks

    this should work fine:

    @get @path("/a/b/{parameter}") public response get(@pathparam("parameter") string parameter, @queryparam("start") integer start, @queryparam("end") integer end, @queryparam("name") string name) { // switch here according values received. optional , non-sent nulls here }

    if in future have default values can add together them inline (for name query param example):

    @defaultvalue("some-name") @queryparam("name") string name

    java rest jersey jax-rs

    python 2.7 - How to store data crawled in scrapy in specfic order? -



    python 2.7 - How to store data crawled in scrapy in specfic order? -

    i have crawl info web page in specfic order liked declared fields in item class , have set them in csv file.problem occuring there stores info not in specfic order scrapping info of field , putting in csv file want should store info declared in item class. newbie in python. can tell me how

    for ex: item class class dmozitem(item): title = field() link = field() desc = field()

    now when storing info in csv file storing first desc ,link , title "desc": [], "link": ["/computers/programming/"], "title": ["programming"]}

    the reason order of info in csv file not declared because item dict info type. order of keys in dict decided alphabet order. logic of export items csv file implemented in

    scrapy\contrib\exporter__init__.py

    you can rewrite _get_serialized_fields method of baseitemexporter allow yield key-value pair in order of declaration. here illustration code

    field_iter = ['title', 'link', 'desc'] field_name in field_iter: if field_name in item: field = item.fields[field_name] value = self.serialize_field(field, field_name, item[field_name]) else: value = default_value yield field_name, value

    but remember, not universal solution.

    python-2.7 scrapy web-crawler