Posts

Showing posts from June, 2010

keyboard shortcuts - Eclipse/Pydev: is there a way to temporarily and quickly disable the auto closing bracket feature? -

When I am closing the bracket that opens the input in Eclipse / Pydev for maximum time, I manually insert I enjoy the closing bracket feature, there are occasions that I want to disable it, such as an absence to open the bracket to add. I was thinking that in any way there is a way to disable feature on-the-fly quick and temporarily, perhaps a keyboard shortcut? Thank you. There is no such facility at this time, but you can close: You can add a keybind Open the page where the preference is defined (Preferences & gt; pydev & gt; Editor & gt; Typing & gt; "Automatic Bracket Entry"). To add a shortcut: ctrl + shift + l (twice), add more mapping to search 'typing'. If this is not enough for you, please add a feature request in PyDev Feature Tracker (or better yet, as it is open-source, you can provide a patch that facilitates Adding - Also it should be easy to change the prefs in Pyode scripting. View

canvas - Android Scale a bitmap image -

In my application there are 9 bitmap images in the 3 bit 3x3 grid, they are all displayed on the screen and depend on it How to touch the image (tap, double tap, pinch, zoom, drag), how the user "action-addon" needs to perform different tasks. For example, if I tap on an image, then it needs to rotate around its vertical entrance completely, then stop it. Currently I am using SurfaceView with the onTouchEvent (..) method. The way I thought I could enliven it, I am scaling the width of the image from 1 to -1 to level 1. I'm trying to use the matrix, but I can not find the image to stay focused on this place. Please help me fix it or suggest an alternative / better way to do this. My current code is just a test if the b is true, then the method will try to scale the bitmap if b is false then it will normally attract the bitmap. Dood with public zeros (canvas canvas, boolean B) {matrix M = new matrix (); Float scale = .5f; M.setScale (scale, 1f); M.postT...

MySQL Left Join Help -

OK, so I'm using PHP and MySQL to create a Clan Roster page. I have several different tables for which I have to use for this query. Here's how my tables are laid out: Members - Regular members table roster_members - memberID, GameID, rosterXP (experience points that the user earned for the roster Select cr.id as crid, rank_title as cr.title, cr.minimumxp as rank_min, rank_abbr as cr.abport, cr.image rank_image In form, as member_id, rm.rosterxp roster_xp, from rm.gameid as game_id as rm.memberid ".db_PREFIX." Roster_members include rm left as ".db_PREFIX." In crore as clan_ranks (cr.minimumXP & lt; rm.rosterXP) where rm.gameID = ". $ GameID." Group by CR.id order rm.rosterXP DESC I think I can understand what your goal is if yes, I do not think that you mean that you want to create a group based on clan ranks, as you say - I think you are on the clan ranks. Are saying to be based. SELECT rm.memberid AS member_...

Creating a custom notification popup in c# wpf -

I am currently working on a C # WPF project. What I want to be able to do is allow the application to reduce the system tray area which I have done without any problems. The main thing I want to achieve when a user clicks on a certain object within the program, a notification message appears in the lower right corner of the screen above the work bar near the system tray notification area. I know I can use the balloon tip but I do not want to use it. Instead, I want to create my own custom window which appears in the area similar to a balloon tip, but I style it in my own way. What is the best way to get this custom notification popup, I would be grateful for any help you can give. Your answer and / or second, is a WinForms app, but the same idea should apply.

Simple SQL problem, disambiguating common attributes -

I have a database with the table person , with the attribute id , names and age . I have a table worksfor , with attributes ID1 and ID2 , where ID1 works for ID2 I want to list the names of all those who work for at least 2 years younger than anyone. How do i do this ID 1 Works ID2 ... Select CubeRat.ID, CubeRat.Name, CubeRat.AgroupForFormsFor W. INNER W.ID2 = Add Boss.ID Individual Owner at INNER WIID1 = CubeRat.ID is included in CubeRat where WHERE Cubarate.exe> = (Boss.ge + 2)

c# - Is there a System.Threading.SynchronizationContext.Current.PostAsync()? -

I can back anything back to the UI thread like this: // When I'm on UI Thread var _UI = System threading. Synchronization Consort Present; // Then a background thread _UI.Post ((x) => gt; {DoSomething ();}, tap); However, if I am going to create asynchrnous on that background thread, calling _UI.Post () will undo my efforts and Makes UI wait for the doSomething () execution Of course _UI.PostAsync () is a pseudo code but is a method of executing on the UI thread, but an asynchronous method From ? Fundamentally, I know that I am exposing my lack of knowledge and understanding. Kindly be kind, I'm just asking;) will not block the background thread, because it is asynchronous By the form "Post" is the UI Thread (in this case). The UI thread will only be blocked for the duration of the call DoSomething () - but in this situation, you are saying it should run on the UI thread In that case, it will tie a UI thread. The most work here is to be p...

ruby on rails - RSpec.configure and the request object -

I have tracks 3.1 application that is being created as a reciprocal API. The scheme is to handle authentication based on the API key, which has passed the authorization via HTTP header on each request. To test this in order RSpec, I wanted to set the request.env ["HTTP_AUTHORIZATION"] in the config.before block: Configure RSPC. Config | Config.mock_with: rspec config.use_transactional_fixtures = true config.before (: each) authorization header # set API key in request.env ["HTTP_AUTHORIZATION"] = "6db13cc8-815f-42ce-aa9e-446556fe3d72" end end request object does not exist in the code> config.before block. There is another approach to setting this header out of the included block of each controller test file? I have not tried it myself but maybe shared example group you can solve your problem Can help: shared_examples_for "all API controllers" before (what is: each) request.env ["HTTP_AUTHORIZATION"] = "...

wsdl - wsdl2java and soap with attachments issue -

I created a WS client using wsdl2java for a soap service that was developed with Soap Lib 0.8.2 (Python) Have done The server supports soap with the epiboots because I could see with TCPdump while using a built-in customer with soapbox. But when it comes to Java, the generated client does not send attachments as other parts, but embedded in XML as the base-64 binaries. I would like to know how the Java client can be installed, the order of sending the attachment as partitions and not embedded in XML? You need to set stub._getServiceClient (). GetOptions () SetProperty (Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); Please refer to this blog [1] for more information. [1]

validation - cakePHP - creating new user account, several problems -

मेरे पास दो तालिकाओं, उपयोगकर्ता और टोकन हैं। प्रत्येक उपयोगकर्ता के पास एक सक्रिय क्षेत्र होता है और प्रत्येक टोकन में {id, टोकन, उपयोगकर्ता_आईडी, निर्मित} फ़ील्ड है। जिस तरह से ऐप को काम करना चाहिए : निर्माण पर, ऐप होगा - सुनिश्चित करें कि सक्रिय फ़ील्ड खाली है (सबमिट किए गए डेटा में जोड़तोड़ से बचने के लिए)। एक टोकन को टोकन तालिका में बनाया जाएगा। अपडेट पर, ऐप में होगा - एक नया नहीं बनाएं टोकन। किसी भी प्रकार के सक्रिय फ़ील्ड के अपडेट की अनुमति नहीं दें। जांचें कि क्या कोई नया ईमेल सबमिट किया गया है, और यदि ऐसा है तो: एक नया टोकन और सक्रिय क्षेत्र को गलत पर सेट करें। मुझे पता है कि नियंत्रक के माध्यम से खाता कैसे सक्रिय किया जाए और उसके लिए राउटर कैसे सेटअप किया जाए। मुझे क्या जरूरत है मुख्य रूप से मॉडल कॉन्फ़िगरेशन। उदाहरण के लिए: मुझे लगता है कि टोकन निर्माण sho Uld को के बाद विधि में किया जाता है, इसलिए - मैं कैसे निर्धारित कर सकता हूं कि विधि को किसी अद्यतन के द्वारा या एक निर्माण कार्य के द्वारा कहा जाता है? किसी भी मदद के लिए धन्यव...

Android web browser geo location problems on wifi - it's way off -

I have this website that is designed for Android phones. It becomes the user's location through a web browser ... Sometimes When I have WiFi off, it comes out of lazy mode and receives the actual GPS location which is on the money Is bang When I have WiFi (and only in my office, other WIFI works) it becomes lazy and is using WiFi to get the location. But it's saying that I'm in Monaco ... but I'm actually in Australia What's going on with it? It happens when WiFi is turned on and only in my office. The location of WiFi is on the basis that can be affected by many things. I have reported the use of several intranet sites used. In one case I think this is due to the use of a web proxy, because the reported location is the city's headquarters (and where the web proxy is running), not at the place that I work on. In another company, the location report is in the other half of the world in any other country. I am not sure what is happening due to t...

Define n functions at once in Lisp -

Suppose I want to do the following: (from i to 1 to n Loop Apparently I really want to do the following: (defun 1th (do not define ith (lst) (nth i lst) ) Lst (1 th number) (defun 2th (lst) (nst 2 lst)) (defun 3th (lst) (nth 3 lst)) (defun 4th (lst) (nth 4stst)) ...... Here you should note that | 1 was will return another value: (defmacro make-nths (n) `(old, @ (loop for 1 to n from), as the exchang In the words, > Macrolet This may be better here, because you do not really need globally defined macros: (Macro ((make-nyands (n) `(pregnet, @ For loop) i collect n from 1 (defun, (intern (format zero) ~ at "i" (list) (nth, i list))))))) (make-nths 3)); Finally, here is the working version of the ninja non-macro solution: (Loops for 1 to 3; here select N (each (i () () () () New binding introduction for each frequency (setf (symbol (function zero "~ at" i)); code>

ios - Delete a folder and its subfolders in Objective-C / C -

How can I delete a folder and its subfolders in Objective-C / C on iOS? You can use NSFileManager : BOOL success = [[NSFileManager defaultManager] RemoveItemAtPath: pathToFolder error: zero];

xamarin.android - How to call a .NET class from a Java class in Mono from Android? -

मैंने एक जावा क्रियाकलाप लागू किया है जो Google मानचित्र दृश्य प्रदर्शित करता है, और एक मौजूदा एनएटी ढांचा वर्ग का उपयोग करना चाहता है नक्शे पर प्रदर्शित करने के लिए, वेब सेवा से स्थानों को वापस लाता है। क्या यह संभव है या क्या मुझे जावा में वेब सेवा का उपभोग करना चाहिए? आप यह कार्यान्वयन कर सकते हैं, लेकिन मुझे लगता है कि इस प्रयोजन के लिए कुछ एंड्रॉइड ढांचे का इस्तेमाल करना कठिन और बेहतर है। इसके अलावा आप प्रबंधित कोड का उपयोग करके इस गतिविधि को क्यों लागू नहीं कर सकते?

avfoundation - streaming images over bonjour between two iOS device -

My goal is to bring the images captured from an iOS device through AVCpatureInput to the other in the stream. Here's my current method: 1) Capture frame with video input - Capture capture (Capture Capture): (AVCaptureOutput *) Output Sample Buffer: (CMSampleBufferRef) Connection to sampleBuffer: (AVCaptureConnection *) Connection {/ * code to convert sampleBuffer into UIImage * / NSData * imageData = UIImageJPEGRepresentation (Image, 1.0); [Connection sendImage: image]; } Send the raw image to the network - Send to (Zero) ROI Image packet: (UIImage *) Image: Send {// Encoded Packet NSData * imageData = UIImageJPEG Report (Image, 1.0); NSDTA * rawpackets = [NSKEADAirir archivesDataDhitAbject: imageData]; // Written Header: Length of raw packet int packet = [raw pocket length]; [Outgoing Datahop Appendbits: & amp; Packet length line length: size (int)]; [Outgoetabity appendamenta: rawpacket]; // Try typing to stream [self-writingoutingburststream]; } 3) Read the da...

ruby on rails 3 - How to capture a comment's author then display in tooltip? -

I have a form attached to the profile, where concise comments can be submitted. I want to capture the name of the author, though I can display it in the tooltip when the comment is hovering over the body. I have my create method in my controller: def make @ comment = comment.New (consultation []: ) @ commented out! Redirect_to profile_path (@ comment.profile) end inside my migration: t.timestamps t.integer: profile_id t.string: author_id t String: profile model: related_to: user accepts_nested_attributes_for: user has_many: comments comment models : / P> related_to: profile profile controller: def show @user = User.find ( Params [: id]) @profile = user.profile @superlative = @ profile.superlatives.new end and my form: & lt; % = Form_for @comment do F | & Gt%; & Lt;% = f.hidden_field: profile_id ,: value = & gt; @ Profile id = & gt; & Lt;% = f.hidden_field: author_id ,: value = & gt; "# {Current_user.profile.fi...

c# - Using MVC, how do I design the view so that it does not require knowledge of the variables being set by the controller? -

Assume that I have a theoretical MVC framework that viewData Object uses the view in my controller, say I have some code (in pseudocode): function GetClientInfo () {// database var client = database. Bring a bunch of data from the gateclient (); Var ClientOur = Database. Gate client operators (); Var ClientWistlist = Database GETClientWishList (); // ViewData object sets a bunch of variables in ViewData.set ("Client", Client); ViewData.set ("client order", client order); ViewData.set ("Client Wishlist", Client Washlust); ShowView ("ClientHomePage"); } and then in my ClientHomePage view, I display data like this: & lt; P & gt; Welcome back, [ViewData.get ("Customer") FirstName.] And lt; / P & gt; & Lt; P & gt; Your order history: & lt; / P & gt; & Lt; Ul & gt; [Html.ToList (ViewData.get ("Client Orders")] Your Wishlist: ul & gt; [ HTML ToList (ViewData.get ("clie...

Upgrade My PDF Files from Version Using Java -

I am currently using Java to get a PDF document and I am adding text using PDF . I would like to know how I can upgrade my current PDF from version 1.2 to version 1.3 and above. Thanks I can recommend the iText library. It has the function of manipulating a few very useful PDFs

javascript - $.get JQuery passes parameter and creates a new DB record but fails to redirect in my browser window? -

$ .get ("/ धन्यवाद", {टोकन: प्रतिक्रिया। सत्र। एसेट_टोकन, facebook_user: response.session .यूआईडी}, फ़ंक्शन (डेटा) कोड का निम्नलिखित भाग मेरे रेल नियंत्रक के लिए एक अनुरोध प्राप्त कर रहा है। क्यों मेरे पृष्ठ को पुनः निर्देशित नहीं किया जा रहा है, फिर भी पैरामीटर और अनुरोध प्राप्त करें एक नया उपयोगकर्ता बनाने के लिए काम कर रहा है? यह शायद JQuery के साथ एक समस्या है, लेकिन यदि आप रूबी / रेल में कुशल हैं तो शायद मेरे पास एक नियंत्रक समस्या है: # GET / घरों / नया # जीईटी / होम्स / न्यू। एक्सएल डीईफ़ न्यू @होम = होम। नया अगर पराम [: टोकन] @ टोकन = परम [: टोकन] @ फ़्फ़बुक_युसर = पैराम्स [: फेसबुक_युजर] Rails.logger.error (@ टोकन ) Rails.logger.error (@facebook_user) @user = User.find_by_user_id (@facebook_user) @ ग्राफ़ = कोआला :: फेसबुक :: एपीआई.न्यू (@ टोकन) अगर उपयोगकर्ता.फिंड_बाइ_यूएसर_आईडी (@ फ़्फ़बुक_युजर) == शून्य प्रयोक्ता.सेंट (: Oauth_token = & gt; "# {@ टोकन}",: user_id = & gt; "# {@ facebook_user}") अन्य उपयोगकर्ता = User.find_by...

asp.net - Jquery only Few special character validation -

How can I validate all the text boxes on a page with special characters on the key up event using jquery Special characters should not be allowed: & lt; & Gt; () "'/ & Amp; Can I do jquery verification on all textboxes with regex? Please help. String = "[[lt; & Gt; () "" '\ & Amp;) "worked on the net with the lines below the RGXFfring. IsValidString = No RGXSafeString.IsMatch (StringValue)) as the new Strege (StringParten) Well there is a jQuery plugin that you can also do a checkout demo here. But when you have a regular Expressions are familiar to you. I suggest that you have a few more tips on javascript regular expression for more.

Iterator, set, if-else tags of Struts2(Getting the value of s:radio and applying if-else ) -

I have a jsp page in which I have two radio buttons and a selection tag. Now, if the first radio button is clicked, then I want to disable that selection tag but I failed to do this , I tried to use the "disabled" property under the following code JSP page & lt; Table row = "center" & gt; & Lt; S: Iterator value = "first object list" status = "writer type status" & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; S: radio name = "radio_slectedValue" list = "{objectName}" list = "object key" value = "object name" value = "default object" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / S: iterator & gt; & Lt; S: If test = "% {# radio_SelectedValue == 'ObjectName1'}" & gt; & Lt; S: Set name = "hatch option disabled" value = "wrong" /> & Lt; / S: If & gt; & Lt; S: and & gt; ...

Dynamic pages for DotNetNuke -

I am currently looking to create a site using DotNetNuke 6 for the first time! My question however, can be 1 page with 1 HTML module and after that many clients can log in and provide different content to me? But I should be able to log in under HOST and see what the client has provided. Besides, are you happy people working in DotNetNuke functionality? I want to buy a provisional version. There are several ways to attack this problem - especially with the features in the commercial version (i.e. , Workflow). With workflow, you can not only place content through the review process (which you define), but you can save, view and rollback unlimited unlimited versions of that content of history. It also allows you to understand when and when the last update of that material was made. In fact, the workflow feature can automatically email you when updates are pending.

How to separate word in php? -

How to separate words in PHP? In the example I have a variable str = "a1, c1, d1; a2, c2, d2; a3, c3, d3"; I want to isolate the str in the following formats: how to do tt1 = a1, c1, d1, tt2 = a2, c2, d2, tt3 = a3, c3, d3 in php This attempt But not correct: $ str = "a1, c1, d1; a2, c2, d2; a3, c3, d3"; $ StrSplit = Explosion (';', $ str); $ End = array (); ($ I = 0, $ j = 0; $ i & lt; counts ($ strSplit); $ i ++, $ j ++) {$ last [$ j] = $ strSplit for [$ i] . $ StrSplit [$ i + 1]; } simply $ str = "a1 , C1, D1, A2, C2, D2, A3, C3, D3 "; $ Arr = explosion (';', $ str); Var_dump ($ Arrival); ... what do you have to give ?? Or do you want parts in the form of variables in your possession, which starts with 'TT'? $ str = "a1, c1, d1; a2, c2, d2; a3, c3, d3"; $ Arr = explosion (';', $ str); ($ I = 0; isset ($ arr [$ i]); $ i ++) $ {'tt' ($ I + 1)} = $ arr [$ i]; Print "tt1 = $...

objective c - Does ASINetworkQueue support multiple requestDidFinishSelectors? -

In a view controller, I have several ways with various ASIFormDataRequests, which have different Finnish selectors, hence the method A - Gt; FinnishShincter (Affinibet), Methib - & gt; FinanSeltter (Biffinbed :), and Method C - Finisher Shikkitter (Cfnijd) I have a method that handles all requests as shown below: - (zero) sendRequest: Param: (NSDictionary *) parameter and selector with URL: * NSString * selector {NSString * jsonString = [params yajl_JSONString]; ASIFormDataRequest * Request = [ASIFormDataRequest requestWithURL: url]; [Request Setpost Value: jsonString forKey: @ "json"]; [Set time timeset: 15]; [[Self NetworkNo] Set Deliaget: Self]; [[Self NetworkKUUUT] SetterQuestDeadfirstSecents: NSSSilterFrameString (selector)]; [[SELF NetworkQueUUT] CeterusDefiffFileTalker: @Selector (ASIRFestFile :)]; [[Self Network Que] Adding Operation: Request]; [[Go to own network]]; } I saw that when I changed the method A-> The request for B-> C and B sent, the...

c# - webbrowser encoding problem -

I am using a WebBrowser control in my project. My code example is below: webBrowser1.Navigate ("Web site goes here"); The web browser is navigating to Google websites, although I can not see Turkish characters. So I use it: WebBrowser1.Document.Encoding = "UTF-8" However the problem still Continue. Any ideas to solve? streamer srr = new streamer (this.webBrowser1.DocumentStream, Encoding.GetEncoding ("UTF -8 ")); String source = sr.readteoEnd (); Or you can try "iso-8859-9" for encoding. It should do this.

Python: are objects more memory-hungry than dictionaries? -

पायथन 2.7.1 (r271: 86832, 27 नवंबर 2010, 18:30:46) [एमएससी वी। 1500 32 बिट (इंटेल)] पर Win32 टाइप "सहायता", "कॉपीराइट", "क्रेडिट" या अधिक जानकारी के लिए "लाइसेंस" # रैम उपयोग: 2100 & gt; & gt; & gt; वर्ग टेस्ट: ... def __init __ (आत्म, i): ... self.one = i ... self.hundred = 100 * i ... # RAM उपयोग: 2108 & gt; & gt; & gt; List1 = [एक्सरेन्ज (10000)] में # के लिए [टेस्ट (i) # रैम उपयोग: 4364 & gt; & gt; & gt; डेल (सूची 1) # रैम उपयोग: 2780 & gt; & gt; & gt; List2 = [{"एक": मैं, "सौ": 100 * i} xrange में (10000)] # रैम उपयोग: 3960 & gt; & gt; & gt; डेल (सूची 2) # रैम का उपयोग: 2908 समकक्ष शब्दकोशों की सूची के रूप में वस्तुओं की सूची दो बार जितनी मेमोरी क्यों लेती है? मैंने सोचा था कि एक ऑब्जेक्ट ज्यादा कुशल होगा क्योंकि प्रत्येक ऑब्जेक्ट के लिए एट्रिब्यूट नाम की प्रतियां स्टोर करने की कोई आवश्यकता नहीं है। "post-text" itemprop = "text"...

mysql - Export and import database on Git push and pull -

I need to sync my database between two local computers, without interrupting one server. After some research, I thought I could use the Git hook to work for me. What I basically want to do is to run git push on mysqldump I could not find any specific hook, and mysqlimport at git drag and from the remote repository For this. I tried hooking up pre-commit , but it did not add the SQL file to the existing file. I then tried ready-made , but without luck. Has anyone got an answer for this? This solution uses by Ben Kulbertis to use pre-commit and post-merge git hooks . works like a charm!

Format java snippet in jsp file in eclipse -

Image
When I automatically open my jsp files in the Java code bracket & lt;% {javacode}% & gt; Which formatter option is considered in this case? I am asking because the formatter wrapping my lines after 72 lines and I want to change this behavior. You can see the line width under Web> gt; HTML Files & gt; Editor .

openxml - HtmlToOpenXml - HTML to Docx Conversion - -

धन्यवाद HtmlToOpenXML API का उपयोग करते हुए HTML को Docx में परिवर्तित करते समय पृष्ठ संख्या को सक्षम कैसे करें धन्यवाद मेरा मानना ​​है कि इस पर निर्भर है। इस मामले में क्योंकि HtmlToOpenXML पृष्ठ संख्या का समर्थन नहीं करता है, तो आप सीधे पृष्ठ संख्या जोड़ने के लिए एसडीके का उपयोग कर सकते हैं। आप यह पता कर सकते हैं कि पेज के साथ एक सरल शब्द दस्तावेज़ बनाने के लिए आवश्यक कोड जेनरेट करने के लिए कैसे करें एसडीके के ओपनएक्सल प्रोडक्टिविटी टूल की सुविधा का उपयोग करते हुए नंबर। मैंने यह स्वयं किया है लेकिन यह बहुत सारे कोड जेनरेट करता है, इसलिए मैं इसे यहां पोस्ट नहीं करूँगा। हालांकि करना बहुत आसान है।

jquery - Center multiple absolute positioned divs within wrapper -

I am trying to create a good looking droplet area for such elements that align itself in the center of the cover is. I got the full drag drop bit job, but wondering if anyone knew the solution of the already focused issue. All divs are exactly 320x240 (webcams) and already for the initial CSS first element which is well-focused, now what I see is that when a new div is dropped into the area, So the current one is adjusted for the new one to move forward, the rest are centered as possible. They can be on one side, when three types of triangles are one below two, then 2 will look like 2 below 2. I can not imagine it has not been done already, but proved to be useless in search of a jquery plugin. Any help is greatly appreciated! How about something like this Originally its: wrapper {text-align: center;} block {display: inline-block}

c - pthread_cond_broadcast does not work? -

मैंने यह प्रोग्राम लिखा है: pthread_cond_t placeFootCondition; Pthread_mutex_t आरएफ, एलएफ; शून्य * आरएसएस (शून्य * में) {जबकि (1) {pthread_mutex_lock (& ​​amp; आरएफ); Printf ("आरएसएस: हालत की प्रतीक्षा कर रहा है \ n"); pthread_cond_wait (& amp; placeFootCondition, & amp; आरएफ); Printf ("सही एकल समर्थन \ n"); नींद (1); pthread_mutex_unlock (& ​​amp; आरएफ); }} शून्य * lss (शून्य * में) {जबकि (1) {pthread_mutex_lock (& ​​amp; एलएफ); Printf ("lss: हालत की प्रतीक्षा कर रहा है \ n"); pthread_cond_wait (& amp; placeFootCondition, & amp; वामो); Printf ("सिंगल समर्थन छोड़ें \ n"); नींद (1); pthread_mutex_unlock (& ​​amp; वामो); }} Int main () {int rc; pthread_mutex_init (& amp; आरएफ, शून्य); pthread_mutex_init (& amp; वामो, शून्य); pthread_cond_init (& amp; placeFootCondition, शून्य); pthread_create (& amp; t1, शून्य, आरएसएस, शून्य); pthread_create (& amp; t2, शून्य, LSS, शून्य); नींद (1); rc = pt...

Rails 3.1 issue with javascript_include_tag in application.html.erb -

I have a clean and easy Rail 3.1 application called demo1 in which there are two controllers - hello and goodbye when I have to load If I try, I get the following error: ActionView :: Template :: error ((/ home / me / dev / ruby ​​/ demo1 / app / assets / javascripts / say js .coffee)): 3: & lt; Head & gt; 4: & lt; Title & gt; Demo 1 & lt; / Title & gt; 5: & lt;% = stylesheet_link_tag "application"%> 6: & lt;% = javascript_include_tag "Application"% & gt; 7: & lt;% = csrf_meta_tags% & gt; 8: & lt; / Head & gt; 9: & lt; Body & gt; App / views / layout / application.html.erb: 6: `` _app_views_layouts_application_html_erb___558576499_89622220 ' application.html.erb is the problem line: & lt;% = javascript_include_tag "application"%> When I created this special line using Rail 3.0, it was: And it worked fine. In fact, when I change application.html.erb to change: e...

process - Java ProcessBuilder running in specific directory -

मैं एक विशिष्ट निर्देशिका में प्रोसेसर निर्माता का उपयोग कर एक प्रक्रिया कैसे शुरू करूं? धन्यवाद! इस विधि में ProcessBuilder वर्ग में देखें। निर्देशिका (फ़ाइल निर्देशिका) यह विधि प्रोसेसबिल्डर के लिए निर्देशिका सेट करती है। जवाडॉक पाया जा सकता है।

php - Make specific url response 404 error instead of 200 for spam bots -

How to do a 404 error instead of spam bots instead of my site's unique url (index.php? Act = add) 200 Try accessing it? I'm not a PHP programmer, so maybe it can be defective in .htaccess file? ++++ Thank you for the answer but it did not help (I need something like that rule in the .htaccess file: & lt; files "index.php" & gt; reject the command; Allow all to reject & lt; / files & gt; but "index. To use php? Act = add, instead of index.php. +++ Thanks for doing it now. using php (file index.php) if ($ _GET ['act'] == 'add') {if ( Spambot / useragent / ipaddress / to check cookies) {header ("HTTP / 1.0 404 not found"); exit;} else {// // // Your code for 'real' users}}

asp.net - ChildGridView column's Data On Binding -

I am using Nested Gridview, at the Rodetabenant event, I have studied the childhood based on some condition of the parentgridview column. In the meantime, I need to know the column value of child Gridviv. How can I do this? I am using this code: - Protected Zero Grid View 1_RadataBound (Object Sender, GridViewEventErgus E) {if (E.RO.RowType == Data ControllerType.Datra) { GridView gridviewchild = (GridView) e Row.FindControl ("gridView2"); String custstate = ((DataRowView) e.Row.DataItem) ["Caststate"]. ToString (); If (! String.isnalautoplay (castestate)) {gridViewchild .DataSource = MyDataSource; Gridwitchchild .detind (); // now i need to know the data of the pedestrian watch column ???? }}}} You have a few ways to get it: 1- Loop through the lines of the hair grid view foreach (GridViewRow line in childGridView.Rows) {//row.Cells PageInense]; } 2- Use RowDataBound child grid view

asp.net - Is there a way to include an assembly referenced using Unity when using publish website? -

I am using repository patterns and integrity to manage reliance on my concrete stockpile objects. This is not an issue in itself, although I am running into a problem while using the website published in both the VS and TFS build process. I believe that the problem is arising from the fact that although the Concrete repository objects in this project are referred to in my application, the reasons for which they do not use directly in the Is that my web? Using Unity to create examples of concrete objects on runtime, using Integration Configurations in Configuring. The repository project is being compiled, the published website is used either in TFS VS, where the repository assembly is missing. So when the web application is deployed on a web server, it is not possible to use it because you were greeted with an error: The name of the given assembly or codebase was invalid. (Exception from HRESULT: 0x80131047) That's because unity, you can not get a lost assembly. So m...

geometry - Where can I find a c/c++ implementation of the minimum bound box algorithm? -

I'm looking for a free implementation ( MBB - surround a cloud The box on the side should be written in either C or C ++, with a small quantity of 3D digits). To do this, an algorithm was published by Joseph O'Rork and is cube timely, for example, by the proposed algorithm by Gill Berequet and Siriel Har Pellad, I also had material with an estimated MBB content Will be. Can anyone direct me for any implementation that is free software? Almost what you want, and GLP / QPL. check out . It seems that if you do not need binding areas, you will have to use their lower library functions to create a 3D rectangular case, but for the purpose of accelerating the trigger detection, should do .

uiview - edit the text of a cell? -

I have a UITableView, and users want to edit the text of a cell I have a new UIView popup in them in the Textfield I want to pop up to enter some text, then reject the view and change the labels text of the cell. Is this possible? This is an advanced step, programming and user interaction with development table visual cells is difficult. The reason for this is that the UI code is a bit difficult due to the scrollable view, and you have to be ready for table cells to move or change the table table once it is reloaded. Is there any other way you can get the result you are looking for? Can you design your table view so when a cell is chosen, then you push a new view on the navigation stack, and enable the UI components on that view to edit the value of the user? This is the way on which Apple Settings on iOS when you select a row, you are presented with a new view that has appropriate editing or selection controls.

Swapping sections of an array with each other in C++ -

Is there an easy way to swap the squares (sections) of arrays with each other? That is, I have an array: array [0] = 1; Array [1] = 2; Array [2] = 3; Array [3] = 4; Array [4] = 5; Array [5] = 6; Array [6] = 7; Array [7] = 8; A function called and swapSections (startX, endX, startY, endY) that these values ​​are given too much, limit the values ​​set by endX Swaps - startX with values ​​from x range to start to endY , so from my example ... If x range = 2 and startX = 0 and y category = 3 and startY = 5 , it The array [0] and the array will give the space [1] where the array [5] and the array [6] are, and then the array [6] holds after the array [7] All of which are pushed down one by the other, I'm not sure how to go about this, and I was physically copying memory into a temporary array, but I think there is a better way of doing this is. (BTW will be the last result from my example): array [0] = 6; Array [1] = 7; Array [2] = 8; Array [3] = 3; Array [4]...

css - Understanding last-child -

मेरे पास निम्न HTML संरचना है: & lt; div class = "decorator" & gt ; & Lt; div class = "EC_MyICHP_Item" & gt; & Lt; div class = "text" & gt; & Lt; h3 & gt; & lt; एक लक्ष्य = "_ रिक्त" शीर्षक = "" href = "#" & gt; & lt; / a & gt; & lt; / h3 & gt; यहां पाठ करें यहां टेक्स्ट यहां पाठ करें यहां पाठ यहां टेक्स्ट यहां है & lt; / div & gt; & Lt; / div & gt; & Lt; div class = "EC_MyICHP_Item" & gt; & Lt; div class = "text" & gt; & Lt; h3 & gt; & lt; एक लक्ष्य = "_ रिक्त" शीर्षक = "" href = "#" & gt; & lt; / a & gt; & lt; / h3 & gt; यहां पाठ करें यहां टेक्स्ट यहां पाठ करें यहां पाठ यहां टेक्स्ट यहां है & lt; / div & gt; & Lt; / div & gt; & Lt; div class = "EC_MyICHP_Item" & gt; & Lt; div class = "text" & gt; ...

iphone - How can i insert an image inside html code? -

I have to add a background image to a phone number that is contained within an HTML code that I load into UIWebView NSString * stringToReplace = [NSString stringWithFormat: @ "& lt; a style = \" color: white; Background color: # 707,070; Text-decoration: none write \ "href = \": //% @ \ "& gt;% @ I have been able to change background color, but instead I would have to put an image in the form of background I have found out what was the problem Thanks, I do not really insult your code , You might want to use it: Background: #afdafd url ('path ...'); /*def.color. Back.img. * / & Lt; One style = \ "color: white; background: # 707070 url ('/ images / rounded-corner.png'); text-decoration: none write \" href = \ ": //% @ \" & gt; % @ & Lt; / A & gt;

android - 2 Colors Defined In XML - Is It Possible In XML Code For One Color To Refer To The Other? -

For example, I define 3 colors in the XML code: Lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Resources & gt; & Lt; Color name = "red" & gt; # Af0000 & lt; / Color & gt; & Lt; Color name = "green" & gt; # 00af00 & lt; / Color & gt; & Lt; Color name = "blue" & gt; # 0092ed & lt; / Color & gt; & Lt; / Resources & gt; Now I want to add a quarter color, which I would call 'selected_colour' and I should have one of the three colors that I have already defined in XML, and I Is it possible to define this assignment in XML? As far as I know, you can not do such a thing and the speed is dynamically can change. Instead set a constant color object in which you set the currently selected color and use it whenever you want.

php - Why in some files require /app/ works, in others doesn't? -

Some files require '/ app /' to work, in some, But do not need 'AAP /' works on pages where '/ app /' breaks like this? I can not use the __DIR __ , because it can not load css files. This is because there are 2 types of Unix Path: Full Path: / app / (always starts with / ) relative path: app / (relative to that place Imagine you are in the You use / app / (abosolute) - you talk about the / app / folder if you click the app / (where you are Are related to there) - You talk about / var / www / app / . This means that you want to use the directory "app" in the / var / www / directory.

iphone - Problem with saving custom object into NSUserDefaults -

मेरे पास निम्न के साथ एक कस्टम ऑब्जेक्ट क्लास है। एम: @implementation FolderObject @ फ़ोल्डर को संश्लेषित करेंटेल्ट, फ़ोल्डरसंसाधन; // शीर्षक NSString है, सामग्री सरणी है - (आईडी) init {self = [super init]; अगर (स्वयं) {} स्वयं वापस लौटते हैं; } - (शून्य) एन्कोडविथकोडर: (एनकोडर *) कोडर {[सांकेतिक शब्दों में कहें एनकोड ऑब्जेक्ट: फोल्डर्स कंटेंट फॉरके: @ "फोल्डर्स कंटेंट्स"]; [कोडक एन्कोड ऑब्जेक्ट: फ़ोल्डरटाइटल फॉरके: @ "फ़ोल्डरटाइटल"]; } - (आईडी) initWithCoder: (NSCoder *) सांकेतिक शब्दों में बदलनेवाला {आत्म = [[FolderObject alloc] init]; अगर (आत्म! = शून्य) {फ़ोल्डर्ससंसाधन = [सांकेतिक शब्दों में कहें decodeObjectForKey: @ "फ़ोल्डर्ससंसाधन"]; FolderTitle = [सांकेतिक शब्दों में कहें decodeObjectForKey: @ "folderTitle"]; } स्वस्थ वापसी; } @end यहां मैं कैसे फ़ोल्डर का उपयोग (कुछ अन्य वर्ग में) है: FolderObject * newFolder = [FolderObject alloc]; NewFolder.folderTitle = [textView पाठ]; NewFolder.folderContents = [[NSMutableArray alloc] ...

c - How to let the parent window of a child window (a.k.a. owned window) stay active with winapi? -

Image
I am writing a small application using WinAPi. There I have a window with a hair window (toolbox). I am able to keep it inside this window and so on, but my question is how to keep the main window active, if the child is window-oriented? The main window is grayed out at this time. The windows are created by: hMainWindow = dialog box (.......); HChildWindow = CreateDialogParam (..., hMainWindow, ...); ShowWindow (hChildWindow, SW_SHOW); Here is a small image of the behavior of two windows: I've found that just create it as WS_CHILD and obviously WS_POPUP as no resolves it, it also changes the full window coordinates for relative people so that I can position the window Do not take care to move again in the parent window // Resolve

Need help with pseudocode assignment! about reading record and add them and print them -

Name, gender (M or F), age (in the year) and marital status (single or 1) married in a file of student record, design an algorithm for each student who will read through the file and married men, single men And count the number of married women. Print these numbers on a student summary report if they are more than 30 years of a single male age, print their names and ages on a different eligible undergraduate report. Can anyone tell me that I am wrong in any line? Thanks! Hope you can help me! Set marriage to 0 Set from Singlemen 0 Set Married Women 0 Set Name, gender, age, status, dool (not eof), if (condition = married) from / Check / see if the situation is married, if so, then check further IF (sex = â ???? F) ???) then check if sex is F, then yes 1 married woman = married woman + 1 If ELSE (sex = â ???? Mâ € ???)) under marriage // //, then sex is M. then a married man = married husband Ale + 1 ENDIF ENDIF ENDIF if (status = single) then // Check if status, if so, the next check ...

c# - Export Oracle Data with ODP.NET into an Excel File with C Sharp -

I am trying to export the query result set in an Excel sheet. I need to run 8 questions, each of which will be a separate sheet in the Excel file. I need to add some formatting around the sheet (adding a header, the report looks good, etc.). Currently, my code is only running one query (hence only one sheet data). It fills 4000 rows with 7 columns and takes a long time for a small sample. Is there a better way to do this? Thanks a lot! Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheet; Object Mist Value = System. reflection. missing. Value; String data = null; Int i = 0; Int j = 0; XlApp = New Excel.ApplicationClass (); XlWorkBook = xlApp.Workbooks.Add (MySQL); XlWorkSheet = (Excel Worksheet) xlWorkBook.Worksheets.get_Item (1); String cs = "Filter Oracle Connection String To Post Online"; Dataset ds = new dataset (); OracleConnection oakon = new oracle connection (CS); Oconn.Open (); Model_Netstat netstat = new Model_Netstat (); OracleCo...

escaping - JDOM: creating element from string, which contain xml-code -

I am able to use some text input for XML using jdom, it has the structure: & lt; Items & gt; & Lt; Text & gt; Some details & lt; / Text & gt; & Lt; Options .... /> & Lt; / Item & gt; & Lt; Items & gt; & Lt; Text & gt; Some details 2 & lt; / Text & gt; & Lt; Options .... /> & Lt; / Item & gt; Then, I need a regular w3c.dom object. I am using this code: DOMOutputter domOutputter = new DOMOutputter (); Org.w3c.dom.Documental w3cDoc = domOutputter.output (doctor); I am creating element with this code: element class = new element ("tekst"); String description = // Some functions returning string desc.addContent (description); E.setContent (DESC); Where the new element ("item") This works fine, but the problem occurs when some XML tags are included in the "Description" user . I want to handle it. I have such output: & lt; Text & gt; Bold & amp; Gt...

PHP array grouping/conditionals is it possible? -

I have a problem I have dug myself, I have a list of items that have one area In which type of boxes they fit For example: items | Boxtepe Quantity ------------------------------- Item 1 | A-10, C-20 3 items 2 | C-10, D-20 2 The box type is the letter box type in the column, this type of number is low, how many items can fit in it. What I'm trying to do is to use the least amount of boxes I basically just divide the quantity by letter number, if it was below 1 year, Used to But on the above cases, where I use Box A for Item 1, on item 2, I have to use C. It would be better to use Box C for both items because both items will fit in. Of course this is a simple version of this problem, if necessary, I can expand with a more defined example. I was just thinking, can I sort everything with arrays? Thanks for any point in the right direction Edit - from this array, there is an easy way to connect to this array array To determine the condition of letters for [[AC]...

javascript - How can I save objects to files in Node.js? -

इस सवाल का पहले से ही एक उत्तर है: 3 जवाब मैं एक नोड चला रहा हूँ सर्वर और मैं सोच रहा था - मैं कैसे वस्तुओं को सीरियल कर सकता हूं और उन्हें फाइल में लिख सकता हूं? आप अपनी वस्तुओं को किसी JSON स्ट्रिंग में क्रमबद्ध करने के लिए var str = JSON.stringify (object) का उपयोग कर सकते हैं var obj = JSON.parse (स्ट्रिंग) किसी ऑब्जेक्ट के रूप में इसे वापस पढ़ने के लिए स्ट्रिंग को फाइल में लिखा जा सकता है इसलिए, उदाहरण के लिए इस तरह एक वस्तु: var p = new Foo (); P.Bar = "टेरी" var s = JSON.stringify (p) // लिखने के लिए s लिखिए, get = & gt; {"बार": "टेरी"} // फ़ाइल से पढें और एक वस्तु में वापस लौटना: var p = JSON.parse (s); फाइलों में / से लिखना और पढ़ना यहां कवर किया गया है:

What is the best way to set a particular bit in a variable in C -

one variable unsigned int a; View in C Now say I want to set any i'th bit in '1' in this variable. Note that there is some value in the variable. Then a = (1 will not work a = a + (1 Will work, but I'm exploring the fastest way. anything ?? bitword or a | = (1

Android click button populate textview -

This is Android's week for me! I am making the program a text view, two labels and a button in the same activity. The idea is that the text view receives a string from the user. The user clicks the button and the textive string is passed to a proc that returns string results, and the string result is assigned to one of the labels. Click Public Zero (see view) {Sresults = showPP (ttsymbol.getText (). ToString (.) Trim ()); } But this does not work, because "the last local variable can not be indexed because it is defined in an enclosed type" I think Is that what I think is going wrong, but is an alternate way to return the results so that they can be displayed in the label? Or is it necessary to create a new dialog inside the onClick function to show them? Thank you! If you definitely change values, then there is no point in making it last. Used for last constant values. You should set a price directly in the label view. Label view references can b...

Using python to filter files on disk -

I am using the below to extract the files from the disk. def match_files (Dior, Pattern): For files in DINN, Subdeer, OS Walk (DIR): For files in F: If F. Wandshut (pattern): produce OS path .join (dirname, f) # Remove all files in existing die matching * Match_files (dn, '.txt') for f.txt: os.remove (f) I would like to remove the files from the disk that "was not updated today." Check to list files from today to update the list. In addition to osstat you can use os.path Getmtime or os.path.getctime , where the pro / Conn are discussed. You can use datetime.datetime.fromtimestamp to convert the timestamp returned in the datetime object, and then you can do whatever you like. In this example, I will not edit the files today, will create a list of the remaining files: . Date () Balance = [] Match_files (dn, '.txt') for f: mtime = datetime.fromtimestamp (os.path.getmtime (f)) date () if mtime! = Today: os.remove (f) Other: remaining.appen...

ruby - Could not find gem 'jquery-rails (>= 0, runtime)' in any of the gem sources listed in your Gemfile. Trying to start rails server -

स्रोत: मणि 'रेल', '3.1.0' # बंडल किनारे रेल इसके बजाय: # मणि 'रेल',: git = & gt; 'Git: //github.com/rails/rails.git' gem 'sqlite3' gem 'json' # रत्न केवल परिसंपत्तियों के लिए उपयोग किया जाता है और आवश्यक नहीं # उत्पादन वातावरण में डिफ़ॉल्ट रूप से समूह: परिसंपत्तियां मणि 'sass-rails', "~> 3.1.0" मणि 'कॉफी-रेल', '~ & gt; 3.1.0' मणि 'यूगलफायर' अंत मणि 'jquery-rails' # के रूप में गेंडा का प्रयोग करें वेब सर्वर # मणि यूनिकॉर्न # # कैपिस्ट्रानो के साथ # तैनाती # मणि 'कैप्स्ट्रिनो' # डीबगर # मणि 'रूबी-डीबग' का उपयोग करने के लिए क्या किसी के पास यहां कोई विचार है? हां, मैंने बंडल इंस्टॉल की कोशिश की। आपने किसी भी स्रोत को घोषित नहीं किया है फ़ाइल के शीर्ष पर स्रोत "http://rubygems.org" जोड़ें (या, यदि आपके प्रश्न के शीर्ष पर उस पंक्ति वास्तव में फाइल में है, इसे ठीक उसी तरह संशोधित करें)।

database - What is the relative cost of reading rows vs. columns in SQLite? -

I am trying to create a cover around the SQLite database, which is the shortest access. Will allow from NET applications. It is an idea that each unit has only one collection or attribute value as joints. Priority is easy to use for developers rather than simplicity and performance, but I do not want to completely ignore memory usage and disc read times. The architecture of my cover will mean that the primary primary key will be read in the first query (and then cached), although other features can be read later. The question is, is it better to create a column of each property name (at run time), and by dragging columns corresponding to the requested properties, or requesting to record and attribute per attribute In the records of properties. With the very nature of the application, I would not know in advance what order features will be read and whether all the features will be read or not. Do not reissue the wheel, especially when you try to change it already Get ro...

javascript - getting json data loop -

Image
Hello IAC: I have a problem: I am coming from some data JSON file, and I have to write it more efficient ways Actually, this work is fine, but I would like to give images like nested arrays or some things. So I only have to call an image tag, but the image tag will be set in the set. I do not want to define the image1-image1000 img tag, Should be able to insert in images like: one ??? ? Image: image: {image1.jpg, image2.jpg, image3.jpg, image4.jpg} and call it with an image tag like this is it possible ??? Some guidance will be helpful Thanks JSON DATA {"mygallery": [{"image1": "image1.jpg", "image2": "image2.jpg", "image3": " Image 3.jpg "," Image4 ":" Image 4.jpg "," Panjemea ":" MyGallery "," Javascript Call "and" Script Type = "Text / JavaScript" & gt; $ .getJSON ('js / gallery .js, function {$ ("# main") .html (...

python - django 1.3 forms validation using clean method to retrieve getlist -

I have a form with checkboxes, the way the job is working, in my opinion, I request.POST.getlist ( 'List') To get a list of prices. At the moment, I am trying to make some form validation within clean way and when I try to use myself, then '[List'] I get the final value I can not retrieve the list of items forms.py class SelectList_Form (forms.Form): list = forms.CharField (required) = false) def clean (self): super (SelectList_Form, self). Try clean () cleaned_data = self.cleaned_data: # TODO: List validation if cleaned_data ['list'] .__len __ () is 0: form.ValidationError raise (_ ('at least one of the list below Must be selected '), if cleared_data [' list '] .__ lane (__ ()> 1: try: # here when I print the list it only shows me the last value it values ​​me The list does not show when the box is checked cleaned_data ['list'] except main.DoesNotExist: Exclude forms, increase Http404. ValidityError: Class B Posting_Wizar...

How can I use US-style dates in Rails using Ruby 1.9? -

I I am in, and we usually format the date as "month / day / year". I am trying to make sure that my Rail App, using Ruby 1.9, receives this format everywhere, and works the way it works under Ruby 1.8. I know that many people have this problem, so I want to make a definite guide here. Specifically: '04 / 01/2011 'is April 1, 2011, not January 4, 2011 '4/1/2011' is also April 1, 2011 - leading zero should not be necessary. How can I do this? Even so far away from me. Controlling the behavior of the date # to_s I have this code in the application.rb : "12/25/2011 'dated: DATE_FORMATS [ : Default] = Format our dates like '% m /% d /% Y' P> ensures that if I do the following: d = date. New (2011,4,1) d.to_s ... I get "04/01/2011" "2011-04-01" No. Controlling String # to_date behavior The string # to_date of ActiveSupport currently looks like this Is (): def to_date ret Color Neil i...

c# - Creating and Instance of a type return null -

frm = (प्रपत्र) assembly.GetEntryAssembly ()। CreateInstance ("EditFrom"); वापसी frm; यह शून्य मान देता है मूल्य प्राप्त करने के लिए कैसे करें उस नाम स्थान सहित पूरी तरह से योग्यता वाले नाम को निर्दिष्ट करने का प्रयास करें जहां यह रहता है: var frm = (फ़ॉर्म) विधानसभा .GetEntryAssembly () .CreateInstance ("SomeNamespace.EditForm"); जहां कुछ नामस्थान नामस्थान है जिसमें EditForm वर्ग परिभाषित किया गया है। यह भी सुनिश्चित करें कि आपने सही नाम निर्दिष्ट किया है।

geometry - How to Find the Minimum Taxicab/Manhattan Distance Between Two Parallel Rectangles? -

Image
Looking at the coordinates of the top left corner of both rectangulars, and the coordinates of the lower right corner of both rectangles, and rectangular one- Others are parallel, as well as the X and Y axis, how do the minimum taxicab / Manhattan distance get between two rectangles? It comes down to classifying the relationship between the two rectangles. I think that they do not pierce each other, in that case there are only two situations: The second rectangle is first fully located in one of the four corners of the rectangle All other conditions In the first case, the distance between Manhattan between two opposing corners (TL-BR, TR-BL, BR-TL, BL-TR) In the second case you get the X coordinates Switch to difference or Y take the difference in coordination rectangular side depending on the situation (BT, LR, RL, TB) is all tested with some very easily if or case statement.

CA SSL parameter for Python MySQLdb not working, but key does? -

I am trying to connect to a MySQL DB which requires SSL (only the server is authenticating, Not mutual). My server's CA is saved in the same directory as a .pem, I'm running the script from. My connection string looks like this: ssl_settings = {'ca': 'ca.pem'} conn = MySQLdb.connect (host = HOST) The result is "Error 2026: SSL connection error." However, if I change ssl_settings to: User = USER, passwd = PASS, db = db, ssl = ssl_settings} ssl_settings = {'key': 'ca.pem'} database connects properly and Script implemented by my understanding of the SSL parameters, the 'cert' and 'key' server's clients For the same reason, there is no reason why SSL settings work and why does not the CA file specify later? Python 2.4.3 (old, I know) MySQL-Python 1.2.1 Note: This bug has been fixed since. : 5.1.66, 5.5.28, 5.6.7, 5.7.0 was noted in changelog. --sl-key option argument does not exist And maybe a...