Posts

Showing posts from April, 2014

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.

javascript - Scope issue with passing function as parameter -

After instantating my class, I call myClass.testScope () The other function that calls inside the orbit. But, when I pass the function as a parameter, then I lose the scope and testScopeFromPassedParam to data1 results in the error Uncaught TypeError : Object [object global] has no way 'testScopeFromPassedParam' Can someone help with the best way to handle it? Classes McCallus Test: () - & gt; @testScope () testScope: () - & gt; Console.log 'strategy' testScopeParam: () - & gt; Console.log 'No Working' Data 1: (CB) - & gt; # Shoot. Error. @testScopeFromPassedParam () setTimeout (-> CB '1'), 1000 data2: (CB) - & gt; SetTimeout (-> CB '2'), 3000 load data: () - & gt; GetDeferred = (some functions) - & gt; Suspended = $ Inactive () some functions (data) - & gt; Console.log data deferred.resolve () deferred datafunction = [@ data1 @ data2] arrayOfPromises = [] arrayOfPromises.push getDeferred...

html - What does this css declaration mean - two declarations at once -

Can you please explain this kind of CSS declaration: Menuu_blueSkin_Middle.dir_left div .align_left {float: left; } As far as I know that you have .someName {} , this means that this HTML element has been put in the class attribute. For example: & lt; Div class = 'someName' & gt; & Lt; / Div & gt; But in the example that answers this question, there are two points in the beginning and in the middle again a space and another declaration is div.align_left? Please give me some clarification! . Menuu_blueSkin_Middle.dir_left div.align_left There are three squares called here. This is a bit complicated because whoever nominates these sections is an amateur. To make it easier to understand, rename the three classes: menu_blueSkin_Middle we . dir_left We will rename .secondclass for the first class .lign_left for .thirdclass The name will change, well, now the class named after all three, shows you the code: ....

Facebook og fix to display just one thumbnail in sharer.php -

Image
I want to share a video with a thumbnail of only one image via sharer.php I understand that most people use feed dialogue with flexible UI but I need advanced options in this case. A dialogue looks like this and I should only have one thumbnail, which I specify and: image on a relative page My OG tags look like this: & lt; Meta property = "fb: admins" content = "* admins *" /> & Lt; Meta Property = "FB: APIID" content = "* APIId *" /> & Lt; Meta Property = "OG: Type" content = "Movie" /> & Lt; Meta Property = "OG: Video: Height" content = "* Altitude *" /> & Lt; Meta Property = "Ogg: Video: Width" content = "* width *" /> & Lt; Meta property = "ogg: video: type" content = "app / x-shock-web-flash" /> & Lt; Meta Property = "OG: Title" Content = "* Title *" /> & Lt; Meta Propertie...

javascript - Why is localStorage not used to store static resources? -

This question logically follows this question: It is clear that the popular site HTML5 application caching is not used to save static resources because it was designed. Just & lt; Html & gt; Check for the attribute in the tag, it is not there. Seeing it further, HTML5 local storage is not being used. I saw in the case of a test www Google.com www.twitter.com www.facebook .com Just go to console and type localStorage. And the console should pop up a list of keys. None of these sites can save their static data to disk? Why this? It seems that resources like a waste of resources have not been hit for the network. If you click on the reload to expand, the page will download the remaining resources again. You can also see the terms used in the URL path with Google. However for this question I use the conceptual meaning of the word. It is clear that site HTML5 application caching is used to save popular static resources. Are not because ...

operating system - Does Cassandra lock files in the data directory during reads/writes? -

I know that cassandra can take snapshots when it is online This makes each snapshot subdirectory in the family directory , And the column inside it keeps a copy of the family. But I do not know if this is possible because there is no locking of the file at all, or if the snapshot instruction is waiting just to unlock one file before copying it. Does anyone know how the cassandra contacts with files in the data directory? Apart from this, what behavior is dependent on the operating system? First of all, it is important to realize that all the files write the data directory of the case - once. No file is ever modified, it is made, then eventually merged with others, then it is removed. (It's a good idea to write the cassandra well, because all the disk access sequentials are for writing.) The second thing is that taking a snapshot does not copy the file, it's a It makes hard links because it works because the files are read-only so no copy is necessary. For these reason...

Just how flexible is highcharts? (Mockup attached.) -

We did some fake work on the charts included on our website, and if we can use we will be thrilled Highcharts. But so many high charch work, we look very similar ... How is it just customizable? Do we estimate that it can be used to make charts absolutely like these mockups? Increasing average High and low Attractive points pointing to exact decorative gradients What is the "Key" overlay showing Represents the color line So what do you think? HighTourts are available for this exact job, we do old javascript and hack up; Styling? Mockup: Yes, you definitely have those cards high Can do with! The motto around my work is "anything is possible." For points pointing to the elevation and the lows, you want to use "symbols" for the points found in this example: Data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, {y: 26.5, Marker: {symbol: 'url (http://www.highcharts.com/demo/Gfx/sreen.png)'}}, 23.3, 18.3, 13.9, 9.6] For gradien...

java - Android - Threads not executing -

So yes, my thread is not executed, or is code inside it. I just wanted to run a shell script from my SDCD, and show a "loading" circle or "progress" circle or whatever you want to call it. When I click on the button to run the thread, I get the progress / loading bar / circle, but it just sits there and does nothing. I have seen some examples, but still I can not understand what I did. Here's my code: package com. CDOnPlasSmods; Import java.io.file; Import java.io.FileOutputStream; Import java.io.IOException; Import java.io.InputStream; Import java.util.concurrent.TimeoutException; Import com.stericson.RootTools. *; Import com.stericson.RootTools.exceptions.RootDeniedException; Import com.stericson.RootTools.execution.CommandCapture; Import android App Import android.app.ProgressDialog; Import android.content.res.AssetManager; Importroid.os.Bundle; Import android.os environment; Import Android.os.Handler; Android Import; message; Import android.util.log; ...

Catch Exception In Spring Web Service Interceptor and return Soap response -

Remove the details of what is the best way to catch an exception in the Spring Web Service, and this is a soap reaction? My error message description should go to the header of the soap response. & lt; Soapenv: envelope xmlns: soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: IMS = "http://www.imsglobal.org/services/lis/cmsv1p0/wsdl11/sync/imscms_v1p" & Gt; & Lt; Soapenv: header & gt; & Lt; Imsx_syncResponseHeaderInfo xmlns = "http://www.imsglobal.org/services/lis/cmsv1p0/wsdl11/sync/imscms_v1p0" & gt; & Lt; Imsx_version & gt; V1.0 & lt; / Imsx_version & gt; & Lt; Imsx_messageIdentifier & gt; 4 & lt; / Imsx_messageIdentifier & gt; & Lt; Imsx_statusInfo & gt; & Lt; Imsx_codeMajor & gt; Failure & lt; / Imsx_codeMajor & gt; & Lt; Imsx_severity & gt; Status & lt; / Imsx_severity & gt; & Lt; Imsx_codeMinor & gt; & Lt; Imsx_codeMinorField...

Python: Generators and decorators with for a dictionary -

I created a problem that uses the ability to use generators, decorators and dictionaries in Python. However, I can not solve this practice myself, and wondering if it is possible to solve it. Is it possible to cache the output output as a dictionary using a decorator function, which generator? Exercise: Write Decorator for Cash Function Greetings Results Store Combination Arg: A result in a dictionary of function objects in a dictionary. Generate these results using the generator function Test your code on the Fibonacci function. I tried to apply it like this: def cachefunc (func): def cover (* args, ** quargas): result = Throw (* args, ** quarj) returns {throw .__ name__ + '(' + str (list) ([args]) [1: -1] + ')': str (result)} wrapping .__ name__ = fan .__ name__ wrapper___ doctor__ = fancy.__ doc__ return wrapper @cachefunc def fibonacci (n): n & gt; = 0 if n & lt; 2: returns not end: returns (Fnonacci (N-1) + Fibonacci (N -2) def allfib ():...

How to develop a Maya Viewport Extension in C++(MFC) -

Do I need to develop Maya Viewport extensions in C ++ with MFC? It also needs to control the visual style (such as top view, left view etc.). Can I collect Maya SDK and make it? Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. I'm not completely sure what you call "viewout extensions". I think you are trying to write Maya plug-ins, which shows your own kind of viewport, which is commonly called "model view". MCF has nothing to do with it. You use Maya Mel / Python commands to create Maya windows, panels and other UI-elements. (If I made a hack to work with the windows you made, then I do not know) . You can develop custom view ups in Maya by creating two sections: a viewport or model view and " model editor command ". Model View You have a viewport class, it is called "MyViewport". " Its successor "MPC 3 Demo DelView" Normally you will be connected to a camera viewport. Come on, you contro...

jsf 2 - Log4j configuration in jsf web app -

The following configuration is working when I am deploying the Vip App in my local machine (window) public zero reference start (ServletContextEvent sce) {logger logger = null; Alloconnected sublextext = sce.getServletContext (); String prefix = servletContext.getRealPath ("/"); String log4jFile = servletContext.getInitParameter ("log4j"); If (log4jFile! = Null) {DOMConfigurator.configure (prefix + log 4 jifail); Logger = LogManager.getLogger (StartupListener.class.getName ()); Logger.info ("LOG4J is successfully loaded:" + 4 logfile); }} & Lt; Context-absolute & gt; & Lt; Ultimate Name & gt; Log4j & lt; / Lastname & gt; & Lt; Ultimate Price & gt; Web-INF / classes / com / domain / resource / log4j.xml & lt; / Super-valued & gt; & Lt; / Reference param & gt; & Lt; Listener & gt; & Lt; Audience category & gt; Com.domain.util.StartupListener & lt; / Listener Category & gt; & L...

Make first link active Javascript -

I have this javascript code, and I want to activate the first link (tab) so that when going to a website Be it active, as well as when the next tab / link is clicked, the first one (active tab / link) has to be transformed into a normal tab / link (inactive), and it is also done! Here is Javascript: & lt; Script type = "text / javascript" & gt; Function forumhome_tabs_switch (switch_id) {document.getElementById ('forumhome_tab_switch_saint'). InnerHTML = document.getElementById (switch_id). WinnerHTML; } & Lt; / Script & gt; And here is the HTML code: & lt; Td style = "cursor: indicator;" Onclic = "javascript: forumhome_tabs_switch ('forum_tabs_forum [forum]'); return refund;" & Gt; & Lt; A href = "#" tabindex = "2" onclick = "javascript: forumhome_tabs_switch ('forum_tabs_ $ forum [forum]'); return back;" & Gt; $ Forum [title] & lt; / A & gt; &...

Custom Buttons - Error in Java - widget.Button; -

Emulator Accidents with - Extensive-class class android.widget.Button Import android.os.Bundle ;. Import android.content.Intent; Import android App Import android.view.MenuInflater; Import android.view.MenuItem; Import android.view.View; Import android.view.View.OnClickListener; Import android.widget.Button; Public class master activity (button uccBtn, tipBtn; @ Override protected void saved create (bundled Instansstet) {Suprknkret (saved Instensstet); setContentView (R.layout.activity_master); UccBtn = (Button) searches Vivibiaiaidi ( RB Button 1) Tip BTN = (VBIID) (R.B. button 2); UccBtn.setOnClickListener (uccApp); TipBtn.setOnClickListener (tipApp); Custom.xml & lt ;? Xml version = " 1.0 "encoding =" UTF-8 "? & Gt; Selector xmlns: Android =" http://schemas.android.com/apk/res/android "& gt; & gt; item android: state_pressed =" Tr Ue "Android: drawable =" @ drawable / btn_ecolab_selected "> andro...

jquery get paragraphs in div -

मान लें कि मेरे पास ऐसा कुछ html है: & lt; div class = "outer "& gt; & Lt; div & gt; // अन्य div & lt; / div & gt; & Lt; p & gt; बाहरी div में प्रथम पैराग्राफ & lt; / p & gt; & Lt; div & gt; // अन्य div & lt; / div & gt; & Lt; a href = "#" & gt; कुछ एंकर & lt; / a & gt; & Lt; p & gt; दूसरा पैराग्राफ में बाह्य div & lt; / p & gt; & Lt; div & gt; & Lt; p & gt; तीसरा पैराग्राफ इन बाहरी डिव & lt; / p & gt; & Lt; / div & gt; & Lt; div वर्ग = "इनर" & gt; & Lt; p & gt; आंतरिक डिवि में पहले पैराग्राफ & lt; / p & gt; & Lt; p & gt; आंतरिक डिवेल में दूसरा पैराग्राफ & lt; / p & gt; & Lt; / div & gt; & Lt; / div & gt; मैं बाहरी पैरामीटर में दिए गए पैराफ्रॉप्स को कैसे प्राप्त करूं, लेकिन आंतरिक डीआईवी नहीं? धन्यवाद या $ ('। बाहरी & gt; p') वर्ग = "पोस्ट-पाठ" ...

Javascript widget inside JQuery -

After We are using the Ning platform, and to add a new container DIV below the content of the blog (but the comment section Before the order), we added the following to the body tag: & lt; Script type = "text / javascript" & gt; If after {x $ ("DIV.xg_module.xg_blog.xg_blog_detail.xg_blog.xg_blog_detail.xg_blog_mypage.xg_module_with_dialog") (typeof (x $) = 'undefined'!). ('& Lt; div & gt; Content goes here & lt; / div & gt;'); } And {} / Script & gt; However, the content we need to load is Javascript from an affiliate program, which sent us this code to add to that div: & lt; Div style = "width: 750px;" & Gt; & Lt; Div style = "border-bottom: 1px solid #fffff; color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 22px; font-weight: bold; margin-bottom: 10px; padding- Bottom: 2px; Text-transform: uppercase; "& gt; From the web & lt; / Div & gt; &...

java - Asserting Correct Console Output in JUnit -

I am trying to write a basic JUnit tutorial, and I use a basic service layer using a simple Hello World example. Showing this with. My point is that even if the test output matches my control data, still believe that the false are still returning. Can you explain why assertEquals is not working, and show how can I fix it? JUnit error org.junit.ComparisonFailure: expected: & lt; Hello World [] & gt; But it was: & lt; Hello World [] & gt; and my code test sample package com.springtutorial.mavenhelloworld.service; Import static org.junit.Assert. *; Import org.junit.Before; Import org.junit.BeforeClass; Import org.junit.Rule; Import org.junit.Test; Import org.junit.contrib.java.lang.system.StandardOutputStreamLog; Import com.springtutorial.junitandmavenhelloworld.service.HelloWorldMessage; Import com Source: import com.springtutorial.junitandmavenhelloworld.service.HelloWorldMessageService; Import com Source: Public category HelloWorldMessageServiceImplementation...

c++ - difference between a pointer and a pointer array -

मैंने एक कोड बनाया #include & lt; iostream & gt; # से & lt में शामिल हैं, conio.h & gt; नेमस्पेस एसटीडी का उपयोग करना; शून्य मुख्य () {int * x, * y; एक्स = नया इंट [1]; Y = नया इंट; CIN & gt; & gt; y; // संभवतः त्रुटि देता है क्योंकि y एक सूचक है और नहीं एक चर cin & gt; & gt; * y // ठीक काम करता है cin & gt; & gt; x [0] & gt; x [1]; अदालत के & lt; & lt; एक्स [0] को & lt; & lt; एक्स [1]; अदालत के & lt; & lt; * x [0]; // त्रुटि cout & lt; & lt; y; अदालत के & lt; & lt; * y; getch (); } त्रुटि देता है। क्यों? मुझे याद है कि मैंने एक्स को एक सूचक सरणी के रूप में घोषित किया है और अब मैं वही कर रहा हूँ जो मैंने किया था * y। इसका मतलब यह है कि एक सूचक सरणी एक चर हो जाती है? Plz मदद करो! आप वास्तव में कोड की उस पंक्ति से क्या कर रहे हैं: अदालत के & lt; & lt; ** x; x [0] का उपयोग x के 0th तत्व का dereference करेगा क्योंकि । जैसा कि आप x , x की अपनी परिभाषा से देख सकते हैं, क...

html - Links and Z-Index -

I am having a problem with a scroll effect where I can not get the link to work within the header Because the z -index should be negative for the effect, the links are in the header. Edit Sorry, I was not quite clear, the links in the header area (green) are not active because the zayed index properties are to give heading area a negative index The link is not active, so I was thinking of a fix for this HTML: & lt; Body & gt; & Lt; Div id = "container" & gt; & Lt; Div id = "navBar" & gt; & Lt; / Div & gt; & Lt; Div id = "headerBar" & gt; & Lt; / Div & gt; & Lt; Div id = "main content" & gt; & Lt; H1 & gt; This is the main content & lt; / H1> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt; and CSS: #navbar {status: fixed; Top: 0; Left: 0; Width: 100%; Z-index: 1000; -MOZ-BOX-SHADOW: 0 0 5px # 000000; -WebKit box-shadow: 0 0 ...

pointers - vector iterators c++ -

The way I work like the start and end, it seems a little bit incompatible to me. When they move forward and backward, they have different behaviors vector & lt; Actor * & gt; a; A.push_back (new actor (11)); A.push_back (new actor (22)); A.push_back (new actor (33)); Vector & lt; Actor * & gt; :: iterator = a.begin (); Int x = 0; While (a.begin () + x! = A.end ()) {cout & lt; & Lt; (* (A.begin (+) + x)) & lt; & Lt; "\ N"; X ++; } Cout & lt; & Lt; "\ N"; Int y = 1; // If it is set to 0, then its a mistake = / when I use {a.end () - y! = A.begin ()) {cout & lt; & Lt; (* (A.end (- - y)) & lt; & Lt; "\ N"; Y ++; } output 0x979a008 0x979a028 0x979a018 0 9 00 0018 0x979a028 How do I get the expected pattern I 0x979a008 0x979a028 0x979a018 0x979a018 0x979a028 0x979a008 Note that starts () indicates the first element of the vector, but end () point the last element past . It is n...

asp.net - Organize ASP MVC site -

I'm new to ASP MVC. I have a place for a header, footer, menu and main content. What is the best way to do this? Partial thoughts, areas? Thanks layout. Use the HTML file, it will work as a master page on your site and be available for all your ideas. For MVC3 you can see: What are the layouts? You usually want to maintain a consistent form within your web site / application page ASP.NET 2.0 introduced the concept of a master master page that uses .aspx based pages or templates Helps in enabling it while doing it. The razor also supports this concept, which is called "layout". a???? Allows you to define a common site template, and then keep an eye on all the scenes / pages on your site and feel.

forms - Javascript select() value -

I'm sure it's super easy, but for some reason I can not understand it once. I need to create a form on the page with the following fields and rules. If the user submits a form, but the rule of any area is broken, then the user is listed to advise Be treated. I do not have permission to use jQuery Field 01 & amp; Field02 is a box. Field 03 & amp; Field04 is a box. Field 01: "Username" - Rule 01: can not be blank, Behavior 101: Focus on it by using Focus. Field 02: "username" - Rule02: can not be blank, behavior 02: warn the user that "username is required" field 03: "birthday" - rule 360: Must be numeric, Behavior 03: Select the value using Select (). Field 04: "Birthday" - Must be Between Rule 4: 1900 - 2012, Behaviour04: Birthday Text Box Background Color Yellow. It's still up to me ... conflict with field 03; HTML: & lt ;! DOCTYPE html & gt; Field 04. & lt; Html & gt; & Lt...

How to convert JSON Array in JSON Object -

I have a JSON array in the format below which I want to convert to JSNA object (key, value) pair. Since I'm new to Jason, I do not know how to get it. ["Ajit", "Amol", "Kiran"], "Penis": ["100", "101", "102"], "Name": [ I want to convert to the above format such as "name": "100", "name": "Ajit" ["male", "male", "male"]} {"Id": "102", "name"}, {"id": "101", "name": "male"}, "gender": "male"}, {"id" : "Kiran", "Gender": "Male"}] Can you share your valuable ideas for doing this thing? This works for example, assuming a lot of things, var arrayoff objects = []; / ** * The ultimate object oz formated like the first one, / var i = 0, arrayOfObjects = []; For (prop in OBG) {if (for instance, PRO e...

Android : Restrict app not to run on Tablet -

I have developed an application. And now I want my application to be run on mobile phones which are not running on tablets only. I searched for it and tried it as: Android: Android: small screen: "True" Android: GeneralScreen = "False" Android: bigScreens = "false" android: xlargeScreens = " False "Android: resizeable =" false "/> I'll put it on AndroidMenFest I write in the XML file. But this is no use. My application is still running on the tablet. I have declared that he is wrong, or I should include something else. Please suggest me what to do to prevent my application from running on the tablet. Why do you want to run it only on non-bullets? Do you need a feature (like SMS)? If so, add the utility tag to your manifest, if it's based on its screen size, why not just get more users on a larger scale? In addition to this, there is nothing for the screen size tablet versus tablet. My phone is a note 2, i...

iphone - Touch events (touchesMoved) not working on UIViews inside UIScrollView -

मेरे पास UIView एक UIScrollView के अंदर है, और उन दृश्यों के लिए> UIViewControllers स्पर्श ईवेंट नहीं प्राप्त कर रहे हैं यदि मैं स्क्रॉल व्यू के विचारों को लेता हूं तो यह काम करता है। सभी विचारों पर उपयोगकर्ता इंटरफ़ेस डिफ़ॉल्ट है लेकिन यह अभी भी काम नहीं कर रहा है! यह संभव होना चाहिए और मैं वास्तव में आभारी अगर कोई मुझे सही दिशा में बता सकता है! बहुत धन्यवाद, कार्यान्वयन फ़ाइल में निम्नलिखित कोड जोड़ें फिर @interface UIScrollView (कस्टम) @end @implementation UIScrollView (कस्टम) - (शून्य) स्पर्श: पिछला: (NSSet *) एवेन्ट के साथ स्पर्श: (UIEvent *) घटना {[सुपर छूता हुआ हुआ: छूने वाला घटना: घटना]; } @end

php - Decode JSON with square brackets -

I have tried to decode this Jason, but there is no luck, these square brackets are confusing me Also help will be appreciated, "name": "default location"}], "name": "default location": "[" "location": ["default building"]: "default location" "}] thanks Try this: var_export (json_decode ('[location]: [["" building ": [" default build "]," name ":" diff Lot place "}]," name ":" default organization "}] ')); json_decode return array or object . You can print it from var_export not echo and you can reach values: $ "Name": "default organization"}] '); foreign currency ("[" "location": ["building": ["default building"], "name": "default location" $ Each $ item as $} {repetitive $ each- & gt; location [0] -> building [...

WCF on an existing asp.net webforms -

I have an ASP.NET web form that I want to start to create an iPhone application. And for this, I think that is the best way to expose Y methods using WCF, and this is my first time with WCF I have currently created a website using this project Has: File & gt; New & gt; Website, file & gt; No new & gt; ASP.Net Web Project Project My questions are: Can I use the code that is already on my website, or should I use WCF web methods As is the methods to reproduce. Should I add WCF services to my current project or should I have to create a new WCF project? If the second option is to implement it? If there is a tutorial how to do this, then it will be appreciated. Thanks in advance Go through the link below, You can get the original idea about yourself and then you can decide which is the best approach to making WCF service for your needs - & gt;

c# - Concatenating two queries bases on a foreign key -

मैं अपने .NET C # परियोजना में रिपॉझिटरी पैटर्न कार्यान्वित करने के लिए (कम से कम कोशिश कर रहा हूँ) जब मुझे डाटाबेस के साथ संवाद करने की आवश्यकता होती है तो मुझे ऐसा कुछ मिलता है: IList & lt; एकल & gt; तलवों = SoleService.All ()। ToList (); सेवा से बुलाए जाने वाले विधि का नाम उपर्युक्त क्वेरी से सूचित करता है, इसलिए मुझे सभी रिकॉर्ड फॉर्म एकमात्र तालिका प्राप्त हो। मैं नहीं चाहता और मुझे लगता है कि यह मेरी सेवा में बहुत अधिक कस्टम लॉजिक रखने के लिए इस पद्धति को लागू करने का सही तरीका है मेरा क्या मतलब यह है कि मैं केवल सर्व () पद्धति और सेवा के तरीकों के बाहर किए जाने वाले परिणाम के प्रत्येक संशोधन को रखना चाहता हूं। वर्तमान समस्या ये है मेरे पास इकाई एकमात्र और इकाई एकमात्र है। एकल कोड में एक विदेशी कुंजी कॉलम है समानतम दो तालिकाओं के बीच संबंध बना रहा है। अभी उन दो संस्थाओं के लिए मैं केवल All () विधि: var soleColors = SoleColorService.All () कॉल कर सकता हूँ; Var तलवों = SoleService.All (); लेकिन यहाँ मुझे एकमात्र से केवल उन पंक्तियों को चु...

php - how to rewrite url formatting with parameter name in yii -

I am very new to Yii, usually yii works like this url format baseurl / app_dir / conroller / action / parametername / vaule but I want to show it like this baseurl / app_dir / conroller / Action / vaule means the parameter is without name I read a lot of solutions but could not find, how to do this, please help me . This is somewhere in the docs, here is an example: '/ User / & lt; Id: \ w + & gt; / '= & Gt; 'User / view /' This means that the request will be directed to / user / someUserName view in the administrator User with parameter id with value someUserName . In this way you have the URL with the price only, but in the application it is available as the $ _ GET parameter name. Note : \ w + is only regex, which are supported here, for example you \ d + Can use value for numerical etc.

PHP ffmpeg conversion error -

I tried to convert some videos with ffmpeg and PHP When I PHP exec () execute the following command thee / usr / local / bin / ffmpeg -i /home/test/public_html/test.m4v-vcodec libx264 -acodec libmp3lame -r 30 -s 640x480 B 100k /home/test/public_html/output_640x480_test.m4v Output: / usr / local / bin / ffmpeg: line 4: / var / log / Ffmpeg.log: Permission denied FFmpeg version SVN-R26402, Copyright (C) 2000-2011 FFMPG Developers Created on April 18, 2012 at 05:19:10 GCC 4.1.2 Or 20080704 (Red Hat 4.1.2-52) Configuration: --prefix = / usr / local / src / ffmpeg --libdir = / usr / lib64 --shlibdir = / usr / lib64 --mandir = / usr / share / Man --incdir = / usr / contains --disable-aviSynth --extra-CFLAGS = '- O2G -Pipe -Wall -Wp, -D_FORTIFY_SOURCE = 2 -fexceptions -fstack-protector --param = SSP-buffer size = 4 -m64 -mtune = normal -fPIC '--enable-avfilter --enable-libdirac --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libo...

objective c - Image of NSView with background -

I'm trying to get an image of a scene, so I'll call it NSImageView . I am using the NSView s bitmapImageRepForCachingDisplayInRect: method. However, this method only returns the contents of the scene, without the window background. How can I get an image of the whole scene, because it looks on the screen with background-color etc? Current code - (NSImage *) imageOfView: (NSView *) View {NSiBITMAPIMJARP * Representative = [View BitMapExpressionFirstingDisplay: see.bound]; [See cache displayline: view: frame to bitmap image: representative]; Return [[NSImage alloc] initWithCGImage: [Representative CGImage] Size: view.bounds.size]; } / * This statement from CGDirectDisplayID Get index for display selected from array * / NSInteger displayIndex = [menu item tag]; / * Create a snapshot image of the current display. * / CGImageRef image = CGDisplayCreateImage (displays [displaysIndex]);

c# - WCF tcp connections stay open when process is killed -

I have seen similar questions here but no answer was found. I have an app that uses WCF to open a connection at a remote address, sometimes when I kill an app from the task manager or the app closes unconstitutional, the connection remains open and then when I If I restart the app then the one exception I told is already available to me. Some questions: Why do I have to do this kind of connection after killing this process Remains open? How do I close this connection when the process closes inadvertently? Before I try to create a new one, how can I close the connection? serer side: var url = Config.GetRemoteServerUrl (); Var binding = new NetTcpBinding (); Binding. Security.mode = SecurityMode.No; Binding Reliable session. Enabled = Config.Relaiable session; Binding Reliable session. Inactivity time = TimeSpain Maxwell; Binding.modeconnection = configure. Max Concentrations; Binding. ReaderQQs.MaxArereLang = Config Reader QuatusMaxArere Lang; Binding.mocsairev messag...

linux - How does ARM switch to svc mode in IRQ handler? -

The following code snippet is derived from Linux v2.6.11. Something similar exists in v3.8 as well. mrs r13, cpsr bic r13, r13, #MODE_MASK orr r13, r13, #MODE_SVC MSR spsr_cxsf, r13 @ Switch SVC_32 mode and LR, LR, # 15 LDR LR, [PC, LR , Lsl # 2] movs pc, lr @ change mode and branches See the following link for the actual file: I think that mode bits write in CPSR Current ARM mode can change. But how to write in SSPR (instead of CPSR), as a result of switching to SVC_32 mode? (Or) Something is happening in the previous instructions "Ammos PC, LR". Can anyone help me understand this? a mov or sub It copies the contents of the SPSR into the CPSR and enters the value of the source register. Program Counter (In this case, Link Register). In your example, this effectively sets the SVC mode mode and returns the function to the one time. There is more information about this on this.

c# - how to store multiple selected listbox items in a session and view on another form? -

The thing I want to do is select whether I want to select 1,2 or 3 items from listback and give them one Sessions and then display them all in a list box on another list. This is my code! This is my first post on stack overflow, so please do not hate & lt; 3 // WebForm1 Protected Zero Page_load (Object Sender, EventArgs e) {if (IsPostBack) {add lstProducts.Items ("Soap"); LstProducts.Items.Add ("Schampoo"); LstProducts.Items.Add ("conditioner"); }} Secure Zero cmdBuy_Click (Object Sender, EventArgs E) {string [] products = new string [3]; For (Int i = 0; I & lt; lstProducts.Items.Count; ++ i) {if (lstProducts.Items [i] selected) products [i] = lstProducts.Items [i]. Text; Other Products [i] = "0"; } Session ["cart"] = product; } Secure Zero cmdCart_Click (Object Sender, EventArgs E) {If (session ("cart") = null) {Response.Redirect ("WebForm2.aspx"); }}} // webform 2 protected void page_load (object s...

Change the button's function with jQuery? -

This may be a silly question but I can not find it right I can change the function of the button with the usual javascript, But not with jQuery I'm aiming for a very simple text-size button, this button needs two different functions; One that makes the text bigger and changes the click function on other functions, and it makes the other function lessen the text and changes the click function on the first function. Since the same button will be used to increase or decrease both ends, I need it to work. I am currently working on a school project and we only use jQuery / jQuery UI for this assignment. Will happen. With the usual JavaScript, something like this will happen: var button = document.getElementById ('click-button'); button. Click = First Click; Function firstClick () {button.onclick = secondClick; } Function secondClick () {button.onclick = firstClick; } How do I get the same thing with jQuery? Something like the code below will work. $ ("#c...

asp.net mvc 3 - Possible breaking change in MVC4 Razor that can be fixed with "@:@" -

I recently upgraded my website to ASP.Net MVC3 (Razor) to MVC 4 (Razor 2) , And doing so seemed like what it seemed like a breaker change in a razor-view engine. The scenario (very simplified) is shown below. @Electrical IEnumerable & lt; String & gt; @ {Layout = null; } & Lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Body & gt; & Lt; Div & gt; @foreach (X in Model) {@ string.format ("Foo Bar: {0}", x) // MVC4 / Razor2} errors & lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt; This works fine in MVC3 / Razor, however results in an error in the string.Format line in MVC4 / Razor2: Unexpected "string" keyword after the "@" character. Once inside the code, you do not need a prefix with "@" like "string". If you delete @ , the visual engine then asks that you end the line with the semicolon string.format Give. However, Rishers then warns (correctly...

jquery - The total shows the price with .999995 at end -

I have an error on this script. The calculation system works but there is an error: $ (document) .ready (function () {$ ("# total"). Val ("55.95"); $ ("# val (" 512MB "); $ (" # zodiac 1 "). Val ("512MB"); $ ("10GB"); Val ("10GB"); $ ("# zoder 2"). Val ("10 GB"); $ (function () {var ram = {0 : "512 MB", 1: "1 GB", 2: "2 GB", 3: "4 GB", 4: "8 GB", 5: "16 GB", 6: "32GB",} Prarm HRD = {0: "49.95", 1: "89.95", 2: "14.9.95", 3: "32", 4: "64", 5: "128" 6: "256" 0: "10 GB", 1: "15 GB", 2: "20 GB", 3: "25 GB", 4: "30 GB", 5: "35 GB",}; va R.phdd = {0: "49.95", 1: "99.95", 2: "100.95", 3: "49.14", 4: "28", 5: "40",} $ ("# Slider"...

java - mp3 cutter android -

The following code is working fine for me since I'm working with Android, so I do not use audiostream classes can do. file correctly = new file ("data1.mp3"); File file = new file ("data.mp3"); Correct.createNewFile (); FileInputStream = In the new FileInputStream (file); FileOutputStream Out = New FileOutputStream (true); Byte [] buffer = new byte [in.available ()]; For (int i = 0; i Now if I run the following code, it is giving its error and is not working correct.createNewFile (); FileInputStream = In the new FileInputStream (file); FileOutputStream Out = New FileOutputStream (true); Byte [] buffer = new byte [in.available ()]; In.skip (2048); For (int i = 0; i The only thing here is when I am giving this error to this code correct.createNewFile (); FileInputStream = In the new FileInputStream (file); FileOutputStream Out = New FileOutputStream (true); Byte [] buffer = new byte [in.available ()]; For (int i = 0; i So my real question is ...

Java.lang.NoSuchMethodError: com.Person.setCompanyList(Ljava/util/ArrayList;)V -

Is NosuchMethodError.my error that someone can help me why running in Java in running time is error. Java.lang.NoSuchMethodError: com.Person .setCompanyList (Ljava / util / ArrayList;) V its Meaning that the library version or the subject you have compiled is not the same version which is being run now. When you used to compile, the method was there (otherwise there was a compilation error), but now it is not possible (probably the jar file is too old). Try to clean and deploy your entire project There is often a case reflection when you have time to run (for methods that are not yet present) Is the name of the methods.

mocking - Using Spock to stub both Gorm and other methods in a Grails domain class -

Sorry if this is a newbie question but I really appreciate any insight that the community can offer me in relation to a problem location service (string target, string locator, app app, boolean sync = true) {If (! Target) to throw a new, IllegalArgumentException ("Illegal value for MSID:" + target) def locRequest = Request.create (target, Type.LOCATE) if (! LocRequest.save ()) {location location. Terror (target, "error in continuing to request location")} LocationSource.locateTarget (target, locator, app, sync)} I have a domain class, request is there Along with the default GORM methods, there are some additional domain methods, e.g. @EqualsAndHashCode class request {string reference string MSID type type position status destination destination date time date sorted date time date stabilize (string msid, type type, destination destination = destination.default) ) {New request (reference: context), type: type, position: position. Valid, date-wise: new date time...

email - PHP mail() Not displaying HTML -

We have recently upgraded to a Plesk Parallel Linux server and it appears that ignoring PHP setting header is! Emails are getting well, but the HTML tags displayed phpInfo () can be found here: PHP itself should be fine, but it is also included here. PHP Mail Code $ email = "example@example.com"; $ Message = "& lt; h1 style = 'font-family: helvetica, aerial; font-size: 17px' & gt; You have a password reset request in your account & lt; / h1 & gt;"; $ Headers = "to: noreply@pressgofer.com \ r \ n"; $ Headers = "Reply: noreply@pressgofer.com \ r \ n"; $ Headers = "Mime-version: 1.0 \ r \ n"; $ Headers = "Content-type: text / html; charset = ISO-885 9-1 \ r \ n"; Mail ($ email, "reset password information", $ message, $ headers); Many thanks, Nick Your phpinfo shows that mail.add_x_header is closed You need to turn on x-mail to enable the header Mail.ed_x_heade...

Getting Checkbox values when user edits form data. PHP -

There is a form with my check box that fills the user and submits. Then I have another form, which allows them to edit the information submitted. This second form pre-populates with information presented on the first form. It's okay with text fields, but how do I populate the checkbox? To wit. If they check the checkbox on the first form, how can I get another check to identify it and display the check box? I am new to PHP so I can not be more technical for this question When you submit the form, you have data on the next page, so if a checkbox looks like this: & Lt; Input type = "checkbox" name = "more 18" value = "1" /> You have to see that the person has chosen "more than 18" -series. ($ _POST ['over18'] == '1') {$ checked = 'checked' "checked";} and {$ check = ' Then your output looks like this for the checkbox: echo Each time the checkbox is checked, the next page ...

c++ - glDeleteBuffers crashes during destructor call -

Hello I am using VBO to load image texture and then drag it into C ++. VBO generates IDs and binds and draws here Zero ViewManager :: render () {glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); GlEnable (GL_TEXTURE_2D); GlEnableClientState (GL_VERTEX_ARRAY); GlEnableClientState (GL_TEXTURE_COORD_ARRAY); GlEnable (GL_BLEND); Globefenk (GLICCR_ALPHA, GL_ONMINUSISUSRCCLAAPHA); If (Decompressile image-> gt; tile texture == 0) {load-fixtures (decompressile image); GlGenBuffers (1, & DecompressTileImage-> VBOId); GlBindBuffer (GL_ARRAY_BUFFER, decompressTileImage-> VBOId); GlBufferData (GL_ARRAY_BUFFER, sizeof (* (this-> tileCoordList)) + sizeof (* (this-> tileTestructureCoordList), 0, GL_STATIC_DRAW); GlBufferSubData (GL_ARRAY_BUFFER, 0, sizeof (* (-> tileCoordList), this-> tileCoordList); GlBufferSubData (GL_ARRAY_BUFFER, sizeof (* (- >-- tileCoordList)), sizeof (* (this-> tileTextCoordList), this-> tileTextureCoordList); } Other {glBindBuffer (...