Posts

iphone - iOS 4 GCD questions -

I've seen some presentations of the WWDC 2010 and block and read most of the concurrency documents and Grand Central Dispatch uses blocks with serial lines to about a few questions in a iOS 4 project to me which is a dictionary of Scrolwu and image information - like URLs for images and so on. I want to use GCD and blocks to download images and in my scrollwid so that the main thread is not blocked. I wrote the following code seems to work: (for pictures Ansreepshn * dict) {Preshk_sisnk (image_queue, ^ {NSString * urlString = [dict objectForKey: @ "url"] ; NSURL * url = [NSURL URLWithString: urlString]; NSData * imageData = [[NSData alloc] initWithContentsOfURL: url] UIImage * image = [UIImage imageWithData: imageData]; UIImageView * Start imageView = // see the image; Dispatch_async (dispatch_as_main_queue (), ^ {[self.scrollView addSubview: imageView];}); [image data release];}); } I have two questions: According to concurrency guide, should I hold the var...

Global Exception in struts2 -

I am trying to configure global exceptions in struts.xml. When I include the global-exception mapping tag, the project is not starting I get the following message in the log, July 27, 2010 6:33:07 PM org .apache.catalina.core.StandardContext Starters SEVERE: Filter Filters Error July 27, 2010 6:33: 07 PM start org.apache.catalina.core.StandardContext: Reference [/ ehspreg2] Startup failed due to previous errors log4j: Error log manager. The repository selector was empty due to an error in reloading the class, using the NOPLoggerRepository. is the Struts.xml file, & lt; Expands package name = "default" = "string-default" & gt; & Lt; Result-type & gt; & Lt; Result-type name = "tiles" class = "org.apache.struts2.views.tiles.TilesResult" /> & Lt; / Result-type & gt; & Lt; Interceptor & gt; & Lt; Interceptor-Stack name = "ehs pre2 stack" & gt; & Lt; Interceptor-Rif name = "...

iphone - How do you set the content size of a UIPopoverController? -

I'm showing a scene in popup. When I click on a button in this view, another view will be pushed into popup using the navigation controller. By pushing, the height of the popover is increased. How do I create the same popover height? In all your view controllers, override -contentSizeForViewInPopover and all of them are identical Return the shape.

reflection - get class from java.util.List<SomeType> -

इस अभिव्यक्ति से वर्ग कैसे प्राप्त करें java.util.List मुझे लगता है कि आप रन टाइम पर सूची के टेम्पलेट वर्ग को जानना चाहते हैं, और संक्षिप्त उत्तर है: आप नहीं कर सकते जावा जेनेरिक्स का उपयोग केवल संकलन समय पर किया जाता है: बाइट कोड उत्पन्न होने से पहले टेम्पलेट तर्क मिटा दिए जाते हैं। इसे "" कहा जाता है।

editor - Is It Possible to Comment Out HTML Code in a Wordpress Post? -

Sometimes I need to put some raw HTML code into a WordPress post, and sometimes I can see that code A part of the need to comment !! With a plain text editor, I just click and I can hide around Chuck. But when I see it in a WP post, it hides the code, but I still see the "off comment tag" -> look. What is the correct way, if possible, to exclude the code in a WP post? Thank you! There is a bug in Wpautop () that breaks the HTML code comments. An easy solution is to add a second open HTML comment tag before the optional closing - it works like WordPress you would expect it to & Lt; / A & gt; & Lt; / Div & gt; & Lt ;! - - & gt; This will not work in WordPress: & lt ;! - & lt; Div class = "book floatleft" & gt; & Lt; A href = "#" & gt; & Lt; Img src = "http://www.myreallycoolsite.com/wp-content/uploads/2013/02/button.png" alt = "" /> & Lt; / A & g...

How to Get dependency of a PHP script? -

I am using a PHP library PHPExcel in my script. Now the library is very big around 7 MB and I do not think I am using it all the facilities. I want to lightweight my script by inserting files in PHPExcel which I am not using. PHPExcel uses an autoloader that contains only the file that your The script actually uses, so the actual "memory" size of the script is kept minimal. If you are not using any language other than English, then you can delete all the subdirectories in the classes / PHPExcel / locale ... if you want to have other places like francs, you can use fr Exclude all subdirectories except (0.5 MB savings). However, I will not recommend removing any other thing. Especially without knowing what you need is what you need. If the disk space is absolutely important, and you are working with only xls (for example) files, then you have all other readers and authors (note that the PDF author uses the HTML author) ; But then you have to clearly recognize that...

language agnostic - How to generate every possible combination of a string when given a list of values -

Say that there is a list of my values, this list can be of any length: "100", "200", "300" , "400", "500", ... and I have a template string that contains some tokens which need to be replaced: "@ Token1 @ - @ tokens2 @ - @ tokens3 @ -....- token n @" Using the list of values, I can add values ​​to the templates How can I create every possible combination? Values ​​can be used more than once, so the result can be "100-100-100". Additional points for a method that takes into account a variable amount of tokens! edit: a fixed number of deleted token version Takes advantage of recycling just for fun: r ($ values, false, $ numtokens); 100-100-100 as well to get / wrong function r ($ value, $ unique = true, $ depth = 3, $ deposit = array ()) {if ($ depth == 0) { Print implode ("-", $ accumulated). "\ N"; } Else {foreach ($ id = & gt; $ value as $ t) {if ($ unique) unset ...