Posts

algorithm - Graph cut with python: How to set up the graph correctly? -

Image
I want to use graph cut algorithm on images in my project, I use Python 2.7 I found, but the documentation does not seem so obvious. I'm making an example, this is my 5 * 5 matrix: gt; & Gt; An array ([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 1] 9 virtual terminal node, S (source) and T , [20, 21, 22, 23, 24]] (sync) matrix The infinite weight for all pixels of the lowest columns on the left and right should be linked to the arcs. Here's what I want to get: This is my code to get it, but it does not work left_most = concatenate ((1, ashp [0]), N.P. Ranges (ashp [0]). Reshape (1, ashp [0])). Unstable (npuit 64 ) left_most = np.ravel_multi_index (Bayan_ most, Asp) right_most = concatenate ((np. that ((1, Asp [0])) size (A, 1) - 1, NP Krenj (Asp [0]). The new size to (1, Ashaip [0])). volatile (Np.uint64) right_most = np.ravel_multi_index (right_most, A.shape) g.add_grid_tedges (Bayan_ most, Anpikons (Bayan_ most. Shaip) *...

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

When I'm trying to do a string, I get a patterninetex exception. ReplaceAll Below is my string Number of testcases: 39? Test case execution: testCreateDAta? Class has completed its performance: test.com.myspace.service.ejb.session.MyTest? Execution of test case ended: testCreateDAta? Test case execution: testUpdate? What I was trying to do: junitReportString.replaceAll ("?", "\ N"); The above code brought me an exception to: java.util.regex.PatternSyntaxException: Dangling meta character '?' After this I tried again with the code below: junitReportString.replaceAll ("\\?", "\ N"); The code above received me the same string as I mentioned above. My complete code: string junitReportString = new string (); MyApp = New URL ("http: // localhost: port / testWeb / TestJunit.jsp"); URL connection yc = myApp.openConnection (); Yc.connect (); JunitReportString = yc.getHeaderField ("finalJUNITR...

php - String Replace Date & Time -

A line of my XML looks like this: $ ob_time = $ xml- & gt; Observation_time_rfc 822; Echo $ ob_time; Output looks like this: Thursday, 09 October 2014 22:59:16 +0200 But what should I look like 2014-10-09 + 22 % 3A 59 % 3a 16 I think it can do the place of the string, someone can help me find me! Thanks! edit : use a ghost solution, it must be correctly Handles offset timezone First you need to reformat your date. You do this by parsing it with strtotime and formatting it with the date function. They are "URL instead of the funny% 3A" actually are URL-encoded characters: $ date = date ('y-m-d h: i: s', strotom ($ ob_time)); $ Date = urlencode ($ date); // 2014-10-09 + 20% 3A 59% 3A 16

data binding - Set isActive in view model then checkbox is checked -

I need a true or false set for each in the model of the view, check box is checked in the client table or Not checked. I can not apply data-bind with changes. Disabled value Typecript View Model: Class ModelViewModel {products: KnockoutObservableArray & lt; Products & gt ;; Manufacturer () {products = ko.observableArray & lt; Product [] & gt; (); }} Typuscript Model: Product of the Category {Name: Knockout Observe & lt; String & gt; IActive: Knockout Observeable & lt; Boolean & gt ;; } Constructor () {this.name = ko.observable & lt; String & gt; (); This.isActive = ko.observable & lt; Boolean & gt; (); } HTML: & lt; Table class = "table-table-range" & gt; & Lt; Tbody data-bind = "foreach: vm.products" & gt; & Lt; TR & gt; & Lt; Td> & Lt; Input type = "checkbox" id = "chekBx" data-bind = "value: active" & gt; & Lt; / Td> ...

objective c - how Set autolayout for multiple dynamic buttons and labells in iOS? -

I am creating 83 dynamic buttons in my app and setting the label for it. Now, I want to set auto layout for that. How can I set up the automatic layout for this? This is the code that I have implemented to create buttons and labels dynamically: - (void ) Dynamic Button {// Reading data from database NSMutableArray * objectName = [[NSMutableArray alloc] in this]; NSArray * docPaths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); NSString * documentDir = [docPathsObjectAttex: 0]; Self.databasePath = [documentDir stringbappingSpaceContent: @ "SMS.sqlite"]; FMDatabase * Database = [FMDatabase database path: self.databasePath]; [Database logs error: TRUE]; [Database open]; // FMResultSet * Result = [Database Execution: @ "Select from SMS Card"]; NSString * anQuery = [[NSString alloc] initWithFormat: @ "SELECT * FROM SMSCategory"]; FMResultSet * Result = [Database Execution: anQuery]; While ([result next]) {SMSCat1...

simple html dom - Issue in Passing Url in PHP -

I am doing some operations in the URL below. $ paginationPages = array (); $ ProductCount = intval ($ htmlProductPage- & gt; Search ('div.paging span.itemcount', 0) -> plain text); If ($ ProductCount / 16 & gt; 1) {$ pagecount = ceil ($ ProductCount / 16); For ($ i = 2; $ i & lt; = $ PageCount; $ i ++) {$ urlSplitArray = Explosion ('.', $ ProductUrl); $ UrlSplitCount = Count ($ urlSplitArray); $ UrlSplitArray [$ urlSplitCount-2] = "[" $ i .. "]". $ Endorsement page [] = intestine ('.', $ UrlSplitArray). "& Lt; br & gt;"; } #print_r ($ paging page); } and I'm getting all the links in the foreach to proceed foreach ($ paginationPages page $ next URL) {# $ nextUrl = " Http: //www.100percent.co.nz/kitchen-and-cooking/ovens/freestanding[2].htm "; $ HtmlProductPage = file_get_html ($ nextUrl); Foreach ($ htmlProductPage- & gt; Find ("div.Item") as $ element) {// error is here...

graphics - Conditional Background of a plot in R -

Image
I want to know how to make such a conditional background background This time this can be calculated by series or any other For example, for example, I have two series when the value of the first is positive, the background value on the second plot is green, otherwise it is red. Here's a way to do this. x

java - Creating dynamic xml tree based on the xpath value -

Image
I want to create a dynamic xml tree base on xpath. Assume that my xpath value is product / organization / registered / something and I want to put the value in the following format. pre & lt; & Lt; Organization & gt; & Lt; RegisteredDetail & gt; & Lt; Some & gt; ValueOfSomething & lt; / Some & gt; & Lt; / RegisterDetail & gt; & Lt; / Organization & gt; & Lt; Products & gt; In short I want to make a treeview / tree table by reading xpath. I want to value most children in the interior and show the place of value in the structure of a tree or just the location of the child as a tree. The value of the xpath will be different. Any suggestions for using java or jquery will be valuable to me. I tried to apply the suggestion given by @hhw I made some amendments: var dom = document.implementation.createDocument ("", "" , tap); Var node = dom; New code: var pathmap = new object (); Var Path...

incron - Sub directory not getting copied to remote server using Rsync Linux -

The I tried to copy the directories and files in a remote Linux machine using Risinik and Inkrantab. This copy is working properly files on the remote server Incrontab / data / AMOS_SHARE / CHV_BE / IN_MODIFY, IN_CREATE, IN_DELETE, IN_CLOSE_WRITE, IN_MOVE / data / AMOS / jboss / chv_rsync.sh Rsync #! / Bin / bash chmod-R 775 / data / AMOS_SHARE / CHV_BE rsync -avuzh / data / AMOS_SHARE / CHV_BE / jboss@xx.xx.xx.xx: / data / AMOS_SHARE / CHV_BE / I have made in / data some files / AMOS_SHARE / CHV_BE / folder it worked fine and I made this folder, it's working fine. But whenever I create files in a sub folder, it does not work. Please help me. incrond recursively monitoring has not been implemented yet, so do not monitor sub-directory of events Is performed. You can do this by adding additional information to sub-directories, but I have recommended to use any other device: In addition to this you can use the ionotifywait tool (example) inotify...

javascript - Dropzone: prevent uploading of duplicate files -

I am using DropZone I would like to stop uploading a file which is already in the form of thumbnails in Dropzone "panel" With the upload in present I mean that do not allow the file to be shown twice with the same name in the panel. I do not care about the case of this file which is already present in the server and is not visible in the panel because it will be replaced with the new one with the same name. I do not want to receive this despite my efforts. I appreciate your help. Thank you very much Try it, I had a similar problem recently was. I am done with the help of this

php - how to convert mysql query to zend query? -

I want to change the following sql query to zend the query. How can I convert this mysql query to the flag query with the Flag Framework 2? binary username = "testUser"; thanks Have you tried this: Select $ => - (Where 'username' = & gt; new \ zend \ db \ Sql \ expression ("testUser ')" );

java - what this integer value means? -

The entire program I found on one of the Android Tutorials site shows the bouncing ball with a custom view. I could not understand this line. Private int xVelocity = 30; Xviolocity = xavilocity * -1; What does this mean? If I change dramatically, I delete it * as compared to the animation and the other thing is that invalid () the method of the visual class repaint () java ??? Is similar to ??? Any help would be appericiated. multiplication. xVelocity * - 1 by xVelocity by -1 . xVelocity-1 decrease 1 to xVelocity . And the other thing which is invalid () method is similar to repaint () Yes, invalid () / Code> views the scene as dirty and therefore schedules a redraw.

php - Select option not passing values -

My selection options are not passing I do not know why this is not working, it will be appreciated, but I do not know what's going on. HTML / PHP if (isset $ _POST ['submit'])) {$ name = release ($ _ POST ['name'])? Trim ($ _ POST ['name']): ''; date gt; & lt; l & gt; LHA & lt; / th & gt; & lt; th & gt; ax & lt; / th & gt; & lt; Lt; th & gt; ls gt; update & lt; / th> & lt; / tr & gt;;; $ Sql ​​= "SELECT * data from where name = '$ name' date from date"; "; $ Sth = $ pdo- & gt; Query ($ sql); While ($ line = $ sth-> fetch ()) {$ car = $ line ['car']; Echo "& lt; form action = '' method = 'post' & gt;"; Echo "& lt; tr & gt;"; Echo "& lt; td & gt;" . $ Line ['name'] "& Lt; / td & gt;"; Echo "& lt; td & gt; & lt; input type = 'text...

I get into another user session when logging in openam -

We have deployed an OpenM V10 cluster with two nodes, and sometimes many more SP have been configured. When a user logs into the system, then the system validates its credentials and the user initiates the session, but sometimes the session starts with "cross" from the other user, which is already logged into the system. . After that, when the user tries to access any registered SP, an error is displayed and it is forced to log on again. Therefore, in fact, this is not really a security problem, but it is not quite calm. We do not really know whether the problem is in OpenM or load-balancer. Any ideas are welcome. does not use OpenM HTTP sessions, but it is itself a session ID which is cryptographic safe, It is therefore not very likely that an SSO session ID conflict occurs. It is not clear what exactly "to cross the session" means ... a session in you app? Then this is an application issue, there is not an OpenM problem. This will never be the LB ...

Adding row AngularJS -

फ़ंक्शन: कोणीय। मॉड्यूल ('formTerm', [] )। नियंत्रक ('मुख्य नियंत्रक', ['$ scope', फ़ंक्शन ($ दायरा) {$ scope.rows = [{स्पष्टीकरण: '', उदाहरण: ''}}; $ scope.counter = 5; $ scope.addRow = समारोह () {$ scope.rows.push ({स्पष्टीकरण: '', उदाहरण: ''}); $ scope.counter ++;} एचटीएमएल: & lt; span class =" बीटीएन बीटीएन-प्राथमिक "एनजी-क्लिक =" एडरव () "& gt; जोड़ें & lt; / span & gt; & lt; div class =" टेम्पलेट शब्द-पंक्ति "एनजी-दोहराने =" पंक्तियों में पंक्तियां "& gt; div वर्ग =" col-md-4 "& gt; textarea class =" form-control "पंक्तियाँ =" 2 "id =" explanation " प्लेसहोल्डर = "स्पष्टीकरण" नाम = "स्पष्टीकरण" एनजी-मॉडल = "formData.rows.explanation" & gt; & lt; / पाठ क्षेत्र & gt; & Lt; / div & gt; & Lt; div वर्ग = "col-md-4" & gt; & Lt; tex...

javascript - geolocation working on web browser but not on android phone browser -

I have a button with a button, when an alert with the clicked latitude and longitude shows it on Chrome on my laptop. Works, but when I try with my Android mobile, the page is showing, but there is no warning. I have tried to change the meeting in the current situation, but there is no change. In an attempt to resolve this, I have placed a warning checkpoint and I have found that the function success () is being called in a laptop browser, but not the browser in the Android, the function error () is also not being called Please help please. & lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Geolocation & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body onload = "getLocation ();" & Gt; & Lt; Input type = "button" id = "btn search" value = "search" onclick = "btn_Click ();" /> & Lt; Script & gt; Var Paus; Function btn_Click () {warning ("warning"); // Alert (...

How to store Abbreviation name in database sql server Through c# programming -

I have a web form, in this web form I have a text box and a button if I click on a data in the text box Add as "Andhra Pradesh" , then when I click on the button, it stores "AP" in the database Any one can help me write in C # so it's like to have code. If I enter Andhra Pradesh then store it in the database AP If I enter Madhya Pradesh, then store MP in this database. If I enter West Bengal then this database is stored in West Bengal. If statename = "Andhra Pradesh" then statename = "AP" and if It will come back only to the first 2 characters in the uppercase. string test = "Andrpra dais"; String abbreviated = new string (test.Where (t = & gt; char.IsUpper (t)). Take (2) .ToArray ()); Console.WriteLine (abridged); Though I'm thinking that your rules should consider the possibility of two or more results with the same short wire

c - Porting callback function from 32 bit to 64 bit -

I am using Visual Studio 2008 Professional when I compile it using Win32 Build, it's OK. But when I switch to x64 I get this compilation error: Error C2664: 'lineInitializeExA': can not be changed from parameter 3 to 'zero' The goal of 'LINECALLBACK' from (__cdecl *) (DeWords, Dedworlds, Dedworlds, Dedworlds, Dedworlds, DWORD) 'targets any of these types of work does not match the target type. Some are defined / typed: typedef unsigned Bay DWORD; #define callback __stdcall and the LINECALLBACK in tapi.h is defined as: typedef zero (callback * LINECALLBACK) (DWORD hDevice, DWORD DwMessage, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2, DWORD_PTR dwParam3); Signing on Windows is 32 bit wide on 32 and 64 bit platforms long. So definitely this is not a problem. Any ideas why? And how to decide? Here is the code. #include & lt; Tapi.h & gt; // Include Windows Tally API # & lt; Stdio.h & gt; / * I k...

c - Function declaration vs function definition -

यदि मेरे पास यह प्रोटोटाइप है: int बार (int); संकलक के लिए मैं पहचानकर्ता बार घोषित कर रहा हूं यदि मुझे यह परिभाषा है: इंट बार (int a) {}; संकलक के लिए मैं पहचानकर्ता बार परिभाषित हूँ आम तौर पर एक परिभाषा के साथ एक ऑब्जेक्ट के लिए स्टोरेज आबंटन बनाते हैं लेकिन: क्या यह फ़ंक्शन घोषणापत्र के लिए भी सच है? इसके अलावा इस मामले में कोई भंडारण आवंटित नहीं है? फ़ंक्शन परिभाषा के लिए आवंटित भंडारण और क्या आवंटित किया गया है? पी। एस। सी विनिर्देश जब घोषणा या परिभाषा के बारे में कहता है, उनके अपेक्षाकृत अपेक्षाकृत (यानी एक पहचानकर्ता की घोषणा ...) का कहना है लेकिन मैंने यह भी पढ़ा है जहां कहलाता है की घोषणा एक चर तो क्या कोई अंतर है या केवल एक अर्थ के बारे में कहने के लिए "डबल-वे" है? फ़ंक्शन के मामले में, फ़ंक्शन को पहली बार नाम दिया जाने पर संग्रहण आवंटन किया जाता है परिभाषा खुद भंडारण आवंटन नहीं करती है। आपको यह भी ध्यान रखना चाहिए कि फ़ंक्शन के शरीर को खाली करना मान्य है जब रिटर्न प्रकार का फ़ंक्शन शून्य है इसलिए, संकलक को इंट ब...

sql - Error Msg: unknown column in field list in tables with the field -

Currently I have the following code, Part I and Part 3 works fine though, when I'm trying to union I have two temporary tables, giving me the error message of "unknown column name" in the "field list" "Even when I've spent a lot of time changing the name that was filed" in the name 'temporary' . create a temporary table, then not inp_cnt exists (, a.name selection (different ad.pub_id) as count c as an intermediate ad from the author But join the author at a.id = ad.author_id join inproceedings form inp ad.pub_id = inp.pub_id where inp.booktitle = "SIGMOD conference" or inp.booktitle = "KDD" or ad.author_id inp .booktitle = "VLDB" group); If you create a temporary table, then ar_cnt is present (select a.name, (different ad.pub_id) as the count of c from the writer as an a.id = ad.author_id ad on the interiors Join the author to join the author article at ar.pub_id = Ar.pub_id WHERE ar.journal = ad.author...