Posts

Showing posts from August, 2012

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 ()); }

objective c - How to run Tests from iOS Static Library your project is dependent on -

Image
I have created several static libraries that are shared between several iOS projects. I have made several unit tests in these static libraries. I want to test this whenever I examine the project which is included in the stable library. I have tried to include all the tests inside the "testing" section of the main projects, but this usually occurs in the "simulator is already in use" errors and tests fail. Probably because the last test simulator is using. For the skin project's main project SEUSUIKitTests, APIKitTests, PurchaseTests and MCSKINKINKET tests are all exams from static libraries Am I going to go about this right or should I think differently? ? ** Edit ** It seems that this stack overflow question is having the same problem ** Edit 2 ** radar: Although it is too much confusing to set up your unit test correctly and One time sync on XCode (thanks to the very clear messages you received), in your case I think the problem is ...

android - SQLite database and CursorLoaders -

I am working on a client-side Android application that will retrieve data from a URL and save it to a local database. Could. I'm familiar with using the SQLiteDatabase for this operation. My concern started when I was reading about SimpleCursorAdapter to display the table row in the list when I was about Cursor Loader If I read, to manage the cursor asynchronously This is the thing that when they read about it, they talk about ContentProvider and As far as I know, that class is used to share data between apps Is done, so I got super confused. Can you guide me through this, I do not know that I need to use a cursor loader because I do not know what it is, and it Sharing data between what to do and what to do with the ContentProvider . EDIT: Reading the demo app found here It seems that you want to retrieve the data line 122: On CrateLoader Public Loader & lt; Cursor & gt; OnCreateLoader (int loaderId, bundle args) {loader = new SQLiteCursorLoader (thi...

angularjs - Using Angular with socket.io -

I know that angular client provides two types of data binding on the side, but I need more! I am looking for the right way to hook an angle with my server side (SailsJS which includes socket.io). Thank you! Have you tried an angle-pal-bind? () I'm sure you do not have it, as I have released the world just a few minutes ago :). I made it for my project and then decided to keep it as a separate library so that everyone could benefit and my first experience was in the development of the Boer package. I hope this will help you. BTW: It works with Pal 0.10 (as there are some things, such as topic names were changed since 0.9). If you need to work with 0.9, just tell me and I'm happy to help.

Change git initial commit to kill history -

I have a repo where I want to delete all the commitments before the purpose of changing repo's initial commitment. . I have created a branch with my final commitment, as I want to be in the form of a new root: ago> Then I started a new commission for the initial commitment Created: git checkout- b initial $ (echo "deleted history" | git commit-tree $ (git write- Then I will call SHA Starting from the beginning I want to rebus the master at the beginning of the beginning, so I did: git rebase - master of the initial starting new place But the Rebase is not successful. After some commitments I get the struggle. Maybe I am not understanding, but the way I see it, I should not fight because I only I want to apply all the commands of the Master over that new "fake" initial commitment. Thank you in advance. You need an orphan GIT Checkout - Orphan Neuroot Master ~ 10 GIT Commit- M 'CalE Industry' git Cherry-pick Master ~ 10 Ma...

webforms - ASP.NET CodeFile, CodeBehind and Inherits -

My confusion is not new here or standing on the web, however, I have some questions for which I have no answer anywhere Not found: The first question is: Why is codefile required and not on CodeBhind? I read: and some more pages, and I understand that the codefile is for source code and for the compilation of the fly, while the second one is for the assembly, it raised another question to me Is: Why everybody says that I find File.aspx.cs everywhere with a test project and it works like a magic, so should CodeBehind be an assembly? Is this a compiled assembly? But, on the basis of the first question, and the URL I provided, I can understand why the inheritance is needed. I think the compiler should know what is the name of the partial square to compile later. Makes sense. However, should not it be necessary even on codebehind? If we are going to merge partial classes, then I think I should give the name of the one I want to merge. I also tried to add another partial c...

AngularJS animation timing issue -

I am creating an application with several slides, and I'm using angular JS to toggle sections on elements Trigger experiment using CSS Animation The problem I am experiencing is that when a button is clicked, angle triggers a function on the controller, which determines the class of element updating the property of $ scope Is the beginning to start animation The subject is being updated before the element is old, the orbit is removed, and the new class is assigned, so the element always moves in only one direction. What do I have to do, when the forward () function is called from slide 1, to slide from slide 2 to right to left, which does it correctly, but when back- The function is called by clicking, the back button on slide 2, slide 2 should slide to the right What is actually happening when the back-tone () function is called, then Slide 2 Slides on the left Any help is appreciated I'm very new to angular, so I'm trying to figure out what I should do to update t...

ios - how to get the count of the NSArray inside of another NSArray? -

मेरे पास एक NSArray वाला एकाधिक NSArray s है लेकिन मुझे गिनती या एक विशेष सरणी का आकार प्राप्त करने की आवश्यकता है, लेकिन मैं समझ नहीं सकता कि यह कैसे करना है। मैं कंसोल में कोशिश करता हूं: p [_mainArray [0] count] // त्रुटि: कोई ज्ञात विधि '-काउंट'; संदेश को विधि के वापसी प्रकार में भेज दें मुझे वाकई सराहना होगी अगर कोई जानता है कि मैं सरणी के अंदर सरणी की गिनती कैसे प्राप्त करूं। त्रुटि के संकेत के अनुसार, आपको उस ऑब्जेक्ट को डालने की आवश्यकता है जिसे आप सरणी से प्राप्त करते हैं: पी [(NSArray *) _ मुख्य अर्रे [0] गिनती]

php - Mysqli prepared statement unwanted results -

Can anyone tell me why it works every time? Include ('../globals/mysqli_connect.php'); $ Insert_channel = new mysqli ($ DB_HOST, $ DB_USER, $ DB_PASS, $ DB_NAME); If (mysqli_connect_errno ()) {printf ("Connect failed:% s \ n", mysqli_connect_error ()); Go out(); } $ Insert_channel_query = "UPDATE tv_channels SET channel_name = '$ _ POST [channel_name]', variant_1_source = '$ _ POST [variant_1_source]', variant_2_source = '$ _ POST [variant_2_source]', variant_3_source = '$ _ POST [variant_3_source] ', Variant_4_source =' $ _POST [variant_4_source] 'WHERE id =? "; If ($ stmt_insert_channel = $ insert_channel- & gt; create ($ insert_channel_query)) {$ stmt_insert_channel- & gt; Dam_prim ("s", $ _ GET ['editchannelID']); $ Stmt_insert_channel- & gt; Executed (); $ Stmt_insert_channel- & gt; near (); } $ Insert_channel- & gt; Close (); Header ("refresh: 1; url = tv_online.p...

javascript - Select image by default on page load -

I have a JSON feed and I have the values ​​to populate a selection menu with product size, color / thumbnail Extract and submit the value in an object. What I want, is to select an image by default, if its title matches the value of a declared variable and has been started at the top (like var initialColour = "wheat"; ). So if the initial color is "brown", the image titled "brown" should be selected by default and should reflect the size selection in the dropdown menu. This is what I am trying to: if (main img.reiter ('title') == initial collar) {$ (this) .addClass (" Active "); } This is on the 27th line on the jsfiddle link below. I appreciate any indication of the structure, I know its a mess. What do you want to do? I have changed some code in two places, I have left an original reference there. Actually, I have fixed the image directly to mainImg . Then use that, even when adding the class, besides, you mi...

vb.net avoid listview duplicate -

My LvList is the code to clone my LvPrint My problem is to avoid duplicate or to prevent duplicate help Dim Lively, Lavi 2 View as the new list if lv list. Selected items. Mount & gt; For 0 then I list the lv as integer = 0. Selected Items. Number - 1 lvi = lv list Select item (i) lvi2 = CType (lvi.Clone, ListViewItem) lvPrint.Items.Add (lvi2) Next End if "post-text" itemprop = "text"> Check it below, additional added if position lvprint dim lvi, lvi2 new list view form to check the already selected string In the dim list string = "" String = "Dim Printslist" as J = integer = 0 to lvPrint.Items.Count- 1 printlist = printlist & amp; ; "" & Amp; LvPrint.Items (j). Next Next if lvList.SelectedItems.Count & gt; For 0 then I call the lv as integer = 0. Selected Items. Number - 1 lvi = lv list The selected item (i) if the list is not listed.Configuration (lvi.Text) and not printlist.Contains (lvi.Text) then ...

javascript - Fire different events on multiple elements with Hammer.js -

I try three days to do simple drag events on two different pictures at the same time. Searched but I get old examples that are not working today. I have been successful in dragging all the pictures and implementing pinch of events, but when I try to select two different photographs, Hummer JS thinks that I first chose I want to pin the picture. I hammer js How can I say that I want different events on many elements? EDIT: New code, what is your opinion? So, I've changed a lot of things, I think that ^^ now app correctly. JS looks like this: / * Now look at the main container, and wait something with the element / function pictureMod (container, element) {Var Container = document.getElementById (Container) ; Var Hermarium = new hammer (container, {drag_max_touch: 0, stop_default: true, level_rrossed: 0,}); Hammertime.on ("drag dragend transform", function (ev) {var touchs = ev.gesture.touches; ev.gesture.preventDefault (); var posX = 0, posY = 0, width = ...

c# - How to execute an ActionResult using devexpress ribbon button? -

In my opinion, I have a devxpress ribbon with a ribbon like this: @ Html.DevExpress () Ribbon (settings = & gt; {settings.ShowFileTab = false; settings .name = "ribbon" var tab = settings.Add tabs ("options"); var workgroups = tab.groups. ("Range"); tasksGroup Items.Add (MVCxRibbonItemType.DateEditItem, s => {s.Name = "inicialDate"; s.Text = "Data Initial";}); tasksGroup.Items.Add (MVCxRibbonItemType.DateEditItem, s = & gt; {S.Name = "finalDate"; s.Text = "data last";}); tasksGroup.Items.Add (MVCxRibbonItemType.ButtonItem, b = & gt; {b.Text = "Send", B. Item Style. Backcollar = system; drawing; collar oranger;});}). GetHtml () I can not understand how to execute a post in some posts to pass both dates in the form of parameters. Some controls in MVC developers are actually incompatible documents. Can anyone help me with it? According to this, DevExpress support is recommended to use ...

Perl - Prevent duplicate by checking if pattern already exist in opened file before writing -

I have a Perl script that manages to convert a specific file format to a CSV file that I later manage I can do I need this script to be able to prevent duplicated lines from being generated: #get timetamp if ( (Rindex $ l, "ZZZZ,") & gt; - 1) {(my $ T1, my $ T2, my $ timestampmp1, my $ timestampm2) = partition (",", $ l); $ Timestamp = $ timestampp "". $ Timestamp1; } If (((($ ($ ($ ($ ($ ($, $ '', 'top' ''>> gt; -1) and (length ($ timestamp)>)) ((My @ top) = Split (",", $ l) ; My $ aecrire = $ serialnumber. $. $ HostnameT. "" $ Timestamp. "" $ Virtual_cpus. "". $ Logical_cpus. "" $ Smt_threads. "$. $ Top [1]; My $ i = 3; ############################################## ########################### While ($ i & lt; = $ # above) {$ aecrire = $ aecrire., '$ Head [$ I]. $ I = $ i + 1;} Print (FIC 2 $ AECER. "\ N");} My source file is FIC1 a...

java - Conflict in toString default and Overriden toString -

If I override with the actual implementation of the string, then it gives different results compared to the string implementation than the default. Please Help me understand why there are different results. @ Override public string toString () {return get get callclass (). GetName () + "@" + Integer.toHexString (hashCode ()); } Output for: leo.test.Teste@addbf1 Output for default: leo.test.Teste@19821f Full code: public class test {public static zero main (string array []) {test T = new test (); Println (t); } @override public string toasting () {getClass (). GetName () + "@" + integer. Hoststress (hashkotted ()); }} I think your problem is the default implementation of hashCode ( ) , this Therefore, if you do two tests (one with an override method, without one), you can get different results. If you try it in this way: public class teststorage {public static zero major (string [] algs) {teststorming TTS = new teststoest ()...

Notepad++ cannot open deep nested files from the FTP -

I am using nppFTP to connect to my development server. I can only open those files which are 3-4 levels deep I could be because the name of the base directory is actually long (like e778de749db7d41c5666a8ee2895475ea), and the full path name for Notepad ++ is too long. Reaction to the comments section based on "text"> , I would recommend that you switch to a GIFT FTP deployment workflow. I use such a workflow and I like it. To save it, you have to use one of the many tools available for it, to name a few: (bash) (python) (php) All of this allow you to configure your FTP details and deploy on a GIT version comparisons. Pick one you like Disclaimer: I've created PHPloy.

javascript - What datatype to store in for PhoneGap app? -

I am currently developing an application that includes specific information for different geographical locations. I with phonegap I'm using an ionic framework. I currently have all the information for each region stored in JSON files, information is obtained from each page call and the user is dynamically placed to read. I chose Jason files because they are not difficult to manage and I need to allow users to download areas for offline use. Is JSON a good way to store this kind of data? I've heard of database storage on the ship, but not sure about any documentation or advantages / disadvantages of using such memory. Any advice would be appreciated! There are several ways to store data using Ionic / Cordova I though you have the way of JSN Will work, but you can run memory / scalability problems later on. 1) Built in support for eonic - 2) Portable version of the Patcha-Apache couch database is the best thing to do, in a remote database. Back and backward lets...

Objective C Memory Management with ARC -

इस सवाल का पहले से ही एक उत्तर है: 5 जवाब मैं उद्देश्य के लिए नया हूँ सी और मैं एआरसी को एक पुरानी (गैर एआरसी) ढांचे के भागों को पोर्टिंग कर रहा हूं I मेरा प्रश्न यह है कि, एआरसी अब परिदृश्यों के पीछे बहुत सारी मेमोरी प्रबंधन को संभालता है, क्या कोई भी प्रमुख मेमोरी प्रबंधन सिद्धांत हैं जिन्हें मुझे अभी भी लीक से बचने के बारे में पता होना चाहिए? उदाहरण के लिए मैंने सोचा कि मैंने कहीं पढ़ा है कि एनएसओपरेशन उपवर्ग के 'मुख्य' समारोह में, प्रोग्रामर को उस फ़ंक्शन के लिए एक 'ऑटोर होलपूल' सेट करना चाहिए। संभवत: दो सबसे बड़ी समस्याएं देखने के लिए हैं 1) चक्र को बनाए रखने, जहां एक्स को बरकरार रखता है और वाई x बरकरार रखता है, इसलिए वे कभी भी मुक्त नहीं होते हैं। यह आमतौर पर ब्लॉक के साथ होता है और 2) कोर फाउंडेशन फ़ंक्शंस (कोर ग्राफ़िक्स इत्यादि) का उपयोग करते समय, उदाहरण के लिए: CGImageCreate , CGImageRetain , CGImageRelease । उन मामलों में आपको अभी भी मेमोरी को मैन्युअल रूप से प्रबंधित करने की आवश्यकता होती है। चक्र बनाए रखने से रोकने के लिए एक सामान्य पै...

how to open emacs via OSX terminal -

इस सवाल का पहले से ही एक उत्तर है: 10 उत्तर 5 जवाब आप कैसे OSX के लिए emacs खोलें? मैंने अपने अनुप्रयोगों में इसे डाउनलोड किया है, लेकिन मुझे नहीं पता कि इसे मेरे टर्मिनल के माध्यम से कैसे खोलें (इसे "emacs test.cpp" कहते हैं) .. मैंने कुछ साइट्स की जांच की, लेकिन उनका समाधान मेरे लिए काम नहीं है। मेरे पास यह .bashrc (या .zshrc) फ़ाइल में है। alias emacs = "open -a emacs.app"

dart - How to inject services into RouteInitializerFn (new routing DSL) -

I'm switching my app to the new routing DSL. Specifically, I want to do something like this with preEnter : last RouteInitializerFn routes = (router router, ViewFactory views) {views.configure ({'chat': ngRoute (Path: '/ chat', // authService.requireState returns a future & lt; bool;, and can call an HttpRequest preEnter: (RoutePreEnterEvent E) => e.allowEnter (authService .requireState (LOGGED_IN), views: views / chat.html '),' Login to ': ngRoute (path:', defaultRoute: true, view: of Ideas / login.html ')}); } will be configured in this module: value (RouteInitializerFn, routes); If you've missed it, then I'm referring to an inclaimable authService inside RouteInitializerFn . This is not possible because routerinilizerphone is a function and there is no class, so anything can not be injected if I explain the routes function within a square , Then I'm not sure how I can configure RouteInitializerFn , so...

javascript - How to print dynamic contents of array at different positions in HTML5 -

I have to get data from the PHP web service in an array and then it must be displayed on the HTML page using Javascript. I have used a for loop to do this but it does not provide proper output. Output is replaced with innerHTML . Please help with your suggestions here is my code: function jsondata (data) {warning ("JasonData") ; Var parsedata = JSON.parse (JSON.stringify (data)); Var main_category = parsedata ["main category"]; {Menu = JSON.stringify (main illustration [i]) for (var i = 0; i & lt; = main_category.length; i ++); Menu_id [i] = Menu ['MacTit']; Menu_title [i] = Menu ['MacTuttle']; Menu_img [i] = Menu ['Mactize']; Pop_array.push (menu_id [i], menu_title [i], menu_image [i]); // warning (pop_array); (Var i = 0; i & lt; main_category.length; i ++) {Warning ("for start"); Var range = document.createElement ("li"); Document.getElementById ("MyList") appendChild (Category). //document.ge...

C char not matching \n with return key -

I'm running a program to read in a string in C. I have a strange problem in storing the string. My code is: Zero matching (four * text) {char a, * p; Int b = 1; P = text; Scanf ("% c", & amp; a;); If (a == '\ n') {* p = '\ 0'; Return; } While (a! = '\ N') {* (p + b-1) = a; P = reel (p, size (four) * (b + 1)); B ++; Scanf ("% c", & amp; a;); } * (P + B) = '\ 0'; } So it reads correctly in letters, but when it reaches the end of the string, then it does nothing, but instead of keeping the loop current. If I print a as the last command in the loop, when it reaches the end of the string, it prints the blank space, but the program does not leave the loop. "post-text" itemprop = "text"> You can use getchar () function Instead of scanf () . Unless the user accepts the string ENTER . Please see () function getting zero (four * text) {int a; Four * p; Int b = 1; P = text; A = getchar...

java - Android Display result in Hindi -

A message in my Android application is displayed in the text view and the message is taken from the server. Font in Hindi .. English language is being displayed correctly and when I try to add Hindi text ... ... ????? 'Displaying instead of text .. I tried .. This code .. also .. txt4 = (TextView) findViewById (R.id. TextView8); Typeface face = typeface.svg (getAssets (), "fonts / hindi.ttf"); Txt4.setTypeface (face); Check details in the server, sometimes there may be problems due to special characters If you copy the text and paste it from anywhere, then this problem may occur. You can correct this situation by editing special characters and typing inside the table.

emacs - Remap Ctrl, Alt & Super keys in Ubuntu 13.10 -

I am trying to repaint the last line of my keyboard to mimic the hack hacking keyboard layout. I created a .xmodmap file with key code changes. Below are just the rows that have been changed manually in Xmodmap file; xmodmap -pke & gt; ~ / .xmodmap . Keycode 37 = Super_L NoSymbol Super_L Keycode 64 = Control_L NoSymbol Control_L Keycode 105 = Super_R NoSymbol Super_R Keycode 108 = Control_R NoSymbol Control_R Keycode 133 = Alt_L Meta_L Alt_L Meta_L Keycode 134 = Alt_R Meta_R Alt_R Meta_R loaded using the above change xmodmap ~ / .xmodmap Ctrl , super key: Alt Kbd> and Ctrl key: super . However, when I run emacs, it is still the alt key: Alt , super key: Super & amp; Ctrl key: Ctrl . Super + T . These applications still reflect default keyboard layout, not in my $ HOME / .xmodmap file according to new configuration. Change the xmodmap ~ / .xmodmap to the $ HOME / .xinitrc file so that the changes are persistent throughout the ...

In the Android full screen activity template, why does the empty style change the look of the button? -

Image
This button is set in the XML layout of the activity such as: & Lt; Button android: id = "@ + id / dummy_button" style = "? ButtonBarButtonStyle" Android: layout_width = "0dp" Android: layout_height = "wrap_content" Android: layout_weight = "1" android: text = "@ string / dummy_button" / & Gt; The focus part is the style = "button button button style" . Definitions for the style of the query are defined in styles.xml: & lt; Style name = "ButtonBarButton" /> The genre does not really set a value for the button and so I do not understand how I have about the button and the way it displays it. I will change anything. > When the button is set to use an empty style, it looks like: A button at all (as I was expecting a free style). Does anyone work properly, why is this empty style changing? You can create a new app using "fullscreen activity" to repeat it you...

What is the advantage of core.async in clojurescript? -

Everyone is talking about the great core. What is ASINC, and how to handle event handling in closerscript makes. I'm following the tutorial, and I do not get any clear advantage from these code examples. (defn [el type] (let [out] (chain)] (events / listen el type (fn [e] (put! E))))) () "search 1 ")" click ") (Go (while correct (dosomethingasync (& lt;! Clicks)))) versus ( Good question! I think your first step will be to understand the benefit and my Below Try: I think that if we change our code slightly then the difference will be clear. First of all, try to highlight the sentence "all There is a time in good programs when components or subsystems stop contacting each other directly. "I think we can separate the input event channel from let fn: (def click (dome / getElement" Search1 ")" click ")) (go true (with dosomethingasync , with core.async, we can write asynchronous calls, such as...

osx - Using productbuild for mac os x app with additional tools and files -

The packagemaker I used the script using the packagemaker for my project allows to specify all files I need to install from the root, so the structure was followed in my root: Applications My Application.app Library Preferences MyCompanyName some.xml another.xml tmp default.p12 usr Local bin somool i.e. its following attribute Some configuration files predefined for all users, Global Preferences (some .xml, other xml) Some command line tools / Usr / local / bin Uses the main app certificate as a user in the program and there is a default certificate that will be moved to the right place in the postflights. How do productbild Along with that? possible? You want the original tool that packaging is pkgbuild, not productive. Pkgbuild will allow you to specify a root directory, which will be expanded to '/' on the installation, therefore, you can use it for all those that you discuss in your question (although by adding something to the installer / tmp a bit...

dynamic - Parallel Lifelines in Sequence Diagrams in Enterprise Architect -

Image
I am using Enterprise Architect to create a sequence diagram. There are some institutions in the sequence diagram that actually run in parallel because there are many core and hardware peripherals running in parallel. When I try to attract sequence diagrams of organizations running in parallel, then the program automatically takes messages and calls from other units down because it thinks they move after each other. I mean to run them at the same time. How can I allow enterprise architects to attract parallel sequences without transferring other events down? In advance, you can see how to repeat sequence diagram (parallel parallel execution execution two) or more) lifenines interact each life line in different parts The joint can be declared.

python - How can I realize get_search_results function in Django 1.5 -

ModelAdmin.get_search_results (अनुरोध, क्वेरी, खोज_टार्म) Django 1.6 में नया। वर्ग PersonAdmin (admin.ModelAdmin): list_display = ('नाम से कैसे करें) डीजेंगो 1.5 के साथ संगत होना कुछ कारणों के लिए Search_fields = ('name',) def get_search_results (self, request, queryset, search_term): # search_term वह है जो आप व्यवस्थापक साइट में इनपुट है, क्वेरीसेट खोज परिणाम क्वेरीज़ है, use_distinct = super (PersonAdmin, self) .get_search_results (request, queryset, search_term) कोशिश: search_term_as_int = int (search_term) queryset | = self.model.objects.filter (उम्र = search_term_as_int) को छोड़कर: पास रिटर्न क्वेरीस, use_distinct आप कोशिश कर सकते हैं या आप यह कोशिश कर सकते हैं

ember.js - How to call multiple methods in Route model function -

I have a template named index. In this index path I am already sending a model. For example: Think of it as a condition, comments I have data related to status in the index template. If I want to present the comments for that situation, I need another template. If I have another template I should define a route Instead of related data in my components. Now, I am calling this component in my index template. Like & lt; Script type = "text / x-handlebars" & gt; {{Status-comments}} & lt; / Script & gt; Here, I can not be able to present the comments data. Because already there is a model function related to the index root stase. So I was not able to set the comment model in the same index route? Which version of amber-data are you using? If you are using the latest version of Amber-data then you have the link of the URI location and you will get the app amplifier data when you request it in the template, or elsewhere. Find the amber-...

node.js - Connecting to a database in monogolab via mongojs -

I have a node server and so far my database was local, but now I need to keep it on mongolab. Can you tell me how to connect to the database, please? Use go to db = mongojs ('mongodb) : // USERNAME: PASSWORD @ ds043497 .mongolab.com: 43497 / heroku_app14986764 ', [' collectionname ']); And you will connect. I did not test it.

PHP descending an array stored from foreach loop values -

मेरे पास ऐसा foreach पाश है $ id = array (); विदेशी मुद्रा ($ आईडी के रूप में $ idv) {$ आईडी [$ idv- & gt; आईडी] [] = $ idv- & gt; मान; } और मुझे इस तरह एक सरणी मिलती है सरणी ([21] = & gt; 10 [13] = & gt; 16 [12] = & gt; ; 20 [7] = & gt; 28) अब मैं सरणी कुंजी या आईडी को प्रभावी किए बिना केवल इस सरणी () मानों को निम्नतम से उच्चतम तक कैसे उतरूं? इस तरह दिखाना सरणी ([21] = & gt; 28 [13] = & gt; 20 [12] = & gt; 16 [7] = & gt; 10); सरणी में ऐसे 100 ऐसे आईडी और मूल्य हो सकते हैं, जिससे मूल रूप से मानों की संख्या घटती है? चूंकि आप चाबियाँ संरक्षित करना चाहते हैं, इसलिए उन्हें अपने कोड (सरगर्मी आदेश) का उपयोग करके array_keys अब rsort का उपयोग करके एक अलग सरणी में स्थानांतरित करें धार की चाबियाँ और अवरोही क्रमबद्ध मानों को लिंक करने के लिए array_combine का & lt;? Php $ arr = Array (21 = & gt; 10, 13 = & gt; 16, 12 = & gt; 20, 7 = & gt; 28); $ K_arr = array_keys ($ आगमन); rsort ($ आगमन); $ New_arr = a...

android - YoutubePlayerView VS Iframe -

My goal is to play YouTube videos in Android phones> 2.3 In an iframe And the other is the YouTube player Weave. Objective: Do not have any ads or play a video with suggested video Remove the settings button from the control view Maximum performance Now except for the last point, I can not be able to use any of them native Android yotubeView. So please suggest that should IFRAME go for Android implementation ??

javascript - PhoneGap + jQuery Mobile Annoying Blink Between Transitions -

I hope you are okay. So, the thing is, I have a phonegapp app using JQuery Mobile. The jQuery version of jQuery is: jquery.mobile-1.4.0. I am using many ways to transition between scenes within the same file, not on individual HTML files, such as: & lt ; Div data-role = "page" id = "preload" & gt; & Lt; Div data-role = "page" id = "noConnection" & gt; & Lt; Div data-role = "page" id = "intro" & gt; ... and so on The current viewport meta tag is: & lt; Meta name = "viewport" content = "user-scalable = no initial level = 1, maximum-level = 1, minimum-level = 1, goal densitydpi = device-dpi" / & gt; So far, I have not been able to remove that nap between the infection. about how to change the ideas, I have tried many methods, but all of them get the same blink: $. Mobile.changePage ("#Rules and Message", {Infection: "Slide", Rever...

Ion Auth (Codeigniter) - How to use different database -

Is it possible to use different databases to authenticate the user through Ion Aith? I want to create a dedicated database only for user authentication, therefore, this transaction should be different from the database How to do this? Thank you. In short ... yes It is possible to use a different database for your authentication. In addition to config, you will need to create a second database configuration in your application / config / database.php file. $ dB ['default'] ['hostname'] = "localhost"; $ Db ['default'] ['username'] = "root"; $ Db ['default'] ['password'] = ""; $ Db ['default'] ['database'] = "db_name"; $ Db ['default'] ['dbdriver'] = "MySQL"; $ Db ['authentication'] ['hostname'] = "localhost"; $ Db ['Authentication'] ['username'] = "root"; $ Db ['authentication'] ['...

python - Passing selenium commands inside a list -

I have a list that contains selenium commands like browser = WebDriver Firefox () lis = ['browser.find_element_by_id ("gbqfba"). Click () ',' browser.find_element_by_id ("signup_btn_toppanel"). Try to send () '] as the command, i for lis: driver.i Since I have a string here, the dragon is not accepting any solution for it ?? You can use commands to run the wire as dragon commands: I LIK: exec 'driver.' + I should do the trick.

Right to Left (Hebrew) support in IntelliJ Community Edition -

Is there a simple way to write left or right in a plugin or community community version? Maybe a hacker using a developer? I am writing a Hebrew Android application and it is very hard to write resource files. The steps for this have apparently been made for Idea 15, currently (August 2015) in early reach. Look at this comment: You have to add line editor.new.rendering = true to work your idea.properties file. / P> I have just tested, and it works very well, but this is an initial approach

select2 default value for single field -

I'm using for my project when the page loads, I want to have a default value in an input field . I tried to set it to initSelection , while I'm starting select2 component like this. $ (document) .ready (function () {allowClear: true, ajax: {// instead we use functional assistant data of selection 2 to write the function to write the function For: 'json', url: "public / data.php", data: function (word, page) {return {q: word, /. ("# City") .val (), child_value: ""} }}, "Map", all_selected: $ ("#map-all") halcus ("active"), original_man: result: work (data, page) {// parsing in the expected format by selection 2. // when We are using custom formatting function, we Remote JSON data returns are not required to change (result: data);}}, initSelection: function (element, callback) {return $ .getJSON ("public / data.php? Q =" + element.val () + "& Amp; component = map & amp; all_selected...

c - Generating all permutations of pairs excluding permutations of individual elements -

I would like to generate all the permutations of sequential combinations (a, b) where a! = B, and a, b are the elements of S (let S: = {1..k}), but excluding the variation of the individual elements of S. For example, setting k = 2, (1, 2), (2, 1) , 1), (1, 2) But in reality, {1-> 2, 2-> 1} are duplicated under permutation mapping. For k = 3, there are 6 possible orders added, 6 will be given! Sequence (with duplicates) but with 3! = Possible permutations, the desired number of unique scenes 5! , And sequences starting with only pair (1, 2) are easily generated. In the general case, give * (k-1) pairs, [k * (k-1)]! Sequence (with duplicates), and K will be! Permutations, so I should end with [k * (k-1)]! / Kashmir! Sequence I intend to use only the small values ​​of K, but I am thinking that there are some good ways to create these scenes. I am doing a lot of things. It is a specific sort of filtering of specific sequences. The matter is (allowing duplicate element...

android - Swapping list of fragments inside FragmentStatePagerAdapter -

I'm having trouble swapping the list of pieces inside my FragmentStatePager adapter, and wondering if there are any ideas The main activity includes three tabs (restaurants, reviews, favorites), each has a piece with a list of restaurants Users can make a different Swipe between each tab to see the list The main activity There is a button in the layout when the user presses the button so it will swap with a list of all existing pieces. I currently have a new list of pieces with restaurant location map (Google Maps) to view the swipe tab and pager that works with the action bar. There will be three pieces. I have some success in excluding pieces of the map with pieces of the map, but the following problem occurs: When I press the button on the main page, first (the restaurant ) Tab becomes empty. When I swipe on the next tab (review), the tab is populated with a piece of map When I want to hit the third tab (favorites) The tab is empty My setting is the fol...

Searching for multi keywords in multi fields using LUCENE library -

I want to search keyword2 in keyword1 and 2 in field 1. Actually this code works but it gives me the result of field 1 and in field 2 one of them contains keywords: Standard Analyst Analyzer = New Standard Analyzer (version LUCENE_46 , StopWordsSet); String [] field = {"field 1", "field2"}; Float float 10 = new float (10); Float float 5 = new float (5); Maps & lt; String, float & gt; Boost = new hashmop & lt; String, float & gt; (); Boost.put ("nom", float10); Boost.put ("email", float 10); Multifield skitter mfqp = new multifield screen (version LUCENE_46, field, analyzer, boost); Mfqp.setAllowLeadingWildcard (right); Query UserNet = mfqp.parse ("* keyword *"); Your question seems to be searching for documents that contain 'keyword' both field 1 and field 2, if this is correct, then the following help may be found. Note that if the default operator or order is required, then those signals are kept...

linux - How to save output of "watch" to file -

I want to run one command every 60 seconds and save the output in a logfile. I know that I clock -n 60 & lt; Mycommand & gt; But if I want to save it to the file then I will also print for the console? View is designed to run in the console window. If you are not having any 60 hour problem, you can try without it: code> while & lt ; Some condition & gt; & Lt; Mycommand & gt; 2 & gt; And 1. Tee -a / path / to / logfile sleep 60 done This saves output in a log file and shows it on the console as well.

php - Connecting to MySQL database hosted on remote server -

Recently I bought a domain "domain.com". A database was created with the name "Database 1" Li> Username "user1" and password "pass1 User created with " User added" user1 "database to" database1 " So far so good. After this I clicked on PHPMyAdmin and redirected to the PHPMyAdmin webpage. There I see "database 1" which I had created earlier. To click on that database, I used the import to import a very simple table called "test" [column (id, name, surname)]. Importing the table "Test" table is "Database 1", which is correct. After that I have tried to use the code below from that database ( connect_to_db.php ): // Make connections $ Con = mysqli_connect ("domain.com", "user1", "pass1", "database1"); // Check connection if (mysqli_connect_errno ()) {echo "failed to connect to MySQL:". Mysqli_connect_error () ...

java - How does correctly find elements of a webpage with Selenium Webdriver? -

मैं फेसबुक के साथ अभ्यास करता हूं, WebDriver ड्राइवर = नया एचटीएमएलयूआईएनटीड्राइवर (); driver.get ( "http://www.facebook.com"); सफल लॉगिंग के बाद मैं संदेश भेजने का प्रयास करता हूं लेकिन मुझे संदेश क्षेत्र नहीं मिला: WebElement selectMessages = driver.findElement (By.id ("fbMessagesFlyout")); selectMessages.click (); वेब एलेमेंट तत्वमिस = ड्रायवर.फ़ीन्ड एलेमेंट (बाय.आईड ("q")); elementMess.sendKeys ( "डालिया"); elementMess.submit (); यह कोड सिर्फ हेडर पर संदेशों के साथ जावास्क्रिप्ट को तैनात करता है और फिर एफबी हेडर पर खोज अनुरोध भेजता है। मैं डायलिग पेज के लिए सही लिंक कैसे प्राप्त करूं और फिर वहां टेक्स्ट एरिया मिल सकता है? यह काम करता है !! @BeforeTest सार्वजनिक शून्य सेट अप () अपवाद फेंकता {ड्राइवर = नया FirefoxDriver (); BaseUrl = "https://www.facebook.com"; Driver.manage ()। टाइमआउट ()। परस्परविराम (5, टाइम यूनेट। एसईओएनडीएस); } @Test सार्वजनिक शून्य परीक्षणअनुरोधित () अपवाद फेंकता है {driver.get (baseUrl +...

performance - regular expression/ BeanShell post processor time will add in transaction response time -

I'm new to JMT ... will someone tell me the time of a referral expression / bean shell post processor transaction response time ? I have http requests where there is 3 regular expressions in a request and time for a beanshell post processor and I have used the transaction controller to measure the reaction time. No, regular expressions and beanshel post processors will not add transaction response time.

jQuery :selected always returns the first option -

I'm trying to create a control function to check that the expected options from at least one selection list by the user has been chosen . I have created this function which works, except that it always gives me the first option value for the element before the loop. Example: For a selection list with 1: 'Foo' and 2: 'Bar', the warning gives me 'Foo', even though I have selected 'bar' in the selection list for the first time, But this is true for next selection values. $ (document) .on ("click", "#submit", function () for {var n = 0; (var p = 0; p & lt; index; p ++) {var selectValue = $ ('# multiple_answer _' + P + '_ option: selected'). Val (); n ++; Alert ('option' + n + ':' + selectValue)}}) ; If your'e using .val () : selected var selectValue = $ ('# multiple_answer _' + + + p + '_ option') to retrieve the value of the selection Do not need to Val ()...

sql - Converting columns to rows in Oracle -

इस सवाल का पहले से ही एक उत्तर है: 2 जवाब मेरे पास दो के साथ तालिका है कॉलम first_name, last_name, एक पंक्ति के साथ जॉन गणित मुझे एक पंक्ति में जॉन और अगले पंक्ति में गणित का परिणाम चाहिए। FNAME नाम ------------- जॉन मेथव परिणाम नाम ----- जॉन मेथव संक्षेप में स्तंभों को पंक्तियों में कनवर्ट करना चाहते हैं। pivot_test UNPIVOT से चयन करें नाम (मूल में नाम (fname, lname))

checkbox - to select content controls in word doc using VBScript -

I have enabled a word document in which doctors are multiple Chekboksejh / radio buttons at different locations, according to which UserInputs (Which I plan through InputBox instead of drop down) Let me know how this program can be achieved using VBSPit, please tell me. Say I control (box 4 content word document) So, bottom lines based on userinput before a face will have to identify the content control basis Reboot_Y_N = MsgBox ( "you need to reboot (yes / no)?", VbQuestion + vbYesNo, "reboot") If Reboot_Y_N = vbYes then ObjDocImp.ContentControls.Item (1). Checked = True ObjDocImp.ContentControls.Item (3) Checked = True ObjDocImp.ContentControls.Item (5). Czech was True = ObjDocImp.ContentControls.Item (7) .Checked = True Else ObjDocImp.ContentControls.Item (2) .Checked = true ObjDocImp.ContentControls.Item (4) .Checked = true ObjDocImp.ContentControls.Item (6) .checked = true ObjDocImp.ContentControls.Item (8) .short = true end if

android - How to check if an activity is running in background/foreground from a service? -

I have created a service that starts with the creation of an activity and closes on the activity's diastore method. Now I have to check with a method of service whether the activity is going on in the foreground / background (for some cases as if the application has been forced to shut down). How can I go about doing this? I need to do this cause, as far as I know there is no guarantee of any activity on the theft method, because of the accident, my service Which starts when my activity starts, will not stop after the event of any accident or any effective closure. I have seen where the activities of the foreground can be examined but I have to check the activity running in any situation (either foreground or background). I /> Last update To check all activity: @override secured on zero attop () {super.onStop (); If (AppConstants.isAppSentToBackground (getApplicationContext ())) {what should be done only after the app is closed, close the session}} The meth...

java - Using spring @Transactional for the beans created using factory method? -

I am using spring 3. I have classes I transport. Java package com.net.core.ioc; Public Interface Transport {Public Zero doSave (); } car.zava package com.net.core.ioc; Public-class carriage transport transport {The name of string; Public car (string name) {this.name = name; } Public Zero doSave () {// Savings Argument using name}} bus. Java package com.net.core.ioc; Public Category Bus Transportation Transport {String ID; Public bus (string id) {this.id = id; } Public Zero doSave () {// Savings Argument using ID} SpringService.java package com.net.core.ioc; Public Class Service Provider {Private Static Service Service Service = New Service Provider (); // Static Factory Law Public Stable Seva Service () {Return Service; } // Method of Instant Factory: Make Public TransportationKarastain (name of string) {Return to new car (name); } Make public transportBus instance (string ID) {return new bus (ID); }}} config.xml & lt; Reference: component-scan base...

java - Get entity group count always return 0 -

After this I try to check it in my local dev environment (unit test), unfortunately unit group count is always returned Comes to 0: Datastore service DS = Datastoreservicefirefactor.getdataStoreService (); MemcacheService memcacheService = MemcacheServiceFactory.getMemcacheService (); Unit entity1 = new unit ("simple"); Key key1 = ds.put (entity1); Main Unit Group = Institutions.Content Entity Group (Key 1); // 1 should be printed, but 0 show AntitigroupCount (DS, Memkseva, Antiguakki); Unit unit 2 = new unit ("simple", key 1); Key key2 = ds.put (entity2); // 2 should be printed, but still show 0 group of Entity Group Groups (DS, MmaxService, Antiguakki); For quick reference, copied from : // A simple class square for tracking compatible unit groups EntityGroupCount tool serialZabel {long Edition; // The version of the entity group whose count we are computing the integer; EntityGroupCount (long version, int count) {this.version = version; This.count = c...

jquery - Uncaught ReferenceError: org is not defined in CometD -

I am about to setup a sample chat application using CometD and download all the necessary files from [Git] () I am doing When I try to run the application it says, " Unfair reference references: the organization is not defined " Can be through? My JS files are in the following order & lt; Script type = "text / javascript" src = "http://myserver.com/cometd/common/src/main/webapp/org/cometd/AckExtension.js"></script> & Lt; Script type = "text / javascript" src = "http://myserver.com/cometd/common/src/main/webapp/org/cometd/ReloadExtension.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "http://myserver.com/cometd/jquery/src/main/webapp/jquery/jquery-1.11.0.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "http://myserver.com/cometd/jquery/src/main/webapp/jquery/jquery.cookie.js" ...