Posts

Showing posts from July, 2014

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: < Pre> 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

c# - Remove text box of MS word document -

I have some MS Word documents that contain text in text boxes, but I want to remove those text boxes but this form of data Should be kept in how can I do this? I think you can hold something using text inside the text box like ActiveDocument.Shapes (1) .TextFrame.TextRange.Text and then you can remove it by doing something like ActiveDocument.Shapes (1). Delete, and after that you have to insert the text from the text box in the relevant part of the document.

choose javascript variable based on element id from jquery -

I think this is a simple question, but I am still relatively new to javascript and jquery. I am developing a site for a touch interface which uses unordered lists and jquery .click functions to capture input data. I have one block with 3 divisas: SS is a section to input time, each has a list of points for the time. I have to get input for each column and set it as a variable. I originally created the input to change the form input, because I did not understand javascript very much, using Div id was easy to change to 3 hidden inputs, but how can I understand this now with javascript variables? P> This is my original jquery code ... $ ("div # timings> div> ul & gt; li) click (function () {Var id = $ (this) .parents (". Time"). Attr ("name"); var number = $ (this) .HTML (); $ ("input #" + id) .val (number) ;}); the last one I set one of the hidden inputs out of 3 in which the click was done in the person. I need to do this so t

MySQL INSERT IGNORE not working -

यहां कुछ नमूना डेटा के साथ मेरी तालिका है a_id | B_id ------------ 1 225 2 494 3 58 9 जब मैं यह क्वेरी चलाता हूँ INSERT IGNORE में table_name ( एयूआईडी, बी_आईड) मूल्य ('4', '230') ('2', '4 9 4') यह उन दोनों पंक्तियों को सम्मिलित करता है, जब वह दूसरी मान युगल को अनदेखा करना चाहेगा (2, 494) कोई सूचकांक परिभाषित नहीं है, न तो उन कॉलम प्राथमिक हैं। मुझे क्या पता नहीं है? से: यदि आप IGNORE कीवर्ड का उपयोग करते हैं, तो INSERT स्टेटमेंट निष्पादित करते समय त्रुटि उत्पन्न होती है बजाय चेतावनी के रूप में इलाज किया उदाहरण के लिए, IGNORE के बिना, पंक्ति में तालिका में किसी मौजूदा अद्वितीय अनुक्रमणिका या प्राथमिक कुंजी मान को डुप्लिकेट करता है एक डुप्लिकेट-कुंजी त्रुटि उत्पन्न करता है और कथन निरस्त कर दिया जाता है। इग्नॉर के साथ, पंक्ति अभी भी डाली नहीं गई है, लेकिन कोई त्रुटि जारी नहीं की गई है। (मेरी इटैलिक)। आपकी पंक्ति "कोई मौजूदा अद्वितीय अनुक्रमणिका या प्राथमिक कुंजी मान" का नकल नहीं कर रहा है क्योंकि आपके पास प्

c# - Ordering of reflection requests in dotnet -

When I call GetProperties () on one type, properties are ordered because they were written in the source code Are there. It is very easy but my question is, if it is a guaranteed behavior or it can change based on the runtime version and the environment, does anyone know anything about this? No, you can not assume the order will be the same : Excerpt from : The GetProperties method does not return properties in a specific order, such as alphabetical or announcement order. Your code should not depend on the order in which the properties are returned because this order changes.

powershell missing member methods in array -

I have (another) predicable query that I have an array of powers in which I remove () and split commands Have to use. Normally you set an array (or variable) and the above versions are present. Below are two methods missing on the $ csv2 array, I have checked using the received-member CMD. How can I use extract to get rid of lines with Nain? Apart from this, how can I divide the columns into two different variables. At the moment, each element of the array displays a line, for each line, I have to convert it to two variables, one for each column. Timestamp Utility --------- ----------- 1276505880 2.0763250000e +00 12765058 9 0 1.7487730000e +00 + 1276505 9 00 1.6906890000e +00 1276505 9 10 1.7972880000e +00 +1276505 9 20 1.8141900000e + \ SNMP \: 00 1276505 9 30 Nan 1,276,505 9 40 Nan 1276505 9 50 0.0000000000e +00 allocate $ SystemStats = (Get-F5.iControl) .SystemStatistics $ reports = "c data" + $ gObj + ".csv" ### a new query object and add t

How do I iterate through hierarchical data in a Sql Server 2005 stored proc? -

मेरे पास निम्न के जैसा एक SqlServer2005 तालिका "समूह" है: Id (पीके , Int) नाम (varchar (50)) parentId (int) जहां ParentId समूह तालिका में दूसरे आईडी को संदर्भित करता है। इसका उपयोग पदानुक्रमित समूहों को मॉडल करने के लिए किया जाता है जैसे: समूह 1 (आईडी = 1, पैरेंटिड = नल) + - समूह 2 (आईडी = 2, पैरेंटिड = 1) + - समूह 3 (आईडी = 3, पैरेंटिड = 1) + - समूह 4 (आईडी = 4, पैरेंटिड = 3) समूह 5 (आईडी = 5, पैरेंटिड = शून्य) + - समूह 6 (आईडी = 6, पैरेंटिड = 5) आपको तस्वीर मिलती है मेरे पास एक और मेज है, सरलीकरण के लिए इसे "डेटा" कहते हैं, जो कुछ ऐसा दिखता है: < कोड> आईडी (पीके, आईटी) कुंजी (वर्चार) वैल्यू (वर्चार) ग्रुपआईडी (एफके, इंट) अब, मैं एक संग्रहीत प्रक्रिया लिखने की कोशिश कर रहा हूं जो मुझे "डेटा प्राप्त कर सकता है "किसी दिए गए समूह के लिए उदाहरण के लिए, यदि मैं समूह 1 के लिए क्वेरी करता हूं, तो मुझे डेटा से कुंजी-मान-जोड़े देता है जहां समूह आईडी = 1. यदि मैं समूह 2 के लिए क्वेरी करता हूं, तो यह समूह आईआईडी = 1 के लिए केवीपी वापस दे

Caesar Cipher in Java (Spanish Characters) -

I have read, and I was wondering if there is any way to consider the full range of characters? For example, "á", "é", "ö", "ñ", and "" ([space]) are not considered? (For example, my string is "Hello World", and the standard result is "hoof # zurug"; I want to erase that "#", so the result will be "hoarsegroog") I'm sure That my answer is in this part of the code: if (c> = 32 & amp; amp; amp; c & lt; = 127) {// life Change the base to make it easier, and use a // to clarify anxiety intensely ... after int x = c - 32; X = (X + shift)% 96; Character [m] = (four) (x + 32); } But I have tried some things, and it does not work. Look at this pseudo - must be implemented nicely: // You must define your category, obviously - it is not quite clear that the example "Ź" should be included and this "z" array char_range = ['a', 'á', ' B

amazon s3 - What video encoder services do you use with s3? -

We were using FFmpeg which is free and when a bug happened that broke the system, then the previous developer Installed. My question is, what do you recommend for quality video encoders? Is it best to stick to FFPPG and keep it for free, or does a small website really need heavy duty service like Panda? Both FFMPG and MkCoder are good quality FOS encoders. If you are having trouble in encoding (again: your bug), then perhaps it may be able to look at their configuration, maybe even output codec and working like that. If your remote system has a local mirror, then it may help you to examine the various configurations running on the remote server. I would be surprised that Panda was not used, tools such as MenCoder or FFPAP encode it. The special advantage of the third service (something like video encoding in particular) takes full load of heat from your server. The encoding video is a seriously overwhelming task. He said, Panda in charge with prices, you can easily

css - TinyMCE is removing <style> tags -

I am facing a problem with TinyMCE when I enter a style tag in TinyMCE's HTML editor, then When I click on an update, it removes the tag & lt; Style type = "text / css" & gt; .newclasss {color: # c9c9c9; } & Lt; / Style & gt; My valid elements are as follows: & lt; Script type = "text / javascript" & gt; Var valid_elms = "hr [square | width | size | noise]"; Valid_elms + = "span [class | align | style],"; Valid_elms + = "font [face | size | color | style],"; Legal_alm + = "img [href> name | title | click | align | alt | title |"; Valid_alom + = "width | height | wispace | hspace],"; Valid_elms + = "iframe [id | square | width | size | noshade | src | height]"; Valid_lms + "frameborder | limit | marginwidth | marginheit |" ;;;; Legitimate_elms + = "target | scrolling | permissions, genre"); Expand_valid_elements: valid_elms & lt; / Script &a

c# - How can i add text field listdictionary elements -

How can I write a text field through "," I try to write a rewrite script with ListDictionary: LD parameters: a, b, c, di is required: text = a, b, c, d < Code> Zero InsertDataToSql (ListDictionary LD, String TableName) {string Text = "Enter in ENG_" + TableName + "VALUES ("; String AddText = String.Join (ld, ','); By ignoring the threats of manually becoming a SQL statement, you should be able to create the desired string as follows: string addText = string Select .Join (",", ld.Cast & lt; Dictionary entry & gt; (). Select (D => Escape (DKA) + "=" + Escape (D.Vell)) .Oire ( } "{3", "value 3"}, {"key3", "value1"}, {"key2", "value2"}, } then select in the code above string [] temp = new string [] {" Key1 = Value1 "," Key2 = Value2 "," Key3 = Value3 ",}; and these strings together will be included i

dojo - dijit Tree : finding treenode associated with new data store item -

I want to highlight a programmatic inserted node. I am using store.newItem; It gives me a datastore item, to highlight, I need a Teenode Can anyone tell me how to find the tray associated with the item? Thanks, Larry tree.GatNodeSystem () It gives an array because there can be several tree nodes for one object, although usually there is only one.

c# - Is it possible to programmatically determine the type of a SharePoint object? -

I am using the SharePoint 2007 object model API to play a role for the SharePoint object, but when you do this , You should already know the type of SharePoint object, such as: // Apply a new role loyalty to the folder if you want (ie the SPFI.it ... SP folder Instead .at.in) folders, you can do this at the list level. Item.roll associations. Add (role assignment); (code snippet from) I want to implement a method that is able to cross the SharePoint object, to determine the type of SharePoint object Do this: Public Static Balls Assenorol (String Spub URL, Object Spobbatch, Spoiler Outer, String Sprildiffinition); Example SharePoint object type would be: SPS ite, SPWeb, SPList, SPITIT, SPfield, SPFolder Any help to deal with the issue of determining the type of type SharePoint object will be highly appreciated. SidNet: (sort of), if you know that the object is located in the site, then this is not really a route, although I know completely enough to go down. I t

Is there a placeholder for classname in Visual Studio 2008? -

I am creating a snippet and instead of typing it to replace the current class name Required Now it is: Using Daniel. Nursing Scheduling.action.Data Services Interface Public class $ name $ data service: saradata service & lt; $ NAME $ & gt ;, $$$ DataService Service {Public $ NAME $ Data Service (IRPository & lt; $ NAME $ & gt; stores): Base (repository) {} Will a placeholder change automatically?

Include a JSP in Lotus web page -

What is a way to include a jsp page (what it gives) in a command web page? What did I want & lt; Jsp: include url = "...." & gt; is equal to but tag will return an HTML string to use the lotus side (if it is present on a "lotus tag") and used by Lotus Please note that I do not know anything about Lotus, this inquiry is before developing a project, and I am on the JSP side :) Lotus will need to call about 1 to 10 jsp files to make side pages We have got a technical problem at the moment. The first idea was to make an Ajax call by Lotus for each of the JSP parts, but since it should work without javascript, this is not a good choice. From my "JSP developer perspective", I was telling Lotus Dev that "I just need my JSP where you need it" but it seems that it can not be done easily, So this question is why. I thought / still hope that Lotus Dev can use a simple technique that includes the reaction of the call inside my JSP

How to normalize a database where different user groups have different kinds of profiles? -

In my application database there is a group table that separates users into logical roles and defines the level of access ( Administrator, owner, vendor, customer service, etc.) There are several users of the group, including login details like usernames and passwords in the user table. Now I want to add user profiles to my database. The problem I have (probably due to my relative unfamiliarity with proper database generalization) is that different user groups have different types of profiles, a vendor The profile will include its commission percentage, whereas an administrator or customer service will not need this value. So, will it be the proper way to create a unique profile table for each group? (Such as admin_profiles, or salesperson_profiles). Or there is a better way that adds some details to a normal profile, while some users have increased the information. And if so, then what is the example of how it is done with the example of the commission? A case where these

r - Changing text size on a ggplot bump plot -

I am quite new to ggplot I have created a bump plot using the code posted below. I got the code from a blog I have lost the link .... I want to be able to increase the size of the labels (here the letters that keep very little on the left and the right plot) affect the width of the lines Without (it only makes sense after running the code) I have to Have tried to change parameters but she always change the line width. Any suggestions appreciated. Tom Required (ggplot2) df & lt; -matrix (rnorm (520), 5, 10) # creates a random example (df, 1, rank) dfm & lt; -melt (Price.Rank) Name (DFM) & lt; -c (Surname for "Date" (DF) & lt; - Letter [1:10] Price, "Brand", "Value") P & lt; - ggplot (DFM, AES (factor (date), value, group = brand, color = brand, label = brand)) p1 & lt; - p + geom_line (AES (size = 2.2, alpha = 0.7)) + geom_text (data = subset (dfm, date == 1), aes (x = date, size = 2.2, hjust = 1, vjust = 0)) + Geom_te

c# - "Greater than" and "Lesser than" symbols in URL not working -

i, I have the following URL that has been successfully handled by the ApacheTomack application: Http: // localhost: 8080 / ApplicationX / FileY / UpdateDocument (` For any reason, when I try to handle the same request in IIS with the ASP.NET HTTP request handler (Applying Class IHttpHandler) 'Bad request' is exempted and my code is never called. I have implemented this patch in the registry () to allow the character ':', but this has not helped with more than the characters. Is there any way to do this work? Any reason with this is allowed in Apache, but not in IIS? Cheers. PS I am using IIS 5.1 on a Windows XP workstation with .NET 3.5 SP1. Try using character entities to avoid those characters ?: http: // localhost: 8080 / ApplicationX / FileY / UpdateDocument (`& amp; Lit; location =" elsewhere "& amp; Content; ContentZ & amp; Lift; / Add & amp;; Gt;`) Xml? VIEW = RAW

Android Icon Duplicates in Application Dock -

For some strange reason, my project is launching two icons in the App Drawer, the same name, the same project. I do not know what is the reason for this. Does anyone have any suggestions? In the white circle, m is my default icon. If you look at the screenshot, you will see that it will appear twice. I've checked the App area, and it's only installed once. Do you have two activities? Are your profiles marked as activities of the launch? This will show two different launcher icons.

visual studio 2010 - Different ASP.NET 4 page contents depending on build type -

ASP.NET MVC 2 वेब साइट पर काम करते समय मुझे निम्नलिखित समस्या का सामना करना पड़ा। मुझे उत्पादन के लिए समाधान का निर्माण करते समय Google Analytics के लिए साइट के मास्टर पेज पर स्पेशियल लिपि प्रस्तुत करना होगा, लेकिन डिबग और टेस्ट के लिए इस स्क्रिप्ट का निर्माण नहीं किया जाना चाहिए। मैंने इसे स्वचालित रूप से बनाने का एक तरीका ढूँढ़ने की कोशिश की है, लेकिन समाधान खोजने में सफल नहीं हुआ। मेरे पास एकमात्र विचार है जो एक बैच फ़ाइल बना है जो उत्पादन के निर्माण से पहले पृष्ठ में आवश्यक स्क्रिप्ट संलग्न करेगा और बाद में हटा देगा। लेकिन मुझे आश्चर्य है कि इस समस्या को सुलझाने के लिए कोई बेहतर उपाय है? आपको पूर्वप्रक्रमक निर्देशों का उपयोग करने में सक्षम होना चाहिए #if! DEBUG // रेंडर कोड यहाँ # लार्स // कुछ और # रेंडर करें #endif

Nesting quotes in JavaScript/HTML -

How do you nest out of the second level in HTML? As far as I know, there are only two types of quotes - single (') and double ("). I have the information to avoid using slash - you have to run in the code, but avoiding the browser level did not work What is the acceptable method to get something similar to the following? '); "> Some text You must use the appropriate escape / encoding either in HTML Use the character references: & lt; p onclick = "exampleFunc ('& amp; Lead; div id = & amp; quot; divId & amp; quot; & amp; Gt; & amp; lt; / div & gt; '); "ExampleFunc ('\ x3Cdiv \ x20id \ x3D \ x22divId \ x22 \ x3E \ X3C / div \ x3E'); "& Gt; some text & lt; / p & gt;

c# - Force to call virtual base function instead of the overriden one -

In the following example fails "test that the v1 function is called". Is there a way to emphasize the basis implementation of "runfunction" through a frequency of "virtual v2"? class V1 {public virtual string runfunction ("}" "V1"; }} Class V2: V1 {public override string runfunction () {return "V2"; }} [Test] Public Zero Testcall () {var v1 = (v1) New V2 (); Var v2 = new v2 (); Assurance ITTru (v1. Runfunction) == "V1", "Test that the V1 function was called"); Confirm. Trust (v2.RunFunction () == "V2", "Test that the v2 function was called"); } Thanks for watching, boys and girls. The complete point of class heritage is that it allows you to override the selected base class behavior . You can use the V2 to use the base to call in the base-class code from V1 , but you can not do outside the class Do it As a quick example of usage: class V2: V1 {public override string

Linking to a C library compiled as C++ -

I'm in Linker Paradise now I have a C Library that is compiled only in Visual C ++ (it's probably GCC If: I compile it as a C ++ code __cplusplus in all the announcements < Code> Extern "c" {} The results result in being attached to it, by doing so I call a static library, say, Code> bsbs.lib Now, I have tester < / Code> is a C ++ project, which calls repeated to bsbs.h . All are alright, as long as I do not attempt to link to bsbs.lib , where I am quite familiar: tester.obj : Error LNK2001: Unsolved exotic symbol _fofu and it always looks like fufu , which is tester ( barbar or something else). Update: As requested, I've expanded on Point 2. Thanks a lot for the help guys! #ifndef _BSBS_H #define _BSBS_H / * Stop the C ++ program by associating these definitions. * / #ifdef __cplusplus extern "C" {#endif #include & lt; Stdio.h & gt; #include & lt; Setjmp.h & gt; ....... ....... #ifd

What's special about mouse capture and middle mouse button in WPF? -

When I call CaptureMouse () in response to mouse navigation, it will capture and then release mouse Will give Hi? I have tried to use preview events, setting handle = true, no matter what I do not understand mouse capture in WPF? Here are some sample code that reproduce the problem. // TestListBox.cs using System.Diagnostics; Using System.Windows.Controls; Nom place local {public class} testlistbox: listbox {public testlist box () {mousedown = (_, e) = & gt; {Debug. Litlines ("+ mouseguard"); Debug.lightline ("Capture:" + CaptureMouse ()); Debug.WriteLine ("- MouseDown"); }; GotMouseCapture + = (_, e) = & gt; Debug.WriteLine ("GotMouseCapture"); LostMouseCapture + = (_, e) = & gt; Debug.WriteLine ("LostMouseCapture"); }}} Generating a default WPF app will use the test class for its main window: & lt; Window x: Class = "local.main window" xmlns = "http://schemas.microsoft.com/winfx/2006/x

c++ - Printing escape character -

When I'm given "d" "\" / "b" Print the statement letters for letters (D, B, slash, backslash, and 5 coats) in +. Now only errors shown are line if (i.at (j) = "\\") and else if (i.at (j) = "\" ") In addition, how should external repeat apostrophe be excluded? #include Include # include & lt; cstdlib & gt; Namespace STD usage ; Int main (int argc, const char * argv []) for {string i = argv [1]; (int j = 0; j; = shapes (i) -1; j ++) {if (i .at (j) == '\\') {cout & lt; & quot; '\\';} and if (i.at (j) == '\ "') {cout & lt; & Lt; '\' '; } And {cout & lt; & Lt; I.at (j); }} Return 0; } * Modification - OK, so I correct double oposcripts to double oposcripts, but the code always stops at me. You have your own equality test ( == , not = < / Code>). Also, start with 1 index, and go up to 1 less (2 less, by index) than the length of t

asp.net - Flush separate Castle ActiveRecord Transaction, and refresh object in another Transaction -

All of my ASP.NET requests are wrapped in a session and a transaction that is committed only at the very end. At some point during execution, I would like to insert an object and make it visible to other potential threads - that is to split the inclusion in a new transaction, commit that transaction and move on. The reason for this is that the request in question hits an API, after which to hit me on any other page in the series (near-synchronous) to tell me that it is processed , And thus two transaction records because the original request was not yet finished, and thus the transaction was not recorded. So I tried to wrap the entry code with the combination of both a new session scope, transaction scope (transaction mode), everything was manually slipped, etc. However, when I refresh the object, I am still getting the old object state. Here I am looking for the OD sample: post out post = post. Search (ID); // This post has a status status. Using (Transaction Scope Tran

Android service killed -

I have a service running in the same procedure as my process. Sometimes the Android OS decides to beat my service (possibly due to low memory). My question is: Is my application being killed with service? Or how does this work exactly? Thank you! Be sure to read first: The key to this is that on Android A process is just a container for code - or especially one or more components (activities, services, receivers, providers). By default all components get their own dedicated process in .apk, all of which run together. It is almost always the way you want it. When the user is interacting directly with the components of that process (which is an activity), then Android will work very hard to run this process, and you will not see it except for extraordinary circumstances. Killed. When the user is no longer directly interacting with the process, then this expense is worth compared to the other processes described in the referenced documentation. That is, empty procedur

pivot - Matrix Transpose TSQL -

Can we move the matrix in standard SQL2005 / 2008 (rows, column and column rows are formed)? 1 2 3 4 5 4 6 6 7 7 8 9 8 9 1 3 4 5 6 2 4 5 6 7 Change in 1 4 7 1 2 2 5 8 3 4 3 6 9 5 6 4 6 8 5 6 5 7 9 7 How about any of the rows & lt; & Gt; None of the columns? Let's consider the number of rows that have not been set. You may want to reformat your question, but a change in your data is easy Create: Create table matrix (row int, column int no zero, value & lt; datatype & gt; not tap) as row selection column, row in column form, matrix Value

Set data structure of Java in javascript/jQuery -

What is a way to create a Java-like data structure (unique archive) in JavaScript? For a set of strings, I only use one object with the value. var obj = {}; Obj ["foo"] = true; Obj ["bar"] = true; How it basically works in Java, assuming that the Javascript object is implemented as a hashtable (which is normal) [/ s].

html - Can jQuery select elements with IDs that start similarly? -

I have multiple comment IDs that I want to reset to a default value. Ex: & lt; An id = "comments_inner_toggle_45" & gt; Example 1 & lt; / A & gt; & Lt; An id = "comments_inner_toggle_608" & gt; Example 2 & lt; / A & gt; & Lt; An id = "comments_inner_toggle_28" & gt; Example 3 & lt; / A & gt; ... How can I write the correct tag on jQuery and take some action on it to select every tag with an id of "tags_inner_toggle_"? I think this is something like this: $ ('a [id | = comments_inner_toggle _]'). This is incorrect, but because the above code only matches the tag with "Comments_inner_toggle_" and does not end with the attached number. How do I fix it? Thanks for the help! :) $ ('a [id ^ = comments_inner_toggle _]'). The carat selector starts to mean. | It means or starts with it and has a hyphen.

java - Yahoo messenger login -

There is a sample code for logging in Yahoo Messenger using open YMSG jar which is on site There are exam classes that show the correct implementation.

Java JIT compiler compiles at compile time or runtime? -

From Wikipedia: Computing, Bus-time compilation (JIT), also known as dynamic translation, is a technique to improve the runtime performance of a computer program. So I think that JVM has another compiler, not Jawak, which compiles the byte code by machine code at runtime, while Jawak prepares the source of biotech, is it correct? is? That's right. javac .java source code to .class bytecode for JVM (Java virtual < Li> hours> may contain even more compiler! Note that in addition to Java, other languages ​​may also be included in the fun due to their own compiler, for the cap JVM bytecok, and then to run Use JVM Runtime. On the hotspot, it also means that they will get JIT-compiled. Also see

How to select rows using key board in data grid in flex -

Hi, Let me place the key board in the Flex data using the up and down arrow buttons Must choose grid Please give solution. Thanks, Sun You can move between the use of keyboard navigation By doing the cell and rows I'm not sure how this indicates the selected index / selected items in the property. You can do some work by listening to key press events; I would probably start with the key:

How to insert both an image and a button in an Android application at once? -

I need to insert two images and two buttons. The required action is that when I click on the first button, Then the same image should be displayed. This button is also required for the second button, but the second image should be displayed. Am I guessing that there is a button with an image on it? For this, you will need one.

ruby on rails - how can we use preg_match_all()in RoR -

Is there any ROR method that can work similar to the preg_match_all () php function? Scan: string = 'joe@example.com ; Walter@example.org 'result = string.scan (/ ([a-z0-9 _.-] +) @ ([a-z0-9 -] +) \. [Az.] + / I) P results Size # = & gt; 2 result # = & gt; Here [["which", "example"], ["Walter", "Example"]] Here's a good article:

telerik - RadAjaxManager problem when showing/hiding control on page loading -

I have a webform with dropdown list, labels and textbox as follows: & Lt; Asp: dropdown list id = "ddlTest" runat = "server" autopost = "true" & gt; & Lt; / ASP: DropDownList & gt; & Lt; Asp: Label ID = "lblTest" runat = "server" text = "some text" & gt; & Lt; / ASP: Labels & gt; & Lt; Asp: text box id = "edtTest" runat = "server" & gt; & Lt; / ASP: text box & gt; I want to show / hide the label / text box based on the selected value in the dropdown list. That's why I've added RadAjaxManader: & Lt; Rad: AjaxUpdatedControl ControlID = "edtTest" /> & Lt; / UpdatedControls & gt; & Lt; / Red: AjaxSetting & gt; & Lt; / AjaxSettings & gt; & Lt; / Red: RadAjaxManager & gt; And "Setup Upsability", which takes value from the dropdown list, does some futures and explains whether to show

sql - Retrieving the second most highest value from a table -

मैं तालिका से दूसरा उच्चतम मान कैसे प्राप्त करूं? तालिका से अधिकतम (वैल) चुनें जहां val & lt; (अधिकतम (वैल) फॉर्म टेबल का चयन करें)

PHP Programming Spam Prevention -

What is the safest way to fight spam? Any algorithms? Or the way to fight back spammers? Get a captcha friend, maybe this is the best way to defeat spam, here's a great is. It is very easy to integrate with PHP and powerful is powerful.

c++ - Qt creator, insert custom menu at specified place into menu bar -

I have created a menu bar and some menus with the Qt constructor from one of the menus to QActionGroup The features were to be coded to be used now it is easy to add my custom menus to the menu bar: printMenu = menuBar () - & gt; Admany (tr ("& Print")); But in the last position of my menu menu bar how do I add my menu to a specific location? (For example, second place after file menu) Greetings Use in Combine with For example, if you want to dynamically insert the "Print" menu in the first place from the "Help" menu, then you can do something like this: < Code> QMenu * printMenu = new QMenu (tr ("& Print")); Menu Bar () - & gt; Insert Menu (ui- & gt; Menu Help-> Menu Action (), Print Menu);

graphics - efficient algorithm for drawing circle arcs? -

I am using the mid point circle algorithm (Bresenham circle) to attract completely full circles. Is there something similar to attracting circle arc? I would like to specify a starting angle and end angle and only take that part of that circle. Thanks in advance! Edit: is to attract a circle arch filled with a pi-slice :) Do not have some libraries already in your platform that depict these types of shapes? Attract a full pie-slice: First of all, cut the pie vertically and horizontally in the quarters. If your pie piece is one of those quarters, or one of these fits in a quarter, then use the following procedure once. Otherwise your pie piece has been cut into pieces - it can also be for some very thin pie-splaccess - repeat the following for each piece. I am going to describe the pie slice that fits the top quarter - the other quarter is equal to the start and end of the arc pixel (this may require some triggers) . I'm assuming that the "beginning" o

python - In django : how to renew expiry date for current session? -

I have a user logged in. How can I extend / renew the expiration date of the request received from the request? thank you in advanced! Here are some middleware that increases the authenticated user's session, it is essentially theirs permanently Expand the session by logging in to more than 60 days if their session is less than 30 days away. custom_middleware.py: Import time from Django.utils import timetable EXTENDED_SESSION_DAYS = 60 EXPIRE_THRESHOLD = 30 square ExtendUser session (object): "" "Authenticated user sessions So that they do not have to log back in each. 2 weeks (the default of Django is set by the setting 'SESSION_COOKIE_AGE`). " "Def process_request (self, request): # requestuth.user.is_authenticated (#): now = timezone. # If only the current expiry_date is less than 30 days, then only expand the session if request.session.get_expiry_date () & lt ; Now + TimeDelta (day = EXPIRE_THRESHOLD): request.session.set_expiry (

debugging - How do I get my Jscript Debugger to Attach to a Process? -

I get the following JScript debugger error when I click on Start Debugging Button in the Script tab of Developer Tool (F12) I : Unable to connect to this process Closing and launching all browser windows means there is no effect again. The task of eliminating the process tree in Windows Task Manager and starting a new IExplore task does not have any effect. Killing Shift-F5 when there is no effect in the Developer Tools window. Rebooting the whole machine reveals how much I am desperate and has no effect. Searching for "gigibug" in the regedit [HKEY_LOCAL_MACHINE \ SOFTWARE] branch now just shows I do not know what I'm looking for. I think I have a site in debug mode from Visual Studio I experience this problem while launching. If you want to use a debugger in the Internet Explorer Developer Tool, you will need to launch the site outside Visual Studio.

single backend Language or different frontend Language in Wordpress -

Image
Is it possible to change the language of my WordPress installation (WP 3.0 multijite) only to the frontend (.mo / .po files) ? Change this option here: < / P> Any thoughts? Thank you for helping! I am also looking for this information. For now I have found this link useful: wordpress.org/extend/plugins/bogo/ wordpress.org/extend/plugins/admin-in-general/ Oh, Finial This plug-in fixes my problem: Ku-Boy's backend localization just install the plugin manager or from here: and then the default WordPress language - front-end will have a back-end language, which You can set the plug-in settings. ps for full multi-language support, you can use wpml.org Regards, DimeDroll

android - ListView and Buttons inside ListView -

After I want to display a button inside ListView . The goal should be to click on the ListView line or button. Click on the line, it shows more information, click on the button it appears on the bottom and the button. The same as the Gmail app After clicking on the checkbox at the right and after clicking on the checkbox at the bottom, there is a button bar. My problem is after clicking the button in ListView , the button is not clickable if I use the LinearLayout button ButButton.setClickable () then it works, but only the button ListView does not respond to any more clicks! I have tried. The same issue as the above ... If you are using a custom adapter, clicking the button inside a ListView will not work so you should try to use the following code to check for OnItemClickListener ListId.setOnItemClickListener (New AdapterView.OnItemClickListener () {Public Zero onItemClick (AdapterView. & Lt;? & Gt; List, View V, Integer Status, Long ID)

javascript - IE Date.parse method returns NaN for Date with Time string -

We are trying to parse the date with the timestamp string, it's running in IE, but Firefox works fine is. Here is the code WARNING (New Date (Date PRSE ("2010-01-31 T12: 00: 00.233467-05: 00"))); Any ideas work in IE browser? thank you in advanced. If you can keep your input in this form: YYYY / MM / DDThh: mm: ss This will work. Example: WARNING (New Date (dated PRSE ('2010-01-31 T12: 00: 00.233467-05: 00'.rele (/ - / ig, '/').split('.')[0])))); If you want time zone, then you have to find another way

Advantages of Clojure -

Can someone explain the benefits of closure and what kind of applications are it suitable for? I do not intend to compare with any language as it is appropriate for a language as it is for yourself. My intention is to know the right tools for the right job, and in this scenario where the closure is fit.

c# - Retrieve enum value based on XmlEnumAttribute name value -

I need normal work to retrieve the name or value of the enum based on "name" XmlEnumAttribute "name". For example, I have the following values ​​defined: public enum currency The first currency ANIM value is 1; Enum's name is "cdn"; And the name of the property named XMLEnumAttribute is "00" If I have the value enum, I can get XmlEnumAttribute "Name" value following the following general function:. public function GetXmlAttrNameFromEnumValue (t) (ByVal pEnumVal As T) As String = pEnumVal.GetType as dim type Dim information FieldInfo = type.GetField ([Enum] .GetName (GetType (T), pEnumVal)) is defined as = CTYPE (info.GetCustomAttributes (GetType (XmlEnumAttribute), false) (0), XmlEnumAttribute) 'If any xmlattribute as dim att XmlEnumAttribute, Name return return att.Name termination function Then using the above mentioned function, I can specify the currency enum type I can pass the value of 1, and the return v

iis - Forcing intranet users to view webpage in IE8 mode, not compatibility mode -

संभव डुप्लिकेट: हालांकि मैं निर्दिष्ट कर रहा हूं & lt; meta http-equiv = "X-UA- संगत" सामग्री = "IE = 8" / & gt; लेकिन आईई के "संगतता दृश्य में प्रदर्शन इंट्रानेट साइट्स" की सेटिंग के कारण, मेरा ऐप IE8 में नहीं देखा जा रहा है, लेकिन संगतता मोड में। किसी को भी पता है आपकी सहायता करेगा। यदि (window.navigator.appName == "माइक्रोसॉफ्ट इंटरनेट एक्सप्लोरर") {// यह एक IE ब्राउज़र है इंजन किस मोड में है? अगर (document.documentMode == 8) // IE8 {चेतावनी ('IE8')} और {चेतावनी ('IE8 नहीं है या कंपाटीलिटी मोड में'); }} झूठी स्थिति के अनुसार (IE8 नहीं या Compatibilty मोड में) आप उपयोगकर्ता को उस पृष्ठ पर रीडायरेक्ट कर सकते हैं जो कहता है कि उसका ब्राउज़र कैसे सेट करें। मुझे आश्चर्य है कि क्या ऐसा करने के लिए एक स्वचालित स्क्रिप्ट है?

Building lxml for Python 2.7 on Windows -

I am trying to make LXML for Python 2.7 on a Windows 64 bit machine. I could not find LXL eggs for the Python version 2.7. So I am compiling it from sources. I am following the instructions on this site Under the stable linking section I'm getting the error C: \ Documents and Settings \ Administrator \ Desktop \ lxmlpackage \ lxml-2.2.6 \ lxml-2.2. 6> Python setup.py bdist_wininst --static building lxml version 2.2.6. Note: Trying to create without Cython, pre-generated 'src / lxml / lxml.etree.c' needs to be available. Error: 'xslt-config' has not been identified as internal or external commands, operative programs or batch files. ** Make sure that libxml2 and libxslt's development packages are installed ** Use the libxslt building's build configuration against libxml2 / libxslt in one of the following directories: .. \ libxml2-2.7.6 - win32 - w2k - x64 \ Lib .. \ libxslt-1.1.26 - win32 - w2k - x64--0002 \ lib .. \ zlib-1.2.4 - win32 - w2k - x

python - Online job-searching is tedious. Help me automate it -

Many job sites have broken the searches that do not let you lower the job level, even when they It is usually wrong, it is usually wrong. For this, you should be deployed through hundreds of postings that you can not apply before doing a relevant, highly miserable search, since I want to focus on writing cover letters, so I have a program to see a large number of postings. I want to write, and only protect the URL of those jobs that do not require years of experience. I probably do not need help writing scraps to get HTML bodies of relevant job positions. This problem is precisely identifying the level of experience required for the job. This should not be very difficult because the job post is usually very clear about this ("It should be experienced in 5 years ..."), but there may be some problems with a much simpler solution. In my case, I'm looking for entry level status. Often they are not called "entry-level", but the inclusion of words probably mea

c# - Dropdown with image and text together in Asp.net 3.5 and jquery -

I have been given a task to create a dynamic drop down that takes it from the table [image and value id] I am thinking that none of you has come into this scenario or if someone can help me in this, then I need help in concept and coding. I am definitely appreciated for any help that I see Here is an example link in Jackie: Something like that Data coming from the table. If you use plug-ins found in the link, what you want to do basically Dynamically create a dropdown based on table content. Without much information about how your desk is composed, I can not give you exact details, but something like that should stop you (I think there is already a drop-down element on the page that is called " Select ", and your table is called" table "with image in field 0, and text in field 1) Note: this has not actually been tested. var option = ""; $ ("# Table tr"). Each (function () {var imagePath = $ (this) .find ("td: eq (0) img"

plsql - Good way to deal with comma separated values in oracle -

I am passing values ​​separated by commas in the stored procedure in Oracle. I want to use these values ​​as a table so that I can use them in a question: choose from tabl_a where in column_b (& lt; csv in values ​​& gt; Passed) What is the best way to do this in 11g? Right now we are looping through one of them and putting them in a GTT which I think is incompetent. Any hint? This resolves the exact same problem < / Div>

api - Creating a jQuery Plugin, How do I do Custom Scopes? -

मैं एक एपीआई के साथ एक jQuery प्लगइन बनाना चाहूंगा: $ ( "#chart") pluginName () attr ( "my_attr")।। इनके बजाय: $ ("# चार्ट")। प्लगइननाम_एटीआर ("my_attr"); $ .pluginName.attr ("# चार्ट", "my_attr"); मूल रूप से, jQuery के उन लोगों के समान काम करने वाली प्रत्येक विधि का नेमस्पेस करने के बजाय, मैं कस्टम एपीआई के तरीकों को "गुंजाइश" करना चाहता हूं, जहां पर $ (" #chart) .pluginName () एक ऑब्जेक्ट वापस करेगा जैसे कि get , attr , ढूंढें , और कुछ अन्य होंगे पूरी तरह से पुनः लिखा। मुझे यकीन है कि यह एक अच्छा विचार नहीं है क्योंकि यह सम्मेलन को तोड़ता है (क्या है?), लेकिन इसके बाद के दो विकल्पों की तुलना में, यह आसान और अधिक पठनीय और शायद अधिक अनुकूलित है। आपका विचार क्या हैं? मैं इस विचार के साथ प्रयोग कर रहा हूं। लगता है जैसे कि आप बस jQuery ऑब्जेक्ट के लिए कार्य को संशोधित कर सकते हैं जो प्लगइन प्राप्त करता है, और उस पर वापस लौटता है। ऐसा कुछ: $ .fn.tester = function () {// प्लगइन this.cs

C++ operator ',' -

संभव डुप्लिकेट: ऑपरेटर का क्या परिणाम है, 'मानक से? अंतिम तर्क? इस तरह के कोड में, उदाहरण के लिए: int a = 0; Int b = 1; जबकि (ए, बी); या इसे इस तरह प्रयोग करने की अनुमति नहीं है? दोहराव के लिए खेद है, पता नहीं कैसे इस ऑपरेटर को अंग्रेजी में कहा जाता है) बयानों का क्रम निष्पादित होता है और रिटर्न मान अंतिम बयान का मूल्यांकन होता है।

simple javascript regex question -

How do I match the following method? "Anything 123.anythingelse" Any letter of length, with exactly 1 "." In the middle, and then any length of alphanum? Thank you. That would be / [a-z0- 9] + \. [A-z0- 9] + / i . The / i case is the insensitive modifier. var match = /[a-z0-9]+\.[a-z0-9]+/i .test (string); Warning (match); // right or wrong. If you can allow underscores, it can be reduced: / \ w + \. W + / . \ w is the same as [a-zA-Z0-9_] . See also :

Whats the best way to backup a MySQL table without file privileges and command line access? -

Im not on a great shared hosting plan I can not get file privileges for mysql, so I do not select it in outfile And I do not have command line access, so I can not use mysqldump, what can I do to get a decent table backup? You say that you can not reach the command line, I think that means you mean "server But what about the customer? With the client, you can still call mysqldump to dump your server locally with the '-H' switch, can not you? mysqldump -ufoo-pbar -hourserver Schema table This should work if your server is not limited to the local host and you have the right account Is defined.

linux - Address of instruction causing SIGSEGV in external program -

I want to get the address of the instruction that causes the program of external program of SIGEESGV. I tried to use ptrace for this, but I'm getting EIT (maybe the default signal handler?) From kernel space, how can GDB get the correct EIP? Is there any way to provide GDB with this information using some APIs? Edit: I do not have the source of the program, only the binary executable I need automation, so I can not just use "run", "information register" in GDB, I want to apply "registrar information" in the debugger :) You found the process using Ptrace . It seems that you want PTRACE_GETREGS to register. You want to see some example code like strasse, such as handling this signal handling and by reading this document, I think that the detected child will stop at every signal and tracing the parent to the child for signal Wait

ms access - Inserting new argument to table through search form of another table -

In my database I have a form for search products (fields: ID, name, manufacturer_id [to display the manufacturer's name Set], category_id, price). I would like to get the ability to add manufacturers through this form, so I have created a VBA script but it does not work. However when I enter a new name it will give me the "Select element from the list" signal. What I'm doing wrong private sub-manufacturer_id_NotInTheList (NewData string, as the response integer) as strings strSQL string, as strInfo string strInfo = "creator" Amp; NewDATA & amp; "Not in the list." & Amp; VbCrLf & amp; "Add?" MsgBox (strInfo, vbYesNo + vbQuestion, "Element not on list") vbYes then strSQL == "Producer (name, country, id_distributor) values ​​(included in" & "NewData & amp;" ',' undefined ' '0'); "DoCmd.SetWarnings (false) DoCmd.RunSQL strSQL Response = acDataErrAdded or Respon

mysqldump - Merging tables in MySQL - sum up columns -

I have an interesting problem, I'm sure it's a simple answer, but I do not think docs do. I have different database tables on different servers that have the same table schema with the same primary key. I want to merge tables together on one server. However, if the line on Server1.Table1 is present in Server2.Table2, then I sum the total amount in the specified column. Table1 {column_pk, counter}; "Test 1", 3 "Test 2", 4 Table 2 {column_pk, counter}; "Test1", 5 "test2", 6 So after my merger I want to: "test1", 8 "test2", 10 Actually I What are my options? appreciate someone I input, thank you Tebl_inu ( Column_pk, counter) VALUES ('test', 4) Duplicate key update c = C + 4; Where 4 and test are replaced with your actual data. How do you get the export file containing those questions, I suggest you use regular expressions to modify a standard export. Or both of them in the sam

ruby on rails - session[:key] = value doesn't work -

I am trying to use session data in my application and for some reason I have some setup not correct. / P> code: session [: key] = some_value generates the following error: < An error occurred while evaluating the code> error. [] There is no problem with the session of other controllers, so I'm guessing that I miss some basic configuration things somewhere. Okay, I think I have come to know it now outside. My situation was a bit more complex which is my example. I actually had the following: session [: chat_history] [chat.from.id] || = [] So I had an error in the double array I added the following: session [: chat_history] || = [] The problem is the first time I did, I have it before a before_filter method apparently the session object is already zero before, at least the way I have my application setup So I took the initiator to such methods which actually use the session and life is better again.

simple jquery image change onclick failing -

I have a simple jQuery image switch that is failing. $ ('Heart_img' (type heart == 'picture / uncheck.') (// warning ('oh'); $ (this) .attr (' Src ',' images / heart.png ');} and if (type of heart ==' picture / heart '); {$ (this) .attr (' src ',' images / unheart.png '); }}; The signal starts to fire properly on the fire and the images are in the right place, so I'm not sure what the problem is. < else if (heart_type == 'image / div class = "post-text" itemprop = "text"> problem: heart.png '); should be else if Even better other / Html>

Date and Time Conversion in Ruby -

I am currently looking at the convert from June 10 16:17:55 +0530 2010 15/06/2010 or 15-06-2010 Use of Ruby I am getting dates from DB as shown below. @tickets = tickets.fund (print all) tickets tickets. Created iet and I look around for resources because I'm ROR / Ruby I saw and even PS: I have tried regularly with the use of expressions and how I can achieve this conversion in Ruby. But no fate Do this. @tickets = For tickets ticket tickets (all :) print tickets.

java - JSF 2.0 Problem (faces-config) -

We have faces-config.xml in JSF 1.0, where we talk about managed beans, dependencies Enter & amp; Navigation etc. I was developing a sample project that was using JSF 2.0. But, as I do not know the annotation, I must include the face-config.xml externally. Please provide a solution for this, as we do not have to include it in JSF 2.0 . What is the reason behind this? How do we set beans in the form of managed bean? What is annotation? How is this used? (...) In JSF 2.0 we do not need it to include it What is the reason behind this? In three words: There is just a few codes to write the ease of development - the boilerplate code is removed, whenever possible the default is used, and the use of annotations is the deployment descriptor Is used to reduce the need. How do we set up managed bean as Bean? What is annotation? How is this used? Managed beans are identified using the @ ManagedBean annotation. Bean's scope is also specified by the annotation (