Posts

regex - Perl: Can I use capture groups in variables used in text replace regular expressions? -

Just for fun, I'm very new to Perl and I'm trying to write a simple text processing tool, But I 'm going to read the rules of the tool stuck in a simple thing, from a simple text file (not to the script, and perhaps it is important), to process a text file, there is an array of patterns / patterns in pairs (Like each for each process Yum line ). Here is the sub to apply the changes: My ($ text, @ rule) = @_; My @ lines = partition (/ \ n /, $ text); Forex Currency (@Rules) {My $ pattern = $ _- & gt; {"Pattern"}; My $ substituted = $ _- & gt; {"Substituted"}; $ Rows = map {$ _ = ~ S / $ pattern / $ substituted / g; } @ Lines; } Join the return ("\ n", @lines); For example, if there is a rule like pattern = [aeiou] + replace = * , then the text foo bar to F ** B * r . That's what i want Although I do not know why I can not use the capture group to change the text content, pattern = ([FF]) + in me Oh times I...

c# - DataGridView DateTime Picker Cells Automatic Value Adding -

I would like to set one of my columns in my DataGridView in such a way that when users edit any cell in this column Does, a datetime picker appears. I copied the required classes to do so by MSDN Post. When I fill my DataGrid view with data, I do this by using the following code: MySqlDataAdapter daClients = New MySqlDataAdapter (sql, cnManageMembers); DaClients.Fill (dtClients); Binding source bsClients = new binding resource (); BsClients.DataSource = dtClients; DgvClients.DataSource = bsClients; BnClients.BindingSource = bsClients; This filling method uses a binding source to fill the datagrid view, and it automatically takes care of things like adding the required columns and cells, though I can get them in their column One needs to change the cells. What code can I apply to this so that I need to add every cell manually and value it. Instead (taken from MSDN Post): DataTable dtClients = new datatable); Calendar column column = new calendar column (); This.dataGridView...

ios - Get HTML body text only, no tags -

Image
I have no knowledge of background or web development / designing and I currently work on an email client application on the iPhone I am using UIWebView for reading / writing e-mail. I download emails as an object and let me bring topic, date, address and body from this object, but there is an HTML string with email body tag. My Goal: to view the email body as a normal string without tag, such as the iPhone Mail app, or the Gmail app. This is a good example: Thanks! Use UITextView with NSAttributedString Or label whatever you want NSString * oldHTMLstring = @ "& lt; b> testing . & Lt; Br> & lt; i & gt; HTML & lt; / i & gt ;, & lt; br & gt; & lt; u & gt; Body text. & Lt; / u & gt; "; NSAttributedString * newHTMLstring = [[NSAttributedString alloc] initWithData: [Old HTMLstring DataSetting Encoding: NSUTF8StringEncoding] Option: @ {NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharact...

javascript - jQuery keyup working incorrectly -

I am trying to increase an integer variable every time the Enter key is pressed, this variable then returns the value from an array is used to. $ (document) .keyup (function (e) {if (e.keyCode == 13) {console.log (+ ($) ($ "'), $ (' # ('Background', "# 4b84e5")} and if (outside [currSteps]. (Outrage [currsteps]% 2 == 0) {$ ('body'). ] == 1) {$ ('body'). CSS ("background", "# 9d622"}} and {$ ('body'). CSS ("background", "# d16323")}}}) ; The problem occurs when I actually press Enter on the first press, it works properly, and increases the variable currSteps and the next in the array Displays the value. However, when I After pressing Enter, it returns it back to the original value of currStep , as long as the entry is placed below, it will display the default value Now, yes , This event is for funnel , so it is understood that things will work oddly on the keydown however ......

json - How to handle big object sent on socket java? -

I am trying to implement a client-server in Java and I created a connection between sockets Send JSON objects as strings on currents If I have a large object then there is no way to handle it So I do not have to re-group it because TCP Size of packet size (Do not know that the single object as the customer Is completely transferred or not) Note: I am using G-son to convert objects into a Jasonan object. This is a way of handling, so I do not have to recreate it because the limit size of the TCP packet Just do not have the data to take care of TCP packets size (Do not know when a Bjekt not yet been completely moved me as a client right now) Yes, you can. You reach the closing '}', as is the mention of @tefenck Your question has been set on false assumptions.

dart - pass Polymer data binding through a Javascript function -

I am using polymers and darts to create a list of point coordinates. It provides a list of digits in html. However, I want to convert points from one coordinate system to another by using the Javascript function. In HTML darts-polymers: & lt; Repeat template = "{{grid_points}}" & gt; & Lt; Core-item & gt; {{P}} & lt; / Core-item & gt; & Lt; / Template & gt; I found a library in Javascript: grid_to_godetic (x, y); Grid_points is a list of numbers. How can I pass PX and PE through JS function and how do I get results given at the place of P in HTML Template? You can use it for: & lt; Repeat template = "{{grid_points}}" & gt; & Lt; Core-item & gt; {{P | Grid_to_godetic}} & lt; / Core-item & gt; & Lt; / Template & gt; ... & lt; Script & gt; Polymer ('your element', {grid_to_godetic: function (point)} {return point.x + point.y;}}); & Lt; / Script & gt; The...

openshift - App not coming up: SEVERE: Error listenerStart -

I am using Tomcat 7 Jabos EWS 2.0 for my web application. My build and deployment are ok but the app is giving 404 error after checking Jbossews logs, I see EVERE: Error Listener Start Is giving up. The app is running fine on my locality, I went to stack overflow through threads, but I did not get much help. Any ideas are really appreciated log: ==> App-root / logs / jbossews.log & lt; == 26 July 2014 8:53:01 pm org.apache.catalina.startup.Catalina addClusterRuleSet information: Cluster rule set [java.lang.ClassNotFoundException: not found due to org. Apache.catalina.ha.ClusterRuleSet]. Cluster configuration is disabled July 26, 2014 8:53:01 pm org.apache.catalina.startup.Catalina addClusterRuleSet information: Cluster rule set not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet] . Cluster configuration is disabled July 26, 2014 8:53:01 pm org.apache.catalina.startup.Catalina addClusterRuleSet information: Cluster rule set not...