Posts

Creating a variable in Python and assigning it to the last call of a function without calling the function again -

Then I am creating a very simple temperature class which can change the temperature given from Celsius to Fahrenheit and its Adverse. The problem is that I have to create a "convert" method within a client which executes if it is called directly, but one variable is not assigned. Here is my code: class temperature: def __init __ (self, temp = none, cf = 'C'): if temp == none: self.temp = float ('0.0 'Other': Try: self.temp = float ("{0: .2f}". Exclude format (temp)): Print ('Your temperature should be a number!') If not CF ['C' 'C' 'F', 'F']: Print ('You should identify temperature as F for Fahrenheit or C Celsius!') Other: self.cf = cf.upper () def (self) : Self-self.cf == 'F': self.temp = float ("{0: .2f}" format (self.temp - 32) * 5/9)) self.cf = 'C' return Yes) elif self Cf == 'C': self.temp = float ("{0: .2f}" format ((9/5) * self.temp + 32) se...

symfony - How to let PhpStorm know that a javascript global variable is defined? -

Image
मेरे पास उस टॉगल टेम्पलेट हैं: & lt; script type = "text / javascript "& gt; Var initParams = {होमपेज: '{{url (' _ homepage ')}}'}; & Lt; / स्क्रिप्ट & gt; दूसरी तरफ, मेरे पास। जेएस फ़ाइल initParams.homePage के उपयोग के साथ है I समस्या PHPStorm लगता है कि मेरे initParams परिभाषित नहीं है। क्या वैश्विक पीएचपीएसटॉर्म क्षेत्र में इनट्यूग जेएस वैरिएबल्स को परिभाषित करने का कोई तरीका है? धन्यवाद अग्रिम में! जब आप जावास्क्रिप्ट का निरीक्षण करने के लिए उपयोग करते हैं, तो आप झूठे चेतावनियों से बचने के लिए इस तरह से कुछ का उपयोग कर सकते हैं: / * वैश्विक $, अलर्ट, पुष्टि करें, इनटप्रम * / / * jslint ब्राउज़र : सच * / $ (दस्तावेज़) .ready (फ़ंक्शन () {चेतावनी (initParams.homepage);}); जिस तरह से आप अपने जावास्क्रिप्ट कोड में रूटिंग का उपयोग करना चाहते हैं, आपको इसे देखना चाहिए।

html - I want to arrange tables horizontally and vertically , contained in two DIVs arranged horizontally -

I am trying to organize 8 tables in two rows. I have two devices horizontally aligned - I am trying to align Br> 4 tables in rows 1 line Rows 4 in the When I try to put it in the other [left] div container inside the code below, all tables go to one line, the code below which is used I am doing & lt; Div class = "datagrid" & gt; & Lt; Table & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th & gt; Header & lt; / Th & gt; & Lt; Th & gt; Header & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; TD & gt; Data & lt; / TD & gt; & Lt; TD & gt; Data & lt; / TD & gt; & Lt; / TR & gt; & Lt; Tr square = "alt" & gt; & Lt; Td> Data & lt; / Td> & Lt; Td> Data & lt; / Td> & Lt; / Tr & gt; & Lt; TR & gt; & Lt; TD & gt; Data & lt; / T...

sql - mysql display results horizontally -

I have written a few questions and I have found query results. created site SITE1 SITE3 SITE3 SITE4 SITE5 SITE6 SITE7 SITE8 SITE9 10/2/2014 63 NULL NULL NULL NULL NULL NULL NULL 10/2/2014 Nal Nell Nell Nell Nail Nail Nail Nail 10 10 / 3/2014 21 Nell nail nail nail nail nail nail nail nail 10/3 / 2014 Nail nail nail nail null faucet tap faucet 4 Now I have to display this way. Creating site SITE2 SITE3 SITE4 SITE5 SITE6 SITE7 SITE8 SITE9 10/2/2014 63 NULL NULL NULL NULL NULL NULL 10 10/3/2014 21 NULL NULL NULL NULL NULL NULL 4 Note: I'm already grouping and building the name of the site. Do you have any good ideas or some thing tells me .. Enter the code here, select alldata.createdate, count (name), when the name = 'SITE1' then counting (1) as SITE1, when name = 'SITE2' then count (1) ends in SITE2, case when name = 'SITE3' then count (1) SITE3 When the case ends, the case when E = 'SITE4' is the matter of counting (1) as SITE4, ...

java - Mobicents jDiameter what is wrong with the example on git -

I'm trying to run a client-server instance, for example I've found => But it does not seem that it works. Although the message reaches the server and an answer has been received, the example "Process Requests" example server is never called, which means that the message has never actually been processed as I The called "received success message" is called on the client but it only processes the original message. I see that the message is received in the server due to this log in the server log: "Get Message Types for" Peer [AAA: // Lokhost: 4726 9] " I have also found that there are two stacklike classes which can be found under an "org.jdiameter.server.impl" while the other is under "org.jdiameter.client.impl". Although the client uses one under the server which looks awkward and with a quick glance they are not identical I am not even getting Jawadox and I found that the only document that does not really s...

javascript - How to find middle point of a line in Jquery? -

Image
I have a 60px width diagonal line, and it follows the mouse cursor. But I want to set my original point to middle or line. How can I do this in the corner of the line? I tried to give a left: -30px line but it does not work. Now my line is; what I try to do Var original x = $ ('#boot-point'). Offset (). Left + $ ('#boot-point') External Wide () / 2; Var originY = $ ('# origin-point'). Offset (). Top + $ ('# origin-point'). OuterHeight () / 2; Var length = Math.Sqrt ((event.pageX - originX) * (event.pageX - originX) + (event.pageY - originY) * (event.pageY - originY)); Angle of character = 180 / 3.1415 * Math.com ((event.pageY - originY) / Length); If (event.pageX> Basic) angle * * -1; I have a JSField Have decided. Update your conversion first, such as coordinates: # new-link-line {-webkit-transform-origin: top center; -MOZ-Transform-Origin: Top Center; -O-Change-Origin: Top Center; -MMS-Change-Origin: Top Center; Cha...

Parsing MySQL output in Bash -

How can I redirect the output of the mysql query as a table sercer? I try with this code: mysql -u root -h localhost -d cronjob -e "Select * from cron_list"> Query.txt I hope that such an output is: | id | day-time | recursive | command | | 1 | 2014-10-10 | daily | Bash / Media / Data / Daily | sh | | | | | | | | | | | | | | | 2014-10-09 | Minute | Concrete | But when I use that code, I output to id datetime recurrency command 1 2014-10-10 Daily Bash / Media / Data / Daily.sh 2 2014-10-09 linear conveyor So, the term How can I redirect output to a file with a separator like a terminal, like the terminal? Sorry for the bad english From man mysql : - Table, -T Display the output in the table format. This is the default for interactive use, but can be used to produce table output in batch mode. Note -t is the default behavior, but whenever you have a pipe in a file that is why in that case you have to clarify it. Other interesting op...