Posts

Showing posts from June, 2011

shell - Bash - Diff change header (name of files) -

मैं बना रहा हूँ। Diff diff -u $ i / tmp / b / $ {i # / टीएमपी / एआईटी & gt; /tmp/patch/$j.patch और मैं पूछना चाहता हूं कि मैं प्रत्येक पैच फ़ाइल के हेडर में फ़ाइलों के नाम कैसे बदल सकता हूँ। अब मेरे पास / tmp / a /...//> कोड है और मुझे a /... धन्यवाद आप sed भी इस्तेमाल कर सकते हैं या प्रत्येक पैच फ़ाइल में पाठ बदलने के लिए। और फिर परिवर्तनों को सत्यापित करने के लिए diff का उपयोग करें और अगर आप इसे गलत लेते हैं, तो आप अलग-अलग आउटपुट पर लागू अंतर का पता लगा सकते हैं, क्या मज़ेदार है:)

jsf - rich:datascroller binding HtmlDatascroller.getPage() problem -

I have jsf 1.2 and richfaces 3.3.3. Final I have a bond with the rich: Dostroever in my java is a weird thing, though: getPage () method sometimes returns the correct page number and sometimes what are the wrong people in it? Component in JSF: & lt; rich: datascroller id = "tableScroller" renderIfSinglePage = to = "false" "projectPlanCreatetable" pageIndexVar = "page not" binding = "# {ProjectPlanCreateControl.listAction.scroller}" & gt; & Lt; A4j: support event = "onpagechange" action = "# {ProjectPlanCreateControl.pageChanged}" render = "pages viewed" incomplete = "markpage ();" /> & Lt; / Rich: datascroller & gt; & Lt; H: InputHide ID = "Viewed page" value = "# {ProjectPlanCreateControl.visited}" /> and JavaScript: function Markpej () {var pages = document.getElementById ( 'mainFrm: projectPlanCreatetable: Visit Page ")...

Pass javascript variable by jquery -

index.php & lt; script type = "text / javascript" & gt; document.write (lastmsgID); // विफल प्रदर्शन मूल्य (मेरी समस्या यहाँ है, कृपया मदद करें) myfunction function () {jQuery.get ("usermessage.php, फ़ंक्शन (डेटा) {document.write (lastmsgID); // सफलता प्रदर्शन मान}}; }; & lt; / लिपि & gt; usermessage.php & lt;? php $ latestmsgid = "lovelovelove"; गूंज ( "& LT; स्क्रिप्ट प्रकार = 'पाठ / जावास्क्रिप्ट' & gt; \ n \ n; lastmsgID = ''।। $ latestmsgid " '") // lastmsgID गूंज (जावास्क्रिप्ट वैश्विक चर करने के लिए php varible पारित ""); गूंज ( "& lt; / स्क्रिप्ट & gt;" );? & gt; से ऊपर मेरे कोड, मैं usermessage.php फ़ाइल पर वैश्विक जावास्क्रिप्ट चर lastmsgID घोषित तब मैं jQuery.get का मूल्य प्राप्त करते थे। वेरिएबल। अब मेरी समस्या यह है कि मैं केवल myfunction () फ़ंक्शन के अंदर वैरिएबल वैल्यू प्राप्त कर सकता हूँ, फ़ंक्शन से बाहर के फ़ंक्शन से मैं वैरिएबल के ...

gson - deserialize a generics hashmap when key is not primitive -

I want to hedge GSN and D-GSon with generics. When my key is a string but not if it is an object. I have two code sections I do not work before and second does // works does not work {TradableBean tradable = New TradableBean ("conventional"); StatusBen Status = New StatusBen (businessable); Maps & lt; Traditional Behavior, StatusBeans & gt; Map1 = New Hashmop & lt; Traditional Bean, Situation & gt; (); Map1.put (businessable, position); String json1 = gson.toJson (map1); Maps & lt; Traditional Behavior, StatusBeans & gt; Map2 = gson.fromJson (json1, new typography & lt; map & lt; TradableBean, PositionBean & gt; & gt; () {}. GetType ()); Println (MAP2); } Hold (exception e) {System.out.println ("unsuccessful"); } and now working part - // task - try with string {string tradable = new string ("Tradable"); StatusBen Status = New StatusBean (New Traditional Bean ("Traditional")); Maps & lt; ...

android - One Service communicating with two Activity and another service -

So, this is my scenario: I have two activities and a service - & gt; All three (classes) require return type values ​​from second service (hence, total 2 activities, 2 in the application service). i.e: activity A, start -> An activity B and a service I. Activity B, Start - & gt; A Service II. After this, activity A, B and Service II have to communicate with the service. The service I am always running behind and never stops at the start. was as follows: Four. The three who declare the interface between the transmitted classes Write ADL files. Create an activity, then create Service I, Activity B and create Service B from Service II. As a service, I can do the only one () method for communication with 3 sections, at any given time, what I am doing is that from 3 classes All the objectives are different by telling different values ​​using different set sets () properties. When communication should be done by using InitService () and release release s...

c# - Linq query definition -

I am using the Windows Azure Toolkit product on codeplex. It looks right to meet my needs but there are very few examples. Specifically, the Ezoor Tables has a method to obtain data: Get public virtual t (expression & lt; funk & lt; t, bool & gt; & gt; count) {This return.Query.Where (predicate). FirstOrDefault (); } The problem is that there are no examples in the toolkit and I can not understand logic: (expression & lt; funk & lt; t , Bool & gt; & gt; prediction) should look like this Is there anyone with knowledge of Linux and C # that can give me some advice or suggestions This is just one The predicate, is a method that accepts the parameter type T and A Boolean Returns - The easiest way to use it is to pass the lambda expression - simple example: public class Foo & lt; T & gt; {IQueryable & lt; T & gt; Query; Obtain Public Virtual T (Express & lt; Funk & lt; T, bool & gt; Count) {Return JQuery.Wh...

c++ - Confusion between boost::bind and boost::phoenix placeholders -

बढ़ावा :: भावना दस्तावेज़ीकरण में यह महत्वपूर्ण चेतावनी है आत्मा के लिए सिमेंटिक कार्यों को लिखने के लिए अलग-अलग तरीके हैं। क्वाई: सादे कार्यों का उपयोग, बूस्ट.बंड , बूस्ट.लैम्डा , या फीनिक्स । उत्तरार्द्ध तीन आपको पैरामीटर प्लेसमेंट ( _1 , _2 , आदि) को नियंत्रित करने के लिए विशेष प्लेसहोल्डर का उपयोग करने की अनुमति देते हैं। प्रत्येक पुस्तकालयों में यह जगहधारकों के स्वयं के कार्यान्वयन है, सभी अलग-अलग नामस्थानों में। आपको सुनिश्चित करना है कि प्लेसहोल्डर्स को एक लाइब्रेरी के साथ मिश्रण न करना चाहिए, जिसका अर्थ वे नहीं हैं और सिमेंटिक एक्शन लिखते समय विभिन्न पुस्तकालयों का उपयोग नहीं करते हैं। सामान्यतया, बूस्ट.बंड , :: _ 1 , :: _ 2 , आदि का उपयोग करें (हाँ, इन प्लेसहोल्डर को वैश्विक नामस्थान में परिभाषित किया गया है)। Boost.Lambda नामस्थान बढ़ावा :: लैम्ब्डा में परिभाषित प्लेसहोल्डर का उपयोग करें। फीनिक्स का उपयोग करते हुए लिखा गया सिमेंटिक कार्यों के लिए नामस्थान boost में वर्णित प्लेसहोल्डर का उपयोग करें :: भावना । कृपया ध्यान दें कि आपकी सुविधा के लिए स...

Magento: Add button to cart view -

I have to add a button to my cart view. I want to apply business logic to myself, Is triggered on. How can I do this? You can add a block in checkout.cart.methods with your buttons; Checkout.cart.top_methods block using checkout.xml layout

Sending friend request to another facebook user programmatically - from iphone sdk -

Is it possible to send friendly requests from the iPhone SDK to another Facebook user ?? For example: In the application, user (A) can send a friend request to the user (B) Add as a friend to Facebook, reading profile information and writing / writing on the wall is quite normal, But the friendly request programmatic is somewhat different. All I want to do with an iPhone app Any good suggestions or ideas will be appreciated. Unless you can get a list of pending friend requests (the user is clearly giving that permission Is), you can not issue friend requests with a program request. You will need to use the graph API for the past.

machine learning - Log likelihood to implement Naive Bayes for Text Classification -

I am implementing Neve Bays algorithm for text classification. I have ~ 1000 documents for training and 400 documents for the test. I feel that I have implemented the training correctly, but I am confused in the test part. Here's what I have done: In my training ceremony: vocabulary shapes = gateline cutters inclication (); // Get all the unique words in the entire archive spamModelAre [glossary size]; NonspamModelArray [vocabularySize]; For each training_file {class = GetClassLabel (); // 0 and 1 for spam; non-spam documents = GetDocumentID (); Countertelling docs ++; If (class == 0) {counterTotalSpamTrainingDocs ++; } For each word in the document {freq = GetTermFrequency; // How often does this word appear in this document? Id = GetTermID; // if the unique ID of the word (square = 0) {// spam spam modell [id] + = freak; TotalNumberofSpamWords ++; // Number of total numbers marked as spam in the training docs} other {// non-spam nonspamModelArray [ID] + = freq; TotalNumb...

vb.net parsing json -

How can I parse Jason from twitter etc in vb.net applications? > Use the system's serializer class by DataContactJason. From time to time. Serialization. Jason Namespace To derail the JSON stream you can use its ReadObject method.

c# - Word 2007 AddIn does not work with Word 2010 -

I have written the add-in for Word 2007 in C # I to deliver the add-in, I click on the ClickOn Installer Employed. However, this add-in does not work with Word 2010. This generates the following error in the vsto.log file: System.IO.FileNotFoundException: File or assembly could not be loaded 'Microsoft .Office.Interop.Word, version = 12.0. 0.0, Culture = Neutral, PublicKeyToken = 71e9bce111e9429c 'or one of its dependencies failed to detect the specified file. File Name: Microsoft at Microsoft 's Microsoft. Office. Interop Word, Version = 12.0.0.0, Culture = Neutral, Public Key Token = 71 A9 BCE 1949 'in Microsoft. Visual Studio Technology. Ordis Ford Inward ITOMTOPPAirProxy..Mature (Ihost Itam Provider Extended Contract Host ITEM Provider) VisualStudio.Tools.Office.Word.Internal.IWordHostItemProviderProxy.GetProxy (IHostItemProviderExtendedContract Agreement) on Microsoft. Visual Studio.Tools.Office.Word.Internal.LocalWordServiceProvider.GetService Microsoft ser...

jstree - creating a nested - structure from simple_html_dom.php -

OK, so I'm using php based simple_html_dom.php found to scrape webpages, and do me What to do is produce a nested list that reflects the HTML element structure of the page. After all, I am planning to start JSTry using that list, but I can not find one in the previous step. I know that there is a simple straight forward solution for this, but I can not know this. I've spent hours searching the web, and finally helped post it here. Basically I want to change this: & lt; Body & gt; & Lt; Div id = 'div0' & gt; & Lt; Span id = 'span0' & gt; & Lt; Img id = 'img1' & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; Div id = 'div1' & gt; & Lt; Span id = 'span1' & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; / Body & gt; In: & lt; Ul & gt; & Lt; Li & gt; Div0 & lt; Ul & gt; & Lt; Li & gt; Span 0 & lt; Ul & ...

Apache Virtual Host Redirect: *.example.com to www.example.com -

I'm just trying to redirect to any example.com at www.example.com. Redirect to example.com at www.example.com // Sends on The following code is in my virtual host configuration file: RewriteCond% {HTTP_HOST} ^ Suksanvillas \ .com $ [nc] Rewrite rules ^ (. *) $ Http : //www.suksanvillas.com/$1 [R = 301, L] Tutorials suggest all this happening, but I am unable to understand how I redirect I am raising additional "/" PS: Other subdomains, for example, "guides.examples.com" should not be redirected. Thank you. Avoid capturing a major slash using "^ /" at the beginning of the pattern: RewriteRule ^ / (. *) $ ... With that small change everything should work a great deal.

Rails Join question with has_many relationship -

I am working to sort the table based on Railscast episodes per head. My table is slightly different from that header references an affiliate field. I have everything that is beyond peaching, when I sort by that affiliate field, it only gives to those elements who have access to this (optional) field. Here is the code that orders the case: @ user.items.joins (: location) .order ('places.title asc') Basically, a user has X multiple items, each has an alternate location. I just want to be able to sort at that place. I'm not sure how to specify that I want all the items, not just for those people who have a place. If you include (: location) / Code> Instead you will still receive all the items, even if no related location is present.

x86 - Unhandled exception in using intrinsic -

I have an application using VC ++, and in some tasks vectoring wanted to find optimization opprtunity. To start with, I am trying to get the following code: __ m128i p1; P1.m128i_u32 [0] = 1; P1.m128i_u32 [1] = 2; P1.m128i_u32 [2] = 3; P1.m128i_u32 [3] = 4; __m128i p2; P2.m128i_u32 [0] = 1; P2.m128i_u32 [1] = 2; P2.m128i_u32 [2] = 3; P2.m128i_u32 [3] = 4; __m128i res2 = _mm_mul_epi32 (P1, P2); However, when I have executed _mm_mul_epi32, I am getting an unrestricted exception or invalid operation error; I have no indication why this happens, can someone please tell me? What is wrong? PMULDQ class = "text"> itemprop = "text"> _mm_mul_epi32 map, Available only in SSE4 and AVX. For the SSE4 or AVX, you definitely need an Intel CPU recently, e.g. NEHEMMEM, Sandy Bridge (Core i5, i7). Note that you may find it easier and easier to use the interface to start the SIMD vectors, e.g. __M 128i page 1 = _mm_set_epi32 (1, 2, 3, 4); __m128i p2 = _mm_s...

Select last identity for table in SQLite? -

I am looking for the equivalent of scope_identity () or @@ identification in SQL Server, except for sqlite? I hate to resort to a maximum selection on the ID column, but it is appropriate. Since I have never used the SQL Server, I'm not quite sure that @ @ IDENTITY What does, but if I understand correctly, then what might you want?

php - Mysql Scaling for small app -

I can not buy more hardware I have 2 Gig RAM mysql Now my widget is being displayed on 57 websites with an average of 3000 views. My widget needs a 200 views per view for the best user optimization of content. Which means that there are approximately 400 inserts per second on average. What do you suggest now that I increase the speed of the insert? The data entered is divided into three tables, each of which is 80 in each and 40 are joining each. I am using mysum, I am not like INODB because I have never used it, nor am I unfortunately now using it, but a good reason persuade me to The problem is that there are approximately 1200 inserts per second in peak time, which is a real obstacle. Mainly questions are updated to increase the impression. So upgrade impression = Impr. + 1, where widget = widget_id Any suggestions to speed up database queries would be great. There may be a cache to include it, for example, in the batch, something like that. BTW, incorporates from time...

google play - Best time/day to publish to Android Market? -

What is the best day and time of day to publish the app (or its update) in the market? How did you get the best work and maximum number / downloads? We actually have 16.22 GMT We did not actually research before, it seemed that many apps were not updated around that point. If you are releasing it, download it and rate it immediately (and become friend) to do this), I saw that some apps are being released without the same time and I can not support the data with it, I think it had some effect. In addition to this there is not really much to do on the market and it really depends on how good your app is. Be sure to describe well with some keywords that you want to "rank" in. Get your app and more websites like this on the app्रेन. Your app will be there anyway because they scour the market but you can add youtube-clip and more screenshots, though Google's developer backend still supports those things. We have some big leap; the number of downloads due to th...

php - Regex help (extracting data between hr tags) -

I am trying to remove teaser text within TinyMCE in a PHP CMS In my design & lt; Hr / & gt; tag is not used, so I want to remove the text in the following scenario based on the assumption that Content Administrators will only use to define teaser text: a & lt; Hour / & gt; Remove the content before the tag (Content administrator in the status admin uses the cuttof point as the beginning of teaser text, and then as & gt; ) 2 & lt; Remove content between hr / & gt; The tag (in which case the content administrator enters teaser text anywhere within the content, and it points to any with the and tag What should I use to regex to cover the above? if (preg_match (' ~ ^ (. *?)) & Lt; hr / & gt; ((. +)) & Lt; hour / & Gt;); ~, $ Test, $ match) {// at least one & lt; Hour / & gt; Is present (empty ($ matches [2])) {// no other & lt; Hr / & gt; $ Teaser = $ matches [1]; } And {// a second & lt; Ho...

linux - simple upper-casifier loop infinitely -

Simple upper-capsifier loop infinity What's wrong with my code? Any advice? Linux, MX, Assembly, AT & At Syntax environment of my programming environment .section .data .section .bss .lcomm buffer, 1. Text .gobal_start_start: movl% esp,% ebp subl $ 8,% esp # 8 (% ebp) is 2 rg == input # 12 (% ebp) third rg == output # open, read, open, write, $ 5 ,% AX MLL, 8% (EBP),% EBX MLL $ 0,% XX MLL $ 0666,% ADX Intex $ 0 x 80 #% Ax Input FD # MOLL First Local VRL MLL AX, -4 (% EBP) Movl $ 5,% eax movl 12 (% ebp),% ebx movl $ 03101,% ecx movl $ 0666,% edx int $ 0x80 # FD of output in AX # Second local square in MOVL movl% eax, -8 (% Ebp loop: 1 byte to file Type # $ 3,% eax movl-4 (% ebp),% ex movl $ buffer,% ecx movl $ 1,% edx int $ 0x80 #buffer, 1 byte of file in cmpb $ 0, buffer program_exchange custom buffer call convert #will return% al addl changes to $ 4, write% esp movb% al, buffer # 1 byte buffer $ 1,% edx movl $ buffer,% ecx movl -8 (% ebp),% ebx movl $ 4,% eax int $...

need help with php curl -

I have two files that send a curl post and the one who gets the post runs a query. $ curl = curl_init (); Curl_setopt ($ curl, CURLOPT_URL, "http: //url/filename.php"); Curl_setopt ($ curl, CURLOPT_SSL_VERIFYPEER, FALSE); Curl_setopt ($ curl, CURLOPT_POST, true); Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ curl, CURLOPT_SSL_VERIFYHOST, incorrect); Curl_setopt ($ curl, CURLOPT_POSTFIELDS, "col1 = data and col2 = moredata"); $ CurlResult = curl_exec ($ curl); Curl_close ($ curl); Print_r ($ Curls Result); If ($ curlResult == "accepted") {echo 'right'; } And {echo 'wrong'; } The problem even if print_r shows 'The' if '' statement still fails. What am I missing? Any help would be awesome. The cause of CURLOPT_RETURNTRANSFER returns curl_exec () either false or string. So the question is whether it is an array or not, it can not be, because it is a string, therefore, you need it somewhere els...

ruby - Rails 3 / Devise: Checking to see if users have any of multiple roles -

I have a user model with the devices, and I have established the roles so that the user assigned one or more role Can go If I say to check the role of the user in a scene, the following code works ... You are an administrator! & Lt;% end% & gt; But now, suppose I want to see that the user has many roles, to see if he is an administrator or editor. I was certain that the following would work .... ... but it is not so, it only works if you are an administrator and ignored checking that list of all other roles after the first one in that list. I have tried Role.find_by_name (['Administrator', 'Editor']) and other combinations for not being successful. In fact, how do I format it to check for a number of formats? I have hunted all over Google, but all the examples have a role as well. The first problem is that when you use the syntax 'Administrator' 'Editor' will not create a SQL or syntax instead, instead it evaluates Ruby tha...

iphone - how to gather Instruments memory/zombies data after removing & restarting app in the simulator? -

How can I collect device memory / zombie data after removing the app in the simulator and restarting it in the simulator? What do I see after removing the app process in the simulator, and then want to do it again by clicking on the icon's icon in the simulator, did the device stop receiving data from the app? Backdrop I'm trying to test and save data through NSUserDefaults to save the loading part after testing it by saving me the memory To remove the app, there is a need to simulate, so I'm manually removing the app process on the simulator (double click on menu button etc.). I know what's going to happen when I run the app, there is some problem with this kind of startup - "Thread 1 - Program received signal" against Sigil "Int Rated = UIPPlaymenmmen (argc, Argv, Zero, zero); "Line of code" So I thought I would try to run the devices to track this issue, so my question is because after killing the app simulator on the device si...

php - How to change current pagination to show "back" and "next" instead of page numbers? -

I just want to be able to show "back" if the user is on another page but page # 1 and then "Next" should be shown on all pages, except for the last page / * Setup for page wars * / if ($ page == 0) $ page = 1; // If no page is given var, for default 1. // next page page + 1 $ lastpage = roof ($ total_pages / $ limit); // Last page = Total page / page per page, rounded. $ Lpm1 = $ last page - 1; // Final page zero 1 / * Now we apply our rules and attract the object of panning the page. We are actually saving the code in a variable, if we want to attract it more than once. * / $ Paging = ""; If ($ lastpage & gt; 1) {$ points on the page. = "& Lt; div class = \" endorsement \ "& gt; & lt; / div & gt;"; // If the last button ($ page & gt; 1) $ endorsement = ""; And $ Pagination = ""; // pages ($ lastpage & lt; 7 + ($ impending * 2)) // There are not enough pages to break it ($ counter =...

svn branching problem -

I have my source on / tmp / easton / two folder 1 src and 2 webroot now i have svn checkout / var In the / www / html / easton folder. After this I have to import it two. Src (Including Java files) 2. Webroot (/ WEB_INF / classes) My / var / www / html / Easton For this I have made svn import / tmp / easton svn: // localhost / easton , it has created two folders in the repository. Now I have to check my WebRoot directory in / var / www / html / Easton. For this I am going to CD / var / www / html / easeston , then svn with svn: // localhost / easton / webroot Create a Web Directory in / var / www / html / easton. Here is my suspicion that I do not want to create a WebRoot directory in / var / www / html / easton. But copy all the folders to my / var / www / html / easton. For example, my WebRat has two folders. Web-Enf 2. Page so I want to copy these two to / var / www / html / easton / WEB-INF..Pages Please help me in this. This is svn branches when I decrease the c...

How to build HTML email using CSS? -

Can I just create HTML emails like we make HTML pages? I want to set the email body as a string all HTML code. The email body will become complicated, so I have to use a lot of CSS to create a page HTML email. What should I do? Store the CSS code? Can I External from My Server Now? Can I include a CSS file? Although it comes back completely and what I would suggest for web pages, in the email The best way to use CSS is inline in all the style features. The reason is that many email applications and especially web mail such as Gmail, Yahoo, Hotmail etc. do not respect your CSS class announcements And will often erase all of your CSS, when Not inline. Too many whole time & lt; Head & gt; is deleted and many times the & lt; Body & gt; tag is removed if you include it in your email. If you are just beginning to create HTML emails, then I recommend using Litmus or manually testing on different types of email clients. Litmus or any other similar servic...

automapping Entities in nhibernate -

I'm having a slight problem mapping all the entities contained in the namespace "nhibernateTest.Domain". It basically includes all map classes such as studentmap, departmentmap etc. Now what we used to do in the case of general nineteen: Private Eationfinder _sessionFactory; Private configuration _configuration; [TestFixtureSetUp] Public Zero TestFixtureSetUp () {_configuration = New Configuration (). Configure (). AddAssembly ("nHibernateTest"); _sessionFactory = _configuration.BuildSessionFactory (); } What to do now is to see all "* .hbm.xml" files in my namespace and automatically map them ... Can anyone tell me how to do this for fluent nHibernate? So that it looks for all map squares and automatically maps them so that I have to make sessions different for different map sections? You must specify your mapping when configuring Fluent NBibernate in your application. This is usually done by . Briefly. Database (/ * Your Database S...

tf idf - Calculate Cosine Similarity Using java Program -

I have a problem calculating the equality measurement for developing a search engine for my final project. In Java, I have to use the TF IDF + cosine equality and I have no idea how to calculate it. For your information, I have my own database that has 811 documents Calculate the cosine equality of vector u and v, consider u and v as normal and then get the product of u and v. This means that the vectors are the same and there are numerical vectors (see) coding such operations are trivial, and some people did this for you, like here In a search engine, cosine parity How much object can be a measure of one match. Your query is an object A, calculate the cosine parity for all the object b in your database / store / whatever, b objects sorted by decreasing equality. If your objects are numerical vectors, then it is easy. If not, you have to prepare a way to convert your objects into digital vectors. For example, for text data, the vector may contain the number of keywor...

hibernate - Problem in Criteria with Inner Join -

मैं निम्नलिखित कोड के साथ एक क्रैतिया चला रहा हूं .. मानदंड c = session.createcriteria (BasicTransaction.class); C.createcriteria ("मूलप्रतिसंस्कार प्रकार", "मूलप्रतिसंस्कार प्रकार", मानदंड विनिर्देशन। INNER_JOIN); //c.setFetchMode (शब्दावली ट्रांसेक्शन टाइप), FetchMode.JOIN); C.add (प्रतिबंधों। और (प्रतिबंधों। ("आईडी", एल), प्रतिबंध.ईसी ("isCommon", सच है))); वापसी c.list (); जहां "basicTransactionType" है enum यह FetchMode.JOIN के साथ ठीक है लेकिन मानदंड स्पष्ट .INNER_JOIN अगर कोई समझा सकता है? FetchMode.JOIN एक बाह्य शामिल प्रदान करता है, जबकि मानदंड स्पष्ट। INNER_JOIN एक आंतरिक शामिल निर्दिष्ट करता है। इसमें समस्या के साथ कुछ हो सकता है।

c++ - How do I know which STL string implementation I'm using? -

Item 15 Effective STL says there are at least 6 different implementations of Study :: String. But if I should know what implementation I am using, how will I know which implementation I am using? Std :: does not see the string source code of GCC (this is all in .so file), so how can I find out? Nothing could be found, so in future I need to see such information, where can I find it? & lt; String & gt; Look at the header and see the copyright? I will add to that, which I know, std :: string a typedef of basic_string , then now, of a template class, which I remember, only supports Kamu C ++ "Export" template, so all other compilers need to set and implement template class in header files. If you are using GCC then maybe & lt; String & gt; In the header you will find a large piece of string implementation (I will add that this is a common trick that calls to reduce the size of the non-temp class compiling to create a "template" / "pr...

textview - Android: I'm getting a force close message when I modify main.xml file -

main.xml: & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "यूटीएफ -8"? & Gt; & Lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" एंड्रॉइड: ओरिएंटेशन = "ऊर्ध्वाधर" एंड्रॉइड: layout_width = "fill_parent" एंड्रॉइड: layout_height = "fill_parent" & gt; एंड्रॉयड: layout_height = "wrap_content" एंड्रॉइड: layout_height = "wrap_content" एंड्रॉइड: textSize = "30sp" एंड्रॉइड: textStyle = एंड्रॉइड: text = " "बोल्ड" एंड्रॉइड: टाइपफेस = "सेरिफ" / & gt; & Lt; / LinearLayout & gt; जावा फ़ाइल: setContentView (R.layout.main); अंतिम हैंडलर mHandler = नया हैंडलर (); अंतिम टेक्स्टव्यू टीवी = (टेक्स्टदृश्य) ढूंढें वीवीबीआईआईडी (आर.आईड। कस्टेट टेक्स्ट); tv.setText ( "चला रहा है ..."); setContentView (टीवी); जब मैं इसे चलाता हूं, तो मुझे बल संदेश बंद हो रहा है। मैं एंड्रॉइड देव के लिए नया हूँ। बहुत पहले धन्यवाद ..: / ...

Reading .csv file in php -

I want to read the CSV file in PHP and put its closing into the database. I wrote the following code: $ line = 1; $ File = fopen ("qryWebsite.csv", "r"); While ($ data = fgetcsv ($ file, 8000, ",")) == incorrect) {$ num = count ($ data); $ Line ++; {$ Dcho $ data [$ c] "\ n";}} fclose ($ file) for ($ C = 0; $ c & lt; $ num; $ c ++); I have not received any error but it does not show me results. I am using class to read data from CSV files. This CSV file can give more flexibility in reading.

c# - how i can test the connectionstring in Mysql -

I have a connection string in mysql and how can i check whether valid or not is that i have connectionstring To test well, other software offers many software-like functionality, one option is called something like test connection [based on connectionstring]. A Connected Server Version Or create some generic data that you know for sure will exist on the database server, for example, I read the @@ version in the SQL server in SQL Server which is the version of the SQL Server user and the version Shows The connection could not be established if no version was returned.

c# - XMLSerialization and XML Schema validation -

Is it possible to use XML schema recognition and XMLSerializer simultaneously? My project currently uses XMLSerializer to validate the schema, we are probing the pricing values ​​such as: if (String.IsNullOrEmptE (Person.Name)) throwing new exceptions (); Thanks! I would suggest using XmlValidatingReader to validate schema, please see for an example. .

regex - Regular expression for certain amount of characters -

I am trying to change many URLs with TextWrangler, which is m.htm m should be lost, but only the total number of characters in the file name is 7. People with fewer characters should not be changed. I have tried /.*? {7} m.htm / but it does not work ... What is the solution? change href = "([^"] *) Meaning: href = " after any non " character until a / (better than the latest: greedy) then 6 characters after a m , then any " The character is not href = "1 \ / \ 2.htm \ 3" mean: \ 1 = [^ "] * \ 2 = {6} \ 3 = [^ "] * Example & lt; a href =" google.com/foo/bar/urzadjm. If the files can be htm and php , then I recommend to replace .htm with (.htm | .php) ) (Warning to change the context behind the numbers!)

Can someone help me set up Ninject 2 with Log4net? -

I'm using Ninject (happily) for some time with basic scenarios, I want to give control to my entry I have mentioned the existence of Ninject.Extensions.Logging Nameshot, and want to use it, but I am running on two issues: I want to The logger should be started like this the class is running it (as I get GetCurrentMet LogManager with hod () has rungotgog). Type the disclaimer. I can easily duplicate or "expel" Now, I know that for unit testing (ie I do not have to work), NullReferenceExceptions without running in Here are some questions (and even answers), but I feel that I am unable to find anyone in the right direction. I appreciate any help (even "you bone-based" here it is! I should have had some attention ). This is the default behavior of extensions Testing in your unit tests Do not use Ninject to create an object under. Manually create an event and pass it to whatever logger you want. Take a look at the best you unify

facelets - jsf h:messages/ h:message for specific clientId -

I would like to display different face messages with programmable set client EIDs. In my opinion I & lt; H: outputText value = "Warning message # {FaceSpace.GetZlight ('Warning message')}" /> is used I & Lt; H: output text value = "verification message # {facesContext.getMessageList ('verification message')}" /> Messages for debugging are all but ... for & Lt; H: Message = "Warning message" /> for does not display anything & lt; H: Message / & gt; Works but I want to show different message boxes. How can I do that? Thank you Marcel It seems that you have been censored with different client IDs Custom / Global Messages from General Verification Messages You should not do this. If you want to display custom / global messages, just do not specify a client ID. IE, set it to null . context.addMessage (empty, face message); That way they all And use the queens of messages ...

android - Need to implement leveler in a View of Androird? -

I need to implement the layers while viewing my application, where I have the code for the level provided by Google I have to apply it to my app This is the main of the bubble level. Xml, & lt; Net.androgames.level.view LevelView Android: id = "@ + id / level" Android: layout_width = "fill_parent" android: layout_height = "fill_parent" /> See how I can embed this project in my App view. I think, you can easily set up this scene in your activity: setContentView (yourLevelViewObject); Or if you want to add this view to any layout, you can use it: yourLayoutObject.addView (yourLevelViewObject);

svn: post commit hook -

We use VisualSVN servers for code synchronization ... and I would like to add some common tasks after each commit . They are quite normal ... making directories, creating zip backups and so on. So I wrote a CMD script to do them but it can not be executed. I did the following: In the properties for my repository folder on the "hook" tab, I wrote a call c: \ script.cmd 2 c: \ script.cmd; I also tried to use quotation marks ... and finally In the exit "text"> any error code ? Try testing the script by running them from the command line. Windows and / or very little documentation about it, but try to go to the actual repository through the command line and edit the template post-commit hook in the actual hook and run it from the command line, what happens there? On one side, it raises an eyebrow that you are trying to do this in the post commission hook.

javascript - jquery: do something when 'hover' is unbinded on '.myBox'? -

Is it possible to do this in Jquery when I do .mybox ? I want to add the plugin that was making me in the plugin first, it was not sure how? There are specific things that I want to be always done when CSS ('cursor' 'default') and some other things are a way of unintentionally triggered, when sharing stuff without the goods Without it? The only way to do this is to expand the unbind function: (function ($) {var unbind = jQuery.fn.unbind; JQuery.fn .unbind = function (type, function) {var matched elements = this.filter ('# matchedElement1, # matchedElement2'); If (matched elements.lamp & amp; amp; amp; type = = "String" & type == "mouseover") {// blah blah, whatever you wanted to do (to do the Elements instead of this.). Unbound return. Apali (this, The Uments); // to call the actual unbind handler.}} / * Rest of your plugin * /} (jQuery));

html - get text of a list on click using jquery -

I'm trying to get value from an HTML list & lt; Div id = "test" & gt; & Lt; Ul & gt; & Lt; Li & gt; C: \ & lt; Ul class = "leftbutton" & gt; & Lt; Li value = "list1" & gt; Folder 1 & lt; / Li & gt; & Lt; Li value = "list2" & gt; Folder 2 & lt; / Li & gt; & Lt; Li value = "list3" & gt; Folder 3 & lt; / Li & gt; & Lt; Li value = "list4" & gt; Folder 4 & lt; / Li & gt; & Lt; Li value = "list5" & gt; Folder 5 & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; I used the following code $ ("# test li"). Live ('click', function) {alert ($ (this text ());}); If I click on List 1, Warning Now my problem is that I need to get a warning C: \ Folder 1 if I click on List1 and C: \ Folder 3 if I click on List 3 Edi...

Run a macro before Access 2010 web database application instance initializes -

Do anyone know how to run a macro before the start of web database application installation? I want to set some local variables to be used in some queries that first run on the load of the form. Please help, I can not find it anywhere. Access 2010 is running inside Web Database SharePoint You just need to be able to set your variable If you do not believe this, you can always open your application a boiler-plate form, set the variable, and close the boiler plate. And can open the actual first form. It can be so fast that you ignore the boiler plate screen. Reminder: Since you are using Access Services, in your app

Captcha Code Case Sensitiveness in Codeigniter -

How to set up a captcha code in uppercase Whether there is even more help in addition to the codeigner for their collision. To create a captcha with uppercase characters, something like this is needed: $ vals = array ('word' = & gt; strtoupper ('random word'), // here is the captcha code uppercase 'converted to img_path' = & gt; './captcha/ ',' Img_url '= & gt;' http://example.com/captcha/ ',' font_path '= & gt;' ./path/to/fonts/texb.ttf ',' Img_width '= & gt; '150', 'img_height' => 30, 'expiration' => 7200); $ Cap = create_captcha ($ vals); Countercap $ cap ['image']; Of course you may have to check the SQL while checking and it may need to check for the uppercase version of your random word in the database.

WCF - How to use IDataSurrogate to exclude the data member depends on client requirement -

I have a data contract with 6 properties. A customer needs the first 3 properties and the other client needs the last 3 properties of data contracts. How to write a data contract in the service so that the service only send messages with the necessary properties? The right way to do this is to create a separate service for each customer. Using their own data contract will expose the operation. Both services will be completely wrapped around your original argument that works with data objects. If the reason of sending only the lowest subset of properties is data security, then creating two services is the only legitimate option. If we consider more information about this, then here is a description of the problem in the service description. If you expose Metadata / WSDL on your service then there will always be an entire data contract because you can not change it dynamically. If a client creates a proxy from these metadata, then this entire agreement will also be received. ...

python - Django query question -

I have a View & amp; A template that displays a list of items types is fine, but rather than displaying all kinds of items for that customer. What do I want to do, list of type individually is displayed For example, if an item is a type stored, say "normal". I want to display all the items that have only one type called "normal". View def client_summary (request, client_id): Client = any item = no attempt: client = model. Client.com.gate (pk = client_id) item = client.storageitem_set.all (excluding total_items = items.count (): Return HttpResponse (reverse (return_clients)) return to render_to_response ('client_summary.html', {'item' {item}, 'total_times': total_times, 'customer': client}, context_instance = RequestContext (request)) template Client.name}} Total number of items: {{total_items}} {% for item in items} {{item.type}} {% endfor%} You can try 'client.storageitem_set.filter' (type = YOUR_T...

android - How to make ready APK file for publish means export? and what are the parameter to set? -

I have made a small application in Android and I want to publish it on the market. So what are the parameters defined in the Android manifest file first? Please help me. When using Eclipse with Eclipse and Scribing ADT with Eclipse ADT, you can export a signed .apk You can use the Export Wizard (and if necessary, create a new keystore) the Export Wizard prompts you with all the interaction with the Jerseys and you can access it through a graphical interface instead of the command line The permissible Since the Export Wizard uses both Keitoll and Jerseyer, you should make sure that they are logging on your computer, as mentioned in Basic Setup to sign up. To create a signed. APK, right-click the project in Package Explorer and select Android Tools; Export signed applications package (optional As such, open your Android manifest.exe file in Eclipse, open the Overview tab, and click Use Export Wizard.) The window that is showing any errors found in your attempt to export y...

apache - How to use Shiro for authenticating cookie based or facebook user? -

In my web application, I do not have user registration / login. I have user account automatically when user cookie Based on the first time the site goes on. For this purpose how can I use Shirk for this purpose (and also take advantage of its other web security features)? If the user chooses to log in via Facebook connect, how can I use Shirk this scenario? Well, Johnson told me that the linked blog post does not work and passed by some time , I started my answer again. In my understanding, OAuth does not support Apache's head (at the time of this writing), comments on them and comments on them too. > There are two libraries that normalize OAuth, and Used by the sketch, which includes a bridge between the writers and the head. Used by Pac4J, see that the Web Multi Protocol Client for Apache Header is available for Facebook authentication on the linked page. I suggest using this demo as a starting point. Please read and make sure) If you want to use OAuth 2.0...

c# - Float with either comma ',' or '.' -

I am experiencing a problem while converting a string to float while using C # in asp.net . In the local database, this '.' Works well with marking for float values ​​but after uploading the website to the server it does not work. I think the server only understands ',' instead of ''. ' I remember that I read it somewhere that I have some culture information web I can add to the configuration so that float can understand. ' Or ',' and how can I change it for the WinForm application globally? Thanks in advance. You can but you should not do it if it is rooted with the purpose of your code, its Use . should be used as a decimal separator, then you should explicitly use the appropriate culture infode: double d = double.Parse (str, cultureInfo.Interiorticulture); // format as a decimal separator, even if it is the present culture. This is only when you want to parse according to a culture, which is a culture information Should b...

java - How does MOXy's xml-transient declaration work? -

I have a set of beans in a separate project that I can not change in both the JAPA and JACAB Annotations , And they are being used in a strict implementation. Most of my relationships are lazy-loaded, and I was hoping to get some more comprehensive controls on which the elements are actually martial for transport. I've got modified MOXY Customer.java class below. @ javax.xml.bind.annotation.XmlType @javax.xml.bind.annotation.XmlAccessorType (value = javax.xml.bind.annotation.XmlAccessType.PROPERTY) public class customer {personal String name; Private address addresses; Private list & amp; Phone number & gt; phone number; // getters and setters} I would have been able to use MOXY eclipselink-OXM mapping to control what would be martial, but it is not behaving As I expected. Using JAXB annotations, you declare an element (field or property) to be transient, but Eclipsellic-Oxm.XML only allows transient declarations on types. However, when I declare a transient typ...

javascript with many html pages -

In fact, I have a JavaScript and I need to use it from many HTML pages, but I can not modify the amendments Need to keep, so if an html page has changed some variable values, then you can see other HTML pages change, like some fixed variables, can anyone help? Three ways: It seems that there is a new web development for you now, it may be time to learn about them, I have provided links for reference, but this is easy Can be searched from.

java - How advisable is migrating to spring framework? -

We currently have a framework (a customized MVC pattern in Flex and command pattern in Java) which is our use case Works well with We are thinking about the migration of our servers to the spring structure, how is this advice? Our Java framework is also loose paired. But I see a lot of procrastination in spring with some concepts, relying on dependency injection and control (which I still need to get some ideas). Basically what kind of use-case people use spring. is? .If it is advisable to do well I also know where to start from. Using a frame like spring or Guice helps keep your applications organized and time Can be coupled with loose. The dependency injection framework essentially removes the object construction from any object, so that instead of any architectural concerns it can be focused on what needs to be done. Another advantage to using dependency injection is that your application is no longer concerns about the creation of the object, in this way you can freely e...

display xml data present in table column into datagridview control c# winforms -

Image
I am using DataGrid View Control of C # Winform to display the data present in the table. All data present in the database table is currently displayed to the user, except data in the last column, which contains data in the XML format. The DataGride View control in the data is displayed as the last column always empty, but in reality the last column in the database contains XML formatted data. The GUI settings for the last column of DataGridView control are shown below: Can someone suggest me how to display XML formatted data in this DataGride View Control? There is no direct way to get XML attribute / node values ​​through XPath using a stored proc You have to get from You can start with

c++builder - Get program files directory from Windows in Borland C++ 6 -

Let me make an executable (Borland C ++ Builder 6) instead of a batch file for Windows 7 Because, not allowed ordinary users (non-administrator) to allow required batch run, we have several different Windows 7 machines, some 64 bit and some 32, etc. The problem I'm running in is "coded files" directory is hard coded in the program, but it is not always true, the program file directory, which leads to some errors on some machines. I am familiar with the method of taking the program file diary from the registry, but I'm afraid that it will not work on all machines because the program does not allow access to the registry due to permission settings. I am searching high and low for functions like GetWindowsDirectory , but it has no advantage. Does anyone have any suggestions? EDIT: I have programmed it on Win XP on Win7 (there is no way to change or prevent XP / 7 stuff, as it may be crappy). This is a simple utility, which does not require installation; It's...

Weird JavaScript statement, what does it mean? -

I'm looking at this code, what is this doing? var obj = this; This only stores the current context of the this object This is useful for future use, because in this value of , depends on a reference.

Search and replace REL attribute with jQuery -

I want to search the link and change the rel attributes if rel currently equivalent attachement . I have a code so far: $ ("href"). Each (function (index) {$ (this) .attr ('rel', 'group');}); If you are trying to test some relay value (assuming "Attachment"), all you have to do is: $ ('a [rel = "attachment"]'). Attr ('rel', 'group'); It says that & lt; A & gt; rel = "attachment" , rel with "elements"> for the "group". On the other hand, if you have all the elements with the href attribute, then you will use something like this $ ('[Href] [rel = "attachment"]') attr ('rel', 'group') .;

android - how to show dotted border to table layout -

I'm new to Android, I want to show the border in table layout. Can anyone help me, this is very important to me. Try setting the background as an element that you want to limit on. You can define a size dragable in the XML file in your res / drawables folder. Specifically, the stroke element contains dashWidth and dashGaps parameters that make you a dashed line: & Lt; Stroke Android: width = "Integer" Android: Color = "Color" Android: dashWidth = "Integer" Android: dashGap = "Integer" /> You can also set repeat repository dots image as the backdrop of the entire table, then set a solid background and margins on the cells (see, about the concrete boundaries Written, but I 'm sure you can make a checkerboard pattern fake with 2x2).

workflow - Dataflow computing in python -

I have n (usually n & lt; 10 but it should be scale) the processes are running on different machines and Communicate using rabbitmq via amqp. Processes are usually going on and can be implemented in any language (although most are Java / Python). Each process requires multiple input (number / wire) and also produces multiple output (numbers or strings only). Executing a process is asynchronous: sending a message to your input queue and waiting for the callback to be started by the output queue. Ideally the user specifies some input and desired output and the system should: Determine what process is required and generate dependency graphs topologically sort graph and execute it, the node transition will need to operate the event A node should fire, if its input is ready, Allow. I can not take any chakra for now, but eventually there will be chakra (ie, two processes may need to be repeated, until the output does not change till now). This should be a known problem ...

c++ - Solaris shared libraries and global variables -

I have a problem with the global variable in the shared library on Solaris, consider the following sample: square fu {public: fu () {init (); } Private: Zero Init () {// do something}}; I have some code in the shared library: foo j_fu; I have seen that the FU constructor is never called on Solaris, while the same code linux works. I am using gcc 3.4.3 and Sun linker. Are you composing the shared object with the -g flag? Like CC-GO Mylib.So MyFile CPP If you do not specify -G, then the compiler can not start the global variable properly. See compiler documentation. Note, the document also says that you can not use LD, but need to use CC to link.

function - how to cap a php int value -

I'm doing some calculation with php and I want to be above number 100 example I do not want 50 + 80 to 100 and 130. Basically capsize any result up to 100. Thanks This is either $ sum returns if $ sum 100 or 100 otherwise.

rubygems - How to search for gems inside of Ruby code, or where did Gem::RemoteInstaller go? -

In Ruby Cookbook recipe 18.1, it is said that gem :: Remote Installer New.search ('rails') can search gems at remote sites, default on rubygems.org but I have Ruby 1.8.6, 1.8 Tried .7, and 1.9.2, and all of this says in ` I have tried before requires' rubygems' and even is required 'rubygems / remote_installer' What is the use of gem inside Ruby? Is there any new way? (Please do not reply to the system like "gem list rail") Gems: Remote installer has been removed from Rubiagam since version 1.0, it was some time ago.If you seek the ability to set someone with a gem Those who do not need, then I strongly suggest the bundler (a right, you can try: requires 'rubygems' R = Gem :: SpecFetcher.new r.suggest_gems_from_name ('Rail') = & Gt; ["Rail"]

asp.net - open jQuery Dialog from codebehind -

Then I have to show the jquery UI dialogue with codebehind. I have tried to do everything: ,,, test to change those answers, if it works with me, but is not working. I am using the first solution because it is systematic, it works if I use the warning ('whatever') instead of my jquery communication code, so I know its work, but something with the dialogue Not even I have tried with colorbox, and it is not working either. Can anyone give me an alternative solution? It will be apreciated. Thanks. My aspx: HEAD & lt; Script type = "text / javascript" & gt; Function BindEvents () {$ .fx.speeds._default = 1000; . $ (Document) .ready (function () {var dlg = $ ("# DivMostrarIguales") dialog ({AutoOpen: false, show: "folding", hide: "clip", width: 500, height: 500}); Dlg.parent (). Attachments (jQuery ("Form: First"));); } & Lt; / Script & gt; Endhead & amp; Lt; ASP: Content ID = "Content 2" co...

php - Looping through a nested array, testing and outputing results with the same structure -

Hi, I wonder if anyone can tell me in the right direction with this problem, I do not know where to start from. I have an array that follows this structure array ([0] => array ([day_id] => 1 [plan_id ] = & Gt; 3 [Day_num] = & gt; 1 [Schedule_time] => 1300866720 [Checkin_time] => [OK] => [1] = & gt; Hey ([day_id] = & Gt; 2 [plan_id] = & gt; 3 [day_num] [& gt; 1300953120 [checkin_time] => [fine] => [2] => Hey ([day_id] = & gt; ; 3 [plan_id] = & gt; 3 [day_num] = & gt; 3 [schedule_time] => 1301039520 [checkin_time] => [fine] => [3] => Hey ( [Day_id] = & gt; 4 [plan_id] => 3 [day_num] = & gt; 4 [schedule_time] => 1301125920 [checkin_time] => [fine] => gt;) What do I do It wants to be loop through the trial 'schedule_time' for a specific time, if it matches the entire array, then it is saved in the new array ([0] => 1 [plan_id] = & gt; ; 1 [plan_id] => 3 [day_num] ARA ([0] =...

sql - Select with grouping in MySQL -

मेरे पास 2 टेबल हैं: 'pay' | id_tax | मूल्य | id_currency | -------------------------- | 1 | 100 | 12 | | 1 | 200 | 12 | | 1 | 300 | 13 | | 2 | 200 | 12 | | 2 | 200 | 12 | -------------------------- 'दर' | id_currency | दर | ------------------ | 12 | 1 | | 13 | 6,12 | ------------------ इस में SQL क्वेरी का क्या परिणाम होगा? | id_tax | मूल्य | ----------------------------- | 1 | 100 * 1 + 200 * 1 + 300 * 6,12 | | 2 | 200 * 1 + 200 * 1 | ----------------------------- SELECT id_tax, SUM (मान * दर) से भुगतान पी जॉइन रेट आर पर r.id_currency = p.id_currency GROUP BY id_tax

static analysis - Python code checker for comparing a function as an attribute -

I sometimes spend a lot of time tracking Brenforts in my code ... while I usually Pillint Runs There are some things that are past Pilot slip, the easiest problem to ignore me is this ... Neither pylint nor python bark about this ... Is there a Python code-checking tool that can flag this particular problem? How can you validate a code-checker? This is a completely valid syntax, instead of examining this kind of mistake, it would be better to improve the habit of using a better pattern. Instead of: variable = 'fOoBaR' variable .lower == 'foobar': # ^^^^^ & lt; ------------------ should be there. Lotus () do_something () Do this: variable = 'fOoBaR' sane_variable = variable.lower () if sane_variable == 'foobar': Do_something () In this way you are always calling clearly .lower () at the price you are comparing, instead of these Instead of depending on the call and comparison of the Place Method, you are experiencing a lot o...