Thursday, 15 September 2011

iphone - Using self in method call -


When the property / synthesize for UITableView, UIButton, etc. is being used, the method on that variable is included in the call should be there? Using UITableView as an example is the difference between [self.myTableView visibleCells] and [myTableView visibleCells] ? Or [self.myImage setImage: ...] and [myImage setImage: ...] ?

I have seen that Apple code uses the self (bubble level) and the first iPhone development of books that do not use themselves, I want to understand it better, especially since in your UIScrollView method call Using the self has caused irregular / buggy scroll behavior because using self.myTableView is another way of saying

< Div class = "post-text" itemprop = "text" [self myTableView] (This can also be done with [self set MyTableView: ...]; If an assignment is used in the statement) In other words, you are executing a method. Using

myTableView directly accesses the instance variable.

Personally, I usually prefer to use the pre-method because it usually frees me from memory management manually and gives me the benefit of KVO information. However, the additional method is the minuscule overhead of the call, which you may wish to avoid.

Which style you prefer to use, depends on you, and its benefits and disadvantages in every way.


regex - Java regular expression to match _all_ whitespace characters -


I am looking for a regular expression in java that matches all the spaces in the string. "\ S" only matches a few, it's & amp; Nbsp; and similar non-Eski Whitespace I am looking for a regular expression that matches all (normal) white space characters that can be in Java string.

[edit]

To clarify: I do not mean string sequence " & nbsp; " I mean sincle unicode character U + 00A0 That is often represented by "" and ", in HTML, and all other Unicode characters with the same white-space meaving, e.g. In the form of "Narov no-space" (U + 202F), Unicode 3.2 and above, U + 2060 as word adder, "zero Vodate no-space" (U + FeFF) and any other character white. Space

[Answer]

The following expression works for my pupose, i.e. all the blank space characters, Unicode + conventional capture:

[\ P {Z} \ s]

The answer is in the comment below, but since it's a bit hidden I repeat it here.

& amp; Nbsp; Use only one to extract plain text in HTML is white space. And \ s should work properly.


What is the best way to eliminate MS Visual C++ Linker warning : "warning LNK4221"? -


मेरी एक सीपीपी स्रोत फ़ाइल है जो #if / #endif कुछ बिल्डों में पूरी तरह से संकलन करने के लिए हालांकि, यह निम्न चेतावनी उत्पन्न करता है।

  चेतावनी LNK4221: कोई सार्वजनिक प्रतीक नहीं मिला; संग्रह सदस्य दुर्गम हो जाएगा  

मैं एक डमी चर या फ़ंक्शन उत्पन्न करने के लिए एक मैक्रो बनाने के बारे में सोच रहा था जो कि वास्तव में उपयोग नहीं किया जाएगा ताकि यह त्रुटि हट जाए लेकिन मैं यह सुनिश्चित करना चाहता हूं कि यह कई फाइलों में मैक्रो का इस्तेमाल करने जैसी समस्याओं का कारण नहीं देता है, जिससे लिंकर को परिभाषित प्रतीकों पर बम मारना पड़ता है।

इस चेतावनी से छुटकारा पाने का सबसे अच्छा तरीका क्या है (बिना चेतावनी को दबाने के लिंकर कमांड लाइन)?

एफडब्ल्यूआईडब्ल्यू, मुझे लिंकर कमांड लाइन पर चेतावनी को दबाने से यह कैसे करना है, यह जानने में दिलचस्पी होगी, लेकिन मेरे सारे प्रयासों को लिंकर द्वारा अभी तक अनदेखा किया जा रहा है और अभी भी त्रुटि उत्पन्न करता है।

एक अन्य आवश्यकता: हमारे निर्माण विन्यास में से एक एक थोक निर्माण (एकता की तरह) के बाद से फ़िक्स व्यक्तिगत फ़ाइल बिल्ड या एकता निर्माण (सीपीपी फ़ाइल निर्माण को संयोजित) करने में सक्षम होना चाहिए एक एकल मास्टर एकता फ़ाइल की बजाय बल्क फाइलों का निर्माण लेकिन समूह)।

एक अज्ञात नेमस्पेस का प्रयोग करें:

  नामस्थान {char dummy; };  

ऐसे नेमस्पेस के भीतर का प्रतीक बाहरी संबंध है, इसलिए निर्यात तालिका में कुछ होगा। दूसरी ओर, नाम स्थान का नाम ही प्रत्येक अनुवाद इकाई के लिए अलग होगा (आप इसे "बेतरतीब ढंग से तैयार" के रूप में सोच सकते हैं), इसलिए कोई संघर्ष नहीं।


asp.net - Best way to keep track of current online users -


I have a requirement that my site always displays the number of online users currently, for example, "35741 users currently Online "This is not based on login, just how many users are currently on my site I have tried to end the session / session for this, although the end of the session is not reliable so I get the bloated numbers Because my session adds a number, but the session does not end them as it is not a fire.

There is no additional information to collect from this (reporting, etc.), it is only requested that the number shows is a very simple request that is changing in a huge deal. Any help is appreciated

Edit:

I should also specify that I have also tried to use a database for it. A simple table containing session ID and The last activity column is included. With each page hit, I check to see if the session is in my database or not. If not, then insert, if so, update with the time of activity, then I run a process that opens the database in search of a session without any activity in the last 20 minutes. This approach seemed to kill my SQL server and / or IIS. The site had to restart

The best way is to do as you do, but it takes time through activity. If a given session does not reach any page within 5 minutes or more, then you can no longer consider them active.


php - Project conversion from ISO 8859-1 to UTF-8 -


I have coded a PHP project under ISO 8859-1, and for some technical reasons, I under UTF-8 I want to make the project sign. What is a better way to do this? I am afraid of losing special characters such as French letters and scared. Thanks for the advice

You can use shell command by using iconv from Latin 1 (ISO-8859-1) UTF-8

After this, you should make sure that PHP uses UTF-8 as the default encoding (if I am reminded correctly then default_encoding variable in php.ini) If not, Can be set with ini_set () for your project.

After this, you should change your database to UTF-8 or use a Quickfix (for MySQL) like this:

  mysql_query ("SET NAMES 'Utf8');  

For whatever framework you use, you can replace mysql_query () (if you use any one). Place in the primary file that contains all sections and accessories.


In Visual Studio I keep getting two copies of FormMain.cs and one contains old edits, why? -


In Visual Studio 2008, I keep two copies of my FormMain.cs file, it has old edits, I created it again Is the project and solution but it does not fix, what is the problem?

Thanks

Check the file attributes (right-click and properties in Window Explorer Select)

Ensure that you are not setting a read-only flag


wpf listview gridview swaping item template -


I have a list view that is displaying data using gridview. This list is displaying general data of grid views. Too many data displayed in rows and columns However, I have no data to display in columns on some lines. I would like to swap the item template for that line and would like to display another template for the entire row, which will display something like "blank line" or "blank line" for the text and the entire row is the style of different cells Do not Show

I'm trying to use this post :.

Then I have a custom view for the list view. In fact, I've given the sub-class to the Gridview class and on the prepared method method override, I can choose a new template that I want to display for a particular line or default template. However, when I try to choose a new template, gridview will never render it for that line if I use the default template it will still render it. I think the layout for any gridview is interfering with the setting of the template for that line which I want to swap. Is it possible or will I have to create a custom view that mimics the gridview and does not subdivide the gridwish class? Any suggestions or anybody have the experience of this type of scenario, do I want to keep the columns without much work?

You can use DataTriggers, use code like this (some items do not have value of 0 or 0 Depending on, switching templates depending on):

  & gt; DataTemplate x: key = "MyItemTemplate" & gt; & Lt; StackPanel & gt; & Lt; StackPanel name = "normal stackpanel" & gt; & Lt ;! - Template for normal line - & gt; & Lt; / StackPanel & gt; & Lt; StackPanel name = "blank phase port" visibility = "brief" & gt; & Lt ;! - Template for empty line - & gt; & Lt; / StackPanel & gt; & Lt; / StackPanel & gt; & Lt; DataTemplate.Triggers & gt; & Lt; Datatrigger binding = "{some binding object properties}" value = "0" & ​​gt; & Lt; Setter TargetName = "General StackPainel" property = "visibility" value = "abbreviated" /> & Lt; Setter TargetName = "blank stack panel" property = "visibility" value = "visible" /> & Lt; / DataTrigger & gt; & Lt; /DataTemplate.Triggers> & Lt; / DataTemplate & gt;  

Hope it helps.