Posts

string - shell script find and replace in file -

I have a post postmaster.log, in which I need to find the pattern and change the value that changes. MaxValue = 3 # It can not be any value for 3 MaxValue = 0 There is a problem like "MaxValueSet = 3" and "MaxValue is currently low" Are there. I have only changed MaxValue = 3 to MaxValue = 0, I tried to use sed -i 's / maxValue = 3 / MaxValue = 0 / g but it works only if If for any other value MaxValue = 3 it will not work. You can also work lines on sed : sed -i '/ ^ ^ MaxValue = / S / = [[: number:]] [[: digit:]] * / = 0 /' / home / postmaster.lag

ruby on rails - preventing active record attributes from being modified by forms -

In Ruby on Tracks, updating a model from HTML Forms is very easy. Normally you can make a form_ with the model, and the fields will be updated when the user hits the submit button. While saying that a malicious user wants to update without updating their 'pay', the proper channel should not just inject an area under the name of 'pay' while updating their email address. Can you (for example) and determine for your wages basically what they want? How can I specify which fields can be modified and which can not do to stop it? @user.update_attributes (params [: user] / code> they can update anything they are scary I can attr_accessible I understand the usage, but it is only relevant to large-scale updates, is not it? You can limit this field, which fields can be assigned using: attr_accessible: name, address # no: salary

user interface - How to bind a LabelMorph/TextMorph to a variable so that the Morph reflects changes of the variable? -

I have an object with a string with string. Do I have a window labelMorph / TextMorph (or any other morph showing the text?). How can I tie labelmorph / texturf so that the label is updated when the string is converted to variable change Classic SmallTech-80 dependent / Change / Update mechanism? Farrow announcement framework? Something different ?? How would I do this? What type of use do I use? Depends on what you want to achieve. You might want to find a way to do this with glamor in an existing mousse image. In a workspace, do this: GLMBasicExamples New Magratt Open: The Ultimate GLMGratPassRun Example Samantata This shows how to work with saving announcements. To understand the way to work with Glamor, the earlier examples are a better way (and the way the example brasser is created, the example of Magrits updates the list when it is nested): Open GLMBasicExamples There are several other examples that update on the change.

forms - HTML Label "For" Value -

I have a label tag that I'm trying to link to an input type checkbox tag. I have multiple labels and multiple checkbox inputs, and they have the same ID and same name, but different values ​​are there anyone can give me instructions on how to create a label that links to the value instead of the ID is? So this: & lt; Label = "8994" & gt; & Lt; / Label & gt; Will link to: & lt; Input id = "member_ids_" name = "member_ids []" type = "checkbox" value = "8994" & gt; Or is it not possible? for the label element must match the id in your case something like this: & lt; Label = "member_id_8994" & gt; & Lt; / Label & gt; & Lt; Input id = "member_id_8994" name = "member_ids []" type = "checkbox" value = "8994" & gt;

javascript - issue with sending ajax message -

नौसिखिया को jQuery / json / ajax में इसलिए कृपया अच्छा हो। मैंने एक साथ यह कलाकृति SO और अन्य साइटों के उदाहरणों से, लेकिन मैं संघर्ष कर रहा हूं। मैंने AJAX प्रतिक्रिया से निपटने के लिए कुछ फ़ंक्शन बना लिए हैं ... फ़ंक्शन newOrderSuccess (प्रतिक्रिया ) {...} फ़ंक्शन newOrderTimeout () {...} फ़ंक्शन newOrderFail () {...} ... यहां AJAX कॉल है : फ़ंक्शन भेजनाकेलएक्सएक्सजिंगजसन (theUrl, द डेटा, सफलता कॉलबैकफ़ंक्शन, टाइमआउटकॉलबैकफ़ंक्शन, अन्यएयरकॉलबैक, टाइमआउटवैलमिली) {var successFn = सफलता कॉलबैकफ़ंक्शन; Var टाइमआउट Fn = समयबाह्य कॉलबैक फ़ंक्शन; Var अन्य Fn = otherErrorCallback; यदि (! (Typeof successFn === 'फ़ंक्शन') ||! (टाइपफ़ टाइमआउट Fn === 'फ़ंक्शन') ||! (TypeFotherFn === 'फ़ंक्शन')) वापसी झूठी; $ .एजेक्स ({प्रकार: "POST", url: theUrl, समयबाह्य: टाइमआउटवैल्यू मिलि, डेटाटाइप: 'जेसन', डेटा: {जेसन: JSON.stringify (द डेटा)}, सफलता: successFn (परिणाम), त्रुटि: फ़ंक्शन (x , टी, एम) {if (t === "टाइमआउट") {timeoutFn ();} e...

css3pie - Buttons and Pie Css -

I have CSS and have a strange gesture with IE8, where the pie applied the boundary-radius property to an element , But its background element (a gradient or a flat color) exceeds the boundaries and it seems that it is at the top, the real element is hidden. I have been working with CSS for a while. I know that it requires pie.php when using PHP on the environment and the right place for the pie is in the root of the site. I had never had this problem, but now I am facing this problem using a responsive framework. The button we created with this structure: & lt; P class = "btn" & gt; & Lt; A href = "#" & gt; Learn more & lt; / A & gt; & Lt; / P & gt; CSS: .btn {status: relative; Display: Inline-block; Width: Auto; Height: 36px; Font-size: 16px; Line-height: 36px! Important; Border: 1px solid # a0c401; Boundary-radius: 4px; Cursor: indicator; Margin: 0 20 px 0; -WebKit-Box-Shadow: Inset 0 1px 1px #fff, 0 1px 2px RGBA (0,0...

memory management - Adding java ClassLoaders to heap not perm gen -

We have an application that generates thousands of Java Classloaders and classes before they can collect garbage. We are absolutely convinced that there is no class loader leak, but we are receiving transit errors (even if it is orthogonal for any possible leakage). Is there a way to specify certain classloaders? We are using Oracle JDK Java 6 on Linux. EDIT: Looks like Java 8 is no PermGen now it will be replaced by METASPRESS. Of course you're getting the sequence of common errors - that's where Square loader classes. What would you expect? You can map them into a byte buffer, like Java NIO does it, but they do not go to the pile. You should try to increase your paragraph general size before taking extraordinary measures. How many paragraph general spaces do you need? Try it using Visual VM and see.