Posts

perl precompiled regex question -

Do I actually get any benefit from doing the following (as opposed to $$ in both the actual regex PCR) If statement)? (Too many lines are in the real data set, but for example, just use the data. my $ defs = 0; my $ test = 0; my $ pcr = qr / \ s * [\ / \\]? \ S * /; While (& lt; data & gt;) {$ defs = ($ 1? 0: 1) / / lt; ($ {pcr}) / Definitions; $ Test = ($ 1? 0: 1) / / lt; ($ {pcr}) test /; print "defs: $ defs \ ntests: $ tests \ n \ n";} __DATA__

delphi - Enabling XP visual themes / visual styles kills performance -

While trying to modernize the presence of an older C + + builder / Delphi application, I enabled visual themes ( ) And was surprised how much of a performance hit topics were added. For example, for our primary setup page (an 11-tab, 200-control monster dialog that we do not want to repeat due to the time of development and repetitive costs): without Themes enabled: ~ 0.1 seconds menu item by clicking on the form shown to the form and its control (as measured by QueryPerformanceCounter), to make ~ 0.9 seconds (like That is shown) by stopwatch) Ultimate User Not really worth giving attention to A's. With the theme enabled: To build the form and its controls: ~ 1.5 seconds by clicking ~ 1.5 seconds in the form being shown menu item. The end user is very noticeable. I get similar results on both Windows XP desktop and Windows 7 VM. I know that the steps I can take to improve this particular case (such as loading the tab of the dialog freely or giving it a complet...

iPhone Development - sample code LazyTableImages manipulation problem -

UITableViewCellStyleSubtitle default style to support a textLabel and two detailTextLabel (this just one support), how do I customize it ? Awesome image - sample code link: THX: -) . I want to change the UITableViewCellStyleSubtitle default style to support a text label and two statement textlabel (this only support), how do I restart it? Instead of using the pre-built style, add the contentView property of the property to the UILabel example as a sub-view. By adding just subviews to contentView , you want to add whatever labels you want, wherever you want.

Incrementing an Integer in SQL Server -

Any HTML question here, every time I change a specific record in a SQL Server 2008 R2 table, I want to increase a RevisionId record. I ; To do this, I am using the following syntax: updateTable SET RevisionId = (SELECT RevisionId to be set WHERE id = @ id) +1 WHERE id = @ id; BTW, I'm putting it in a trigger so that it is done automatically, but when this code works, it sounds too tight - is there a cleaner way to do this? You do not need internal selection: Update Table SET RevisionId = RevisionId + 1 WHERE ID = @ ID

mysql - Using a single wiki table for multiple subject tables -

I have come to know if someone can help me to understand whether I have been working with wiki content for many topics I'm doing well using a table, therefore: Table wiki ==> Wiki_id wiki_content wiki_language wiki_user_id table homes home_dearth home_names house_year home_space == & gt; Wiki_id Table Architect arch_id arch_name arch_born arch_died == & gt; Wiki_id I think that if I use it then this could be the right way: SELECT * FROM homes WHERE house_id = '123 Join the homes at INNER Wiki. I Wiki_id = wiki.wiki_id But I do not have experience on databases. The wiki structure is quite similar in both cases, so I'm wrong using a wiki table for two different tables? Can future problems be faced on this DB design solution? If wiki information is directly related to houses and architects then I have no problem connecting them with foreign keys I see. It is one of the many relationships for many institutions, as long as they are related, it i...

iphone - Parsing a RFC 822 date with NSDateFormatter -

I am using an NSDateFormatter to parse an RFC 822 date on the iPhone However, specify the optional element in the date format There is no way to do it. There are some optional parts in RFC 822 specification which are breaking the date parser, if nothing works, then I have to write a custom parser to follow the specs. For example, the name of the day in the imagery is optional. Therefore both dates are valid: Tuesday, 01 December 2009 08:48:25 +0000 format is parsed with EEE, dd MMM yyyy HH: Mm: ss z December 00 08:48:25 +0000 format dd MMM yyyy HH: mm: ss z Parsed with> This is what I am currently using: + (NSDateFormatter *) rfc822Formatter {static NSDateFormatter * formatter = noil; If (formatter == blue) {formatter = [[NSDateFormatter alloc] init]; NSLocale * enUS = [[NSLocale alloc] initWithLocaleIdentifier: @ "en_US"]; [Setter Sitelokel: NUS]; [Annus release]; [Format setDateFormat: @ "EEE, DD MMM yyyy HH: mm: SS Z"]; } Return formo...

c# - Can I get a byte[] from a BitmapImage in Silverlight? -

I am trying to represent something behind the image between the Silverlight and WCF service. If possible, I want to pass the System.Windows.Media.imaging.BitmapImage , this means that the client does not have to make any conversions. However, at some point I need to store this image in a database, which means that the image representation should be able to change from byte [] . I can read the array in MemoryStream and create BitmapImage by byte [] using BitmapImage.SetSource (). I / code >. But I can not find any way to change - from bitmapImage to byte [] on the other side. Do I have something clear here? If it helps at all, the conversion code can run on the server, i.e. it does not need to be silly-secure. Use this: public byte [] GetBytes (bitmap) Image bi) {intelligent bitcake wbm = new writable bitmap); Return wbm.ToByteArray (); } Where public static byte [] ToByteArray (The WriteableBitmap BMP) {// Init buffer int w = bmp.PixelWidth; Int h ...