Posts

scripting - shell script to traverse files recursively -

Help me to create a shell script to run a special command (any) on each file in a folder It is necessary to dive continuously in sub-directories such as I'm not sure how to get started. One point will be enough in the right direction. Thank you. present to apply a command (e.g., echo ) Use files , at the bottom of the path find-type f -exec echo "{}" \; For directories, use -type d

asp.net - MVC2 and Session Start Event -

सेटअप: खाता नियंत्रक ठेठ लॉगऑन / लॉगऑफ सामान के साथ कि टेम्पलेट से पकाया आता है लॉगऑन पृष्ठ पर यहां बहुत अधिक संशोधन नहीं किया गया है। कस्टम सदस्यता प्रदाता (एसक्यूएल) का उपयोग करना, लेकिन मैं नहीं सोचता कि इससे क्या करने की कोशिश कर रहा हूं। आवश्यकताएं: ग्राहक समवर्ती उपयोगकर्ताओं को सीमित करके लाइसेंस संभाल करना चाहता है, न कि कुल उपयोगकर्ताओं द्वारा। इसलिए, इसे संदर्भित करने के बाद, मुझे यह काम करने के लिए तैयार किया गया था कि मुझे क्या करना चाहिए। और वह प्रत्येक संगठन के लिए अधिकतम और वर्तमान उपयोगकर्ताओं को ट्रैक करना है जो हमारे आवेदन के लिए साइन अप कर चुके हैं। कोई समस्या नहीं है, बस एक आवेदन ("अधिकतम") और अनुप्रयोग ("वर्तमान") है जो कि संगठन आईडी के लिए कुंजी के साथ हैशटबल दोनों हैं और संगठन के लिए वर्तमान या अधिकतम उपयोगकर्ता मान सत्र_स्टार्ट पर, मैं वर्तमान उपयोगकर्ताओं को बढ़ाना चाहूंगा, यह जांचें कि क्या यह अधिकतम से अधिक है और या तो ए) किसी त्रुटि पेज पर रीडायरेक्ट करें या ख) उन्हें उनको क्या करना है, इसके साथ चलें। सत्र की समाप्ति पर, मैं...

memory - What is the right way to free a std::vector of pointers in C++? -

I searched the stack overflow but could not find the answer to this question. Suppose I have study :: vector & lt; Day * & gt; Vector_de - that is - the vector of pointers for the day object I now push_back to vector_day many elements: vector_day.push_back (new day (12)); Vector_day. Push_back (new day (99)); Vector_day.push_back (new day (71)); ... Now I do not need anymore vector_day at some point. What is the right way to free the memory? This is the correct way: for (std :: vector & gt; :: iterator i = vector_day .begin (); i! = Vector_day.end (); ++ i) {Delete * i; } Does not this invalid the vector on each extinction? I am very confused. The best way is not to put the indicator in the first place in the vector if you want to do it completely is not needed. But if you really need a vector of the indicator, then the way you are doing it is fine (but .clean) after the vector, if It will not be destroyed immediately, then it is not ...

.net - XSL Transformation through code does not result in the same output as XSL transformation done through a tool -

I am I turned to the other XML files using Aksmelaksmeted Transform classes for your XML file. NET Framework 3.5 This is my code. private static void change (string sXmlPath, string sXslPath, string Autputfailnam) {{XPathDocument myXPathDoc = new XPathDocument (sXmlPath)} XslCompiledTransform myXslTrans = new XslCompiledTransform (); // Load myXslTrans.Load xls (sXslPath); // Create output stream XmlTextWriter myWriter = new XmlTextWriter (outputFileName, null); // Xml myXslTrans.Transform (myXPathDoc, blank, myWriter); MyWriter.Close (); } Hold (exception e) {EventLogger eventLog; EventLog = New Event Logger ("Transform Ulyet", E. Toaster ()); }}} The code works, but the output file does not have XML declaration in header. ** I am hurt to understand this. When I change the XML using the same XSL file, Notepad ++ or the XML declaration header changes when you use Visual Studio's tools. So what XslCompiledTransform is responsible for reducing this announc...

WPF: looking for list of each control's states and brushes -

Is there a list of all the normal states for each control? Basically like a list: button: disable, hover, pressed, selected, focus, etc. Listbox: Disabled, hover, focus, etc. I'm looking at Blend and MSDN but I'm not looking for anything. Why i asked You can use Blend or MSDN documents. Or, if you feel that this is inclined like this, then you can write a script to reflect the controls and prepare a report. EDIT: Annoyingly, MSDN Docs TemplateVisualStateAttribute for WPF control as they do for Silverlight, so this is not an option in WPF.

.net mvc & ajax forms - how to handle session expired -

To check the expired session in my Net Networks application, I have a client filter attribute on the standard HTML form works fine. However, when I am called by an AJAX form and enforces an expiry end of the session, then it reloads the login page (where the filter attribute redirects the reference) in the Ajax update container. Does anyone know how to redirect the whole page to the login page if the session has expired, when the AJAX call is done or does anyone know how to handle this situation a little more beautifully? . Thanks in advance Public category SessionExpiredFilterAttribute: ActionFilterAttribute {Public override zero OnActionExecuting (ActionExecutingContext filterContext) {HttpContext ctx = HttpContext.Current; // if checked (ctx.Session! = Null) {session is supported / checks, then a new session ID was generated (ctx.Session.IsNewSession) {// If it says that it is There is a new session, but if an existing cookie is present, then it should be // string session ha...

c# - How to fetch entries starting with the given string from a SQL Server database? -

I have a large number of words used in a tag system, I need the code for an autocomplete box But I am not sure how to bring entries that match the database to the most efficient way. I have a command of choice, but it seems I am more than a similar order. I get only words which I look like the word. My plan is to read every line, and then use the string of C #. Wires () and string. () Is fit, but I think with a large database, it may be disabled to read every line and then filter them. Is there a way to read only those lines that start with SQL Server or have a string in it? When using such as , you provide a% symbol as a wildcard. If you want strings that start with Hello, you will use 'Hello%', if you wanted a string with Hello in anywhere in the string, you would use it as '% Hello%' For efficiency, like optimal you should look at full text search.