Posts

java - need to clean malformed tags using regular expression -

Searching for the proper regular expression for the following situations: I have to clear some tags for free Flowing text For example, I have two important tags within the text: & lt; 2004: 04: 12 & gt; and & lt; Person's name & gt; Unfortunately, some tags include "& lt;" Or ">" delimiter For example, some are as follows: 1) I tried to use the following for position 1: string regex = "& lt; \\ d {4} - \\ D {2} - \\ d {2} \\ w * {2} [^ & gt;] "; String output = content.replaceAll (regex, "$ 0>"); All examples of "2004: 04: 12" were found and the result was "& lt; 2004: 04: 12>". However, I need to eliminate the location before the finished tag. Of course this is the best way. any suggestion. Thanks In fact, you have a negative look- forward, like this: string regex = "& lt; \\ d {4} - \\ d {2} - \\ d {2} (?! & Gt;)"; String output...

android widget unresponsive -

I have a widget that you press and then it will update the text on the widget. I have set one at the click listener to launch another activity to update the text, but for some reason it works temporarily and then it will be unresponsive and will not do anything when pressed. Does anyone know why this can happen? I have posted my widget code down in case it is useful. @Override public void onUpdate (REFERENCES, AppWidgetManager appWidgetManager Int [] appWidgetIds) {thisWidget = new ComponentName (reference, MemWidget. Class); Intention = Intention = Intent (reference, updatewidget.class); Pending pending vertical positioning = pending.activity (reference, 0, intent, 0); // Get the layout for the application widget and click on the attached one button to the listener RemoteViews = New RemoteViews (context.getPackageName (), R.layout.widget); Views.setOnClickPendingIntent (R.id.ImageButton01, Pending Pending); // Tell AppWidgetManager to update on current app widgets AppWidgetMana...

c# - How do you pass a BitmapImage from a background thread to the UI thread in WPF? -

I have a background thread that generates a line of bitmap image objects whenever the background Thread generates a bitmap, I want to show this bitmap to the user. This is an MVVM project, so in my opinion, there is Image , the problem is how to pass BitmapImage from the background thread to the UI thread. Code> Element: & lt; Image Source = "{Binding Generated Image}" /> My visual-model has a property Generated Image : Private bitmap image -granted image; Public Bitmapmise GeneratedImage {get {return_generatedImage; } Set {if (value == _generatedImage) return; _generatedImage = value; RaisePropertyChanged ("GeneratedImage"); }} There is also a code in my view-model that creates a background thread: Start public Zero: Garmin Avenues (list & lt; coordinate & Gt; coordinate) {Thread Start Generator Thread Sterer = Representative {GenerateImages (Coordinate); }; Var Generator Thread = New Thread (Generator Threadstarter); Ge...

PHP Queing background proccesses -

What is the best way to queue background processes in PHP ... Zend Job Queue Looks pretty good, but I'm not able to switch to Zend server what is the option to do this? Very capable. , And. There are things like that too

concurrency - Simultaneous launch of Multiple Kernels using CUDA for a GPU -

Is it possible to launch two colonels, which work independently, simultaneously for example if I have this quad code // Host and device initialization ....... ....... // Launch kernel 1 myMethod1 & lt; & Lt; & Lt;. ... & gt; & Gt; & Gt; (Parameter); // Launch Kernel 2 myMethod2 & lt; & Lt; & Lt; ..... & gt; & Gt; & Gt; (Parameter); Assuming that these kernels are free, they have the facility to launch them at the same time allocated for each grid / block. CUDA / OpenCL has this provision. Device with CUDA compute capability 2.0 and better (i.e. Fermi) Some compute capabilities can perform several kernels simultaneously at 2.0 simultaneously. You can query this capability by calling the application cudaGetDeviceProperties () and check the concurrent kernel property. Launch the maximum number of kernels that can execute a device simultaneously four. A CUDA reference can not execute simultaneously with a kernel from ...

mod rewrite - mod_rewrite not redirecting for multilingual site when trailing slash missing -

I am currently developing a multilingual website. User URL can be used on the front page with the following format: http://example.com/en/ http://example.com/fr/ The problem is here > Rewriteum ^ /? ([^. /] +) / (. *) $ $ 2? Lang = $ 1 [L, QSA] Try it out: revwrite ^ /? ([Az] {2}) (/ (. *))? $$ 3? Lang = $ 1 [L, QSA] Another option would be to redirect if the trailing slash is missing: RewriteRule ^ /? [Az] {2} $% {REQUEST_URI} / [L, R = 301]

android - How to handle out of memory error? -

I am using the following code to display a bitmap in my ImageView. When I enlarge the size image by 1.5 MB, then gives me an error Anyone gives me a suggestion? Try {URL aURL = New URL (myRemoteImages [val]); URLConnection conn = aURL.openConnection (); Conn.connect (); InputStream = Faucet; Try {is = conn.getInputStream (); } Hold (IOException e) {return 0; } Int a = conn.getConnectTimeout (); BufferedInputStream bis = new BufferedInputStream (is); Bitmap bm; Try {BM = BitMap Feature Encodestream (bis); } Hold (exception before) {bis.close (); is close(); Return 0; } Bis.close (); is close(); Img.setImageBitmap (BM); } Hold (IOException e) {return 0; } Return 1; Log Cat: 06-14 12: 03: 11.701: Error / Android Random (443) Heading out is 06-14 12: 03: 11.861: Error / Android Randomime (443): java.lang.OutOfMemoryError: The size of the bitmap is more than the VM budget 06-14 12: 03: 11.861: error / Android Random (443 ): On Android. Graphics. Bitmapfactory native diskstream (na...