Posts

python - Plot 2D Histogram as heat map in matplotlib -

Image
I have 3-D data that I want to realize as the following histogram . For each bin, I have a text file like two columns like 1.12 0.65 1.41 0.95 1.78 1.04 2.24 2.12 etc. The first entry in the first column (in .txt) gives me the value of the first tile center, the second row of the first column gives me value for the center of the second tile. The second column refers to the value of the first column on the color bar and bin size is logarithmically different. I would like to plot it in matplotlib as close to the top (ignore the arrows). I recommend that you use polycolation: Import import as imported pl as mp x = np.logspace (1, 2, 20) polys = [] values ​​= [] x (x [: - 1] , X [1:]): y = np.logspace (1.0, 2 + np.random.rand () + 2 * np.log10 (xs), 30) C = -np.log (xs * y) Yp = np.c_ [y [: - 1], y [: - 1], y [1:], y [1:]] xp = np.repeat ([[xs, xe, xe, xs]], Lyn (yp) axis = 0 points = np.dstack ((xp, yp)) polys.append (points) values.append (c [: - 1]) polys = np.concaten...

c++ - How to find sum of several integers input by user using do/while, While statement or For statement -

Please help here. I want to create a program in which a user uses a number of numbers (let's say 6 numbers to 6 numbers). Then the program should proceed and calculate the sum of all these points. I, however, have to use a loop statement, either for a statement, during statement or during statement / statement. This is what I have done so far: #include & lt; Iostream & gt; using namespace std; Int main () {int count = 1; Int sum = 0; Int number; Int nights; Cout & lt; & Lt; "Enter the number of items: \ n"; Cin & gt; & Gt; Numberitems; Cout & lt; & Lt; Enter the number: \ n "; Cin & gt; & Gt; Number; Do {sum = sum + number; Count ++; } Whereas (calculation and even using other statements #include & lt; Iostream & gt; using namespace std; Int main () {int count = 1; Int sum = 0; Int number; Cout & lt; & Lt; Enter the number: \ n "; Cin & gt; & Gt; Number; While (calculation I know tha...

recursion - Recursive Runtime of T(n-k) -

Image
मैं समीकरण के क्रम को खोजने की कोशिश कर रहा हूं; T (n) = T (n-2) + n³। जब मैं इसे हल करता हूं, तो मैं समीकरण टी (एन) = टी (एनके) + एसएआर k = 0 पर पहुंचता हूं। ।, N / 2 (n-2k) ³। उस राशि को हल करने से मुझे 1/8 (एन 2) (n + 2) ² मिलता है। इसे सुलझाने के लिए मुझे क्रम के लिए Θ (एन.ई.) बनना होगा। हालांकि, मुझे लगता है कि मैंने कुछ गलत किया, क्या किसी के पास कोई विचार है? आपको ऐसा क्यों लगता है कि यह गलत है? यह समीकरण स्पष्ट रूप से थीटा (एन ^ 4) अधिक विस्तृत समाधान Wolframalpha से प्राप्त किया जा सकता है (क्या आपने इसे पुनरावृत्ति समीकरणों को हल किया है?) आप कुछ सीमा के मामलों को भी जोड़ सकते हैं, जैसे टी (0) = टी (1) = 1 और अंत में: असीमपटाटिक भूखंड, दिखा रहा है कि यह वास्तव में N ^ 4 फ़ंक्शन की तरह व्यवहार करता है

python 2.7 - please can someone get my linked list below to work?, there's an issue -

वर्ग नोड: def __init __ (स्वयं): self.value = कोई भी नहीं self.pointer = कोई def सेटवल्यू (स्वयं , X): self.value = x def setpointer (स्वयं, नोड): self.pointer = नोड डीईएफ़ दिखाना (स्वयं): प्रिंट स्वयं। नोड्स मुद्रित self.value class linkedlist: def __init __ (स्वयं): self.nodes = [ ] डीईएफ़ एडीएनोड (सेल्फ, नोडिवल्यू): न्यूओनोड = नोड () नया नोड। एसटीवल्यूएव (नोडेवैल्यू) सेल्फ। नोड्स [1] .सेटपॉन्टर (न्यूओनोड) डीईफ़ रिमेंडेड (स्वयं, नोडिपॉशन): अगर नोडपोज़ी == 0: स्वयं। नोड्स [ 1:] और: स्वयं। नोड्स [0: नोडपोस्टियन: 1] + स्व। नोड्स [(नोडस्पेस्टियन + 1):] आइटम = लिंकसूची () आइटम.एडनेट (2) आपको इस कार्यान्वयन का उपयोग करने की आवश्यकता नहीं है, अजगर सूची आसान है। एक सूची बनाने की कोशिश करें जैसे आपने किया Linkedlist.nodes self.nodes = [] और जोड़ें जब मैंने आपका कोड निष्पादित किया है, तो इस लाइन में एक अपवाद है self.nodes [-1] .setpointer (newnode) सूचियों के नकारात्मक सूचकांक पर कोई मान नहीं है। सूचियों के बारे में अधिक जानकारी के लिए, देखें

javascript - Trying to save the contents of a contenteditable div to MySQL database -

OK, so I want to submit the content of a contentedable div into a MySQL database. I have a (contenteditable = 'true') population with a HTML code from a MySQL database. This is something like this: $ page = $ _GET ['page']; $ Getpage = mysql_query ("WHERE title = '$ page'" from the page) or die (mysql_query ()); $ Line = mysql_fetch_assoc ($ getpage); $ Pagecode = $ line ['pagecode']; & Lt; Div class = "editable" contenteditable = "true" & gt; & Lt ;? Php echo $ pagecode; ? & Gt; & Lt; / Div & gt; And I want to control it with regular links: It may be possible to work with a hidden form that is controlled with Javascript, but I have no clue. The goal is to do something like HTML Editor, display HTML code from the database within the editable device, and allows the user to edit it and save it back to the database. Gill In your AJAX code, request a new AJAX for a processor . A...

java - Why do Hadoop jobs need so many threads? -

My understanding of Hadoop is that equality on each enumeration node is obtained by starting different jvms for each core. I see that every JVM has dozens of threads, which can lead to thousands of threads per node. I do not want to think about any reason that so many threads are born. what's going on? For example, here's a simple pig script that parses and filters some jens: / * * Get Tweets with GPS / $ JAR Register Do; Use Json_eb = LOAD '$ IN_DIRS' as com.twitter.elephantbird.pig.load.JsonLoader ('- nestedload') (json: map []); - With Twitter's Library - PRS Jason Parsed0 = Generate FOREACH json_eb STRSPLIT (Jason # 'id', ':'). Tweet as $ 2: Charra, STRSPLIT (Jason # 'Actor' # 'Id', ':'). UserId as $ 2: Charra, JSN # 'Posttime' AS Posttime: Charra, JSN # 'GO' # 'Coordinator' AS GPS: Chararer; Parsed1 = FILTER parsed0 BY (not GPS); PigStorage (); '$ OUT_DIR' in Store Parsed1;...

java - Swing layouts combine box and flow -

I use a panel with box layout and then add a panel with a flyleigh so that when I want to break the line Can I ... but reduce the space between flow-line panels in the idak box layout: JPN search = new JPNL (); Boxleigh bl = New Box Layout (Search, BoxLayout.Y_AXIS); Search.setLayout (BL); What method do I use to reduce space? a box layout to increase / shrink panel based on available space Try to override the getMaximumSize () method of the panel to return the preferred size of the panel. @ Override Public Dimensions getMaximumSize () {getPreferredSize ()); }