Posts

Showing posts from July, 2012

word wrap - vim command to restructure/force text to 80 columns -

I know that automatically set textwidth (such as) What I see is similar to some = (indent line command), but to wrap 80 In the case of usage sometimes you edit the text with text width and after wrapping in lines or wrapping / removing the text wrapped in a bad way. Ideally, this command will completely reconstruct the selected lines and cut the long lines while adding the little ones. An example: Long line is long! After running the command (assuming the rap as 13 columns): The long line is long! Less If this is not true with the vim command, maybe there is a command line program that does it that I can pipe the input? After searching, I found in this context that there are a few other options: For Set textwidth 80, the file can be started with the beginning ( Ctrl - Home or gg ), And type gqg . gqg formats the file starting with the current state and by the end of the file. It will automatically be included in consecutive lines when possible.

html - Formatting Button Position with Form_For -

I am using form_ to create an input form that has 1 input field and 1 button. I want the submit button to be next to the input field instead of below. The relevant code is: . Input {range: 1px solid # 666666; Width: 400px; Height: 22px; Font-size: 16px;} & lt; TD width = "900" height = "50" aligned = "left" valg = "medium" & gt; & Lt;% form_for @contact,: url = & gt; {: Action = & gt; "Create"} ,: html = & gt; {: Class = & gt; "Input"}. F | & Gt%; & Lt;% = f.text_field: email,: size = & gt; 74% & gt; & Lt;% = image_submit_tag '2009-12-06 - Landing 1' gf '% & gt; & Lt;% end% & gt; & Lt; / TD & gt; Try using display: Inline;

Using Visual Studio for open source projects (projects management & legal issues) -

I'm working on a small open source project for Windows. I have created a new project using the Visual Studio wizard and now I want to develop it with friends by using the reversal of which project to help my friends download the current project revision and open it in Visual Studio Add configuration files? List of universities where I read a member of the Microsoft Academy Alliance project, which enables students to download legal copies of many Microsoft products. Can I develop this copy to open source projects and publish the code created in the Internet? for 1; I exclude * .user and * .suo files because they are user-specific, and Bin / OBJ folders because they are creating Output ; .cs, .csproj, .resx, etc. For 2,: You use the software for instructional use, research and / or design, and non-business purposes, including classroom work, testing, or personal projects. Development and testing of projects for You can not use MSDNAA software for any profitable

connect java application to mysql server in netbeans 6.8 -

I'm starting in Java as well as Netbeen. Please enter the complete procedure that I can connect to mysql to my Java application Download "mysql-connector-java-5.1.13-bin.jar" from the link There is a sample Java code to connect to a monthly database and retrieve data from the table. The code below is the database name "databasename" and the name of the table is "YouTubeTable" In the library of your Netbeen project "mysql-connector-java- Do not forget to add 5.1.13-bin.jar ". import java.sql .Connection; Import java.sql.DriverManager; Import java.sql.ResultSet; Import java.sql.Statement; Public square nuclass {public static zero main (string [] args) {connection conn = null; String url = "jdbc: mysql: //127.0.0.1: 3306 /"; String dbName = "databaseName"; Description stmt = null; Result result = null; String driver = "com.mysql.jdbc.Driver"; String databaseUsername = "root"; // databas

regex - Java - Regular expression question -

I am new to regular expressions Actually I can say " / * "I want to use regex to search for something surrounded by. And " * / " and replace it with "". An example where a simple regular expression fails: Body {font-family: "/ * this is not a comment * /"; } But if you do not care about these matters, you can go with it: str.replaceAll ("/ \\ * . *? \\ * / "," "); This match starts with / * and then looks for the next * / , between the middle Some characters as possible ( . *? *? /?>)

Mapping One-to-One subclass in Fluent NHibernate -

मेरे पास निम्न डेटाबेस संरचना है: इवेंट तालिका आईडी - गिड (पीके) नाम - NVarChar विवरण - NVarChar SpecialEvent तालिका आईडी - गाइड (पीके) प्रारंभ - तिथि समय < Br> समाप्ति दिनांक - दिनांक समय मेरे पास एक इवेंट इवेंट क्लास और एक स्पेशलाइवेंट वर्ग है जो इसे से प्राप्त करता है आखिरकार मेरे पास एक आवर्ती एवेन्ट वर्ग होगा जो इवेंट क्लास से भी वारिस होगा। यदि संभव हो, तो आईडी के साथ मैप किए गए एक-से-एक रिश्ते को बनाए रखने के दौरान मैं विशेष ईवेंट वर्ग को मैप करना चाहता हूं। क्या कोई मुझे सही दिशा में बता सकता है? धन्यवाद! मैंने अपनी समस्या का पता लगाया। यहां मेरा कोड है: सार्वजनिक सार वर्ग इवेंट: इकाई {सुरक्षित ईवेंट () {} सार्वजनिक इवेंट (स्ट्रिंग का नाम, डेटटाइम स्टार्टडेट) {this.Name = name; यह। StartDate = startDate; } सार्वजनिक वर्चुअल स्ट्रिंग Name {get; निजी सेट; } सार्वजनिक वर्चुअल स्ट्रिंग विवरण {get; सेट; } सार्वजनिक वर्चुअल दिनांकटाइम स्टार्टडेट {प्राप्त; संरक्षित सेट; } सार्वजनिक आभासी दिनांक समय? समाप्ति तिथि {प्राप्त; सेट; }} सार्वजनिक वर्ग के विशे

c# - Conditional Styling In Silverlight? -

I'm fine with standard control style in Silverlight, while I recently used more dynamic methods to display data Has started to do. Items Control is a collection of links I'm working with again. The problem I have is that each link is colorally colored, one red, one blue, one green, etc. Is there a way to style these items without sacrificing the dynamics of controlling an item with a data template? I did this on a property of visual model through a simple converter, for example You had a boolean property that you wanted to control the style you could. / P> public class BoolToStyleConverter: IValueConverter {public style TrueStyle {get; Set; } Public style FalseStyle {get; Set; } #region IValueConverter Member Convert Public Commands (type object type, type targetType, object parameter, System.Globalization.CultureInfo culture) {return ((bool value))? TrueStyle: FalseStyle; } Public Object Convertback (type object type, type target type, object parameter, system

asp.net - "Rebind" or page_load a usercontrol on a page when a property of the usercontrol is changed in the parent page -

I have a usercontrol ... and I want to set it from the original page of a property and at the same time. Usorrons "Reload" to be updated so that it can be updated. Formally user control was picking a query string parameter and setting itself with the query string parameter. Now I want to set it from the parent page .. < P> Thanks for any suggestions open!

Why is Ruby on Rails lacking on documentation? -

It was so difficult to configure PHP Debugger that I could not imagine myself using Rail Documentation through blogging. The problem seems easy to solve: Write the document, why did not anyone do it? I am thinking that if you have no way of knowing this, then you have to ask those who know it, who can know it and why? The so-called "lack of documentation" remains in the viewer's eye, I have not seen the problem Most of the time you can get what you need at api.rubyonrails.org, or if you are looking more friendly about the guide. Rubyonrails.org. The blog can provide some additional insight on some of the features, but Rail is the rdoc king.

java - Not sure how to get an object to display after loading from ObjectInputStream() -

सार्वजनिक शून्य लोड () {अंतिम JFileChooser fc = new JFileChooser (); Int returnVal = fc.showOpenDialog (यह); अगर (returnVal == JFileChooser.APPROVE_OPTION) {try {fileInputStream f_in = नई फ़ाइल इनपुटस्ट्रीम (fc.getSelectedFile ()); ObjectInputStream obj_in = नया ऑब्जेक्ट इनटस्टस्ट्रीम (f_in); फ़्रेम F2 = (फ़्रेम) obj_in.readObject (); obj_in.close (); f2.setVisible (सही); } पकड़ (अपवाद पूर्व) {}}} मैं एक कॉल जोड़ने की कोशिश करूँगा सेट विजिबल कॉल से पहले फ्रेम पर पैक विधि के लिए यह चाहिए इसे डिस्प्लेबल और ठीक से आकार में होना चाहिए। FileInputStream f_in = नया FileInputStream (fc.getSelectedFile ()); ObjectInputStream obj_in = नया ऑब्जेक्ट इनटस्टस्ट्रीम (f_in); फ़्रेम F2 = (फ़्रेम) obj_in.readObject (); obj_in.close (); F2.pack () f2.setVisible (सच); यदि यह काम नहीं करता है, तो f2.isDisplayable () के पैक को कॉल करने के बदले मूल्य की जांच करें। यदि यह गलत है, तो इसका मतलब है कि फ़्रेम किसी मूल स्क्रीन संसाधन से जुड़ा नहीं है (जो मुझे विश्वास है कि पैक को ध्यान

java - Why isn't componentHidden called for my JPopupMenu? -

Text after " I want to send notifications when my JPopupMenu is hidden - regardless of the selection of an item The menu was dismissed, or the setvibal (false) was called upon to it. Here is my test code: import javax.swing *; Import java.awt. *; Import java.awt.event. *; Public Class A extended Kmponentadaptr Rnnbl, Akshnlistr (private Jebtn B; public static void main (String [] Arges) {EventQueue.invokeLater (new A ());} public void run () {JFrame f = new JFrame ( "test" ); b = new Jebtn ( "Click me"); b.addActionListener (this); f.add (b); Fkpack (); FksetVisible (right);} public void Kriyaprwartit (Akshnavent e) { JPopupMenu pm = new JPopupMenu (); pm.addComponentListener (this); pm.add ( "pop ..."); pm.add ( "... the menu!"); Pm.show (B, 10, 10) ;} Visible public null component IES (Component Avant e) {System.out.println ( "component shows");} public void Gtkhinder (component Avant e) {System.out.println ( "Gtk

database - storing original password text -

My web application stores external website login / password to interact with them. To interact with these websites, I need to use the original password text, so collecting my hashes in my database is not working. How should I store these passwords? EDIT: I am worried that if someone accesses my server, if I use any kind of 2-way encryption and they have access to the server they can check it That how passwords are decrypted in my backend code. Looks like you do not want to store passwords in the same password as Firefox and Chrome How do they do this? How does it do Chrome:

Twitter and Facebook on iPhone - save sessions across app launches? -

I am using OAuth for Twitter and FB-Connect for Facebook authentication in my iPhone app. Is it possible to save user session in app launch? i.e. If the user enters at once, the next time they launch the app, we launch them automatically from some state, the last time the app was closed? Will this work for Twitter if I save auth_token and want to use Twitter from my app every time I use it? Or do I need to do something else? Thank you. For Twitter you will need to save access_token This is unique to the user / application and if saved, will allow you to act as users for future requests. It will contain two strings, one of which will start with the user's ID.

iphone - how can i replace json string? -

मैं विशेष डेटा को जेसन स्ट्रिंग में बदलना चाहता हूं इसे पार्स करें, आपको आवश्यक परिवर्तन करें, फिर इसे वापस क्रमबद्ध करें आपने यह नहीं कहा कि आप जो JSON लाइब्रेरी का उपयोग कर रहे हैं, लेकिन यह काफी आसान होना चाहिए।

Rails Nested Attributes, Relationship for Shared or Common Object -

This should be a common problem, so I'm surprised Google has not left any more responses. I am having a lot of different types of institutions, those institutions need the relationship of a separate entity. For example: Address : A model that stores the street address details (this is my shared entity) PersonContact : A model that includes things like home phone, cell phone and email address DogContact : Obviously, if you want to contact a dog , Then you will have to go to the place where it lives. Therefore, PersonContact and DogContact must have the foreign key address . Even though they are actually "master" object of address , it will be fine, except that accepts __nested_attributes_for foreign key to Calculating to work correctly in the address . The key to keeping foreigners is key in address , but do you own the PersonContact and DogContact ? I believe you should use it. You should see a addressable_id and a addressable_typ

css selectors - jQuery Select All Elements That Have a Title -

I have to implement Tooltip plugin in a group of different elements of my page. The only common asset to work with the jQuery selector is that they have a title property set. I tried $ ('[title = *]') as a selector, but it did not work. bus: $ ('[title]') < / Code> Also see -: Select elements with the specified attribute with any value.

iphone - What happens if a user jumps over 10 versions before updating, and every version had a new data model? -

Example: The user installs the app v.1.0, adds data, then God submits 10 updates in 10 updates. After 11 weeks, the user wants v.11.0 and takes a copy from the app store. assuming that 11 inside the app XCDTodel version, where *** 11.xcdatamodel is current, now what happens after the user is continually stored? Will the migration be 10 times, every migration will be step-by-step through the intersection? Or is the actual migration of data (to assume gigabyte of data) once actually, after core data (or constant store coordinator) v.1.0 to v. 11.0? As I answered in my second question on this subject, there would be only one stay in the core data volumes. The concept of do not understand. The model has no timeline; It will only work with a source and destination. In your example, the source will be v1.0 and the destination will be v11.0. A migration

pdf - Altering an embedded TrueType font so it will be usable by Windows GDI -

I am trying to present PDF content in the GDI device reference (to be a 24 bit bitmap exact). Parsing PDF streams in PDF Objects and fixing PDF commanding content from content dictionary, including font rendering. Embedded fonts are uncompressed with their FontFile streams and have been "loaded" using AddFontMemResourceEx . Now some embedded fonts remove some TrueType tables that are required by GDI just like the 'name' table, due to which I tried to modify the font by parse TrueType subset fonts in the table and try to modify those tables The data missing / missing tables are reproduced with the correct information as likely as possible. I use the tool to see how "true" is the generated font I still get some errors, such that the maximum values ​​for the maximum table are usually very large (this is a subset ) Or the xAvgCharWidth field is not equal to the calculation value of the 'OS / 2' table, but it does not stop to use other embedded

MySQL Master/Slave with Castle Activerecord -

I have an existing web application using Castle Accordord to interact with a single MySQL database. Recently the database has been reconfigured to copy many slaves. Do you write Castle EverCardord directly to MySQL Master and read MySQL slaves or other ways to get master / slave? Transparent operation in this setup? I have never done that, but I think that this kind of things should be db-driver level . Actually, for this purpose there is no ambiguous reference to its replication: host, server, data source, datosrass, address, addresser, network address: example The name or network address of multiple hosts to connect MySQL & amp; Can be specified separately from. This can be useful where multiple MySQL servers are configured for replication and you are not concerned about the exact server you are connecting to. No one is attempting to synchronize the database by the provider to write, so the care should be taken while using this option. In Unix environment with Mo

Extending Jekyll and Liquid to parse post's content -

मेरा ब्लॉग, द्वारा समर्थित, फ़ीड प्रदान करता है। --- लेआउट: नील रूटिरी: http://stefan.artspace44.com --- & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "यूटीएफ -8"? & Gt; & Lt; फ़ीड xmlns = "http://www.w3.org/2005/Atom" & gt; ... {% post.posts%} में पोस्ट करने के लिए & lt; प्रविष्टि & gt; & Lt; शीर्षक & gt; {{post.title}} & lt; / शीर्षक & gt; & Lt; link href = "{{page.rooturi}} {{post.url}}" / & gt; & Lt; updated & gt; {{post.date | Date_to_xmlschema}} & lt; / अपडेट किया गया & gt; & Lt; id & gt; {{page.rooturi}} {{post.id}} & lt; / id & gt; & Lt; सामग्री प्रकार = "html" & gt; {{post.content | | Xml_escape}} & lt; / content & gt; & Lt; / प्रविष्टि & gt; {% Endfor%} & lt; / feed & gt; मुझे प्रत्येक पोस्ट के सामग्री को बदलने की आवश्यकता है, ताकि हो जाता है: & lt; img href = "http://stefan.artspace44.com/im

asp.net - Find an asp:Button in VB.NET -

I am trying to codify a code in VB for my website, but VB can not find a button. Is there a way to find the code? I know where it is. Loginview> Login> Login Template How do I get VB.NET to point to that location? Since the button is in a template, you will need to use the FindControl method. For example, if you have such a markup: & lt; Asp: LoginView id = "loginview1" runat = "server" & gt; & Lt; LoggedInTemplate & gt; & Lt; Asp: button id = "btn1" runat = "server" /> & Lt; / LoggedInTemplate & gt; & Lt; / ASP: LoginView & gt; Then, in your code-back, you have to specify it like this: button btn = loginview1.FindControl ("btn1") button in the form of; If (BTN! = Null), do whatever you want here

How do you get asp.net anonymous authentication token for profile support? -

Then I have an asp.net web application (web site is not) that I support profiles for anonymous users I am trying to do I have a form and I want anonymous users to enter their name and email only once, and that information will be automatically accessible to them for the next load. My web I have an anonymous ID setup in the config: & lt; Anonymous identification enabled = "correct" cookieless = "autodetect" /> I have my profile section setup like this: & lt; Profile default provider = "SqlProvider" enabled = "true" inherits = "QA_Web_Tools.UserProfile" & gt; & Lt; Providers & gt; & Lt; Clear /> & Lt; Add connection StringName = "QatoolsConnectionString" name = "SqlProvider" type = "System.Web.Profile.SqlProfileProvider" /> & Lt; / Providers & gt; & Lt; / Profile & gt; Finally, because of my app, there is a web app and no web site, I am using

reflection - C# Type comparison -

यह मुझे pooped है, कोई कारण निम्न है: सार्वजनिक सार वर्ग anExtension {सार्वजनिक सार बॉल्ड लोड एक्स्टेंशन (स्थिर सी); // विधि की आवश्यकता होती है जनसाधारण स्ट्रेटेस को प्राप्त करें AppliesToModule // गुणधर्म के लिए वारिस में प्राप्त करें {get; } सार्वजनिक सार स्ट्रिंग ExtensionName // संपत्ति के वारिस में प्राप्त {get; } सार्वजनिक सार स्ट्रिंग ExtensionDescription // विरासत में आवश्यक संपत्ति {get; }} सार्वजनिक वर्ग यूके: एक एक्स्टेंशन {सार्वजनिक ओवरराइड बूल लोड एक्स्टेंशन (स्थिर सी) {वापसी सत्य; } सार्वजनिक ओवरराइड स्ट्रिंग AppliesToModule {वापस {वापसी} "स्ट्रिंग"; }} सार्वजनिक ओवरराइड स्ट्रिंग ExtensionName {get {return "string"; }} सार्वजनिक ओवरराइड स्ट्रिंग एक्सटेंशनडिस्क्रिप्शन {वापसी {"वापसी" स्ट्रिंग}; }}} निम्नलिखित अभिव्यक्तियों के लिए झूठी वापसी होगी: bool a = t.IsAssignableFrom (aExtension)); Bool बी = टी। बैसेटाइप। आईएसएएसएसग्नेबलफॉम (एएक्स्टेंशन)); Bool c = typeof (एक एक्स्टेंशन) .IsAssignableFrom (टी); बूल डी = टाइपफ (एएक्स्ट

dialog - Detailed android activity lifecycle (onAttachedToWindow()) -

I am interested in the Android Activity Life Cycle and I have widely available basic (more widely available onCreate-> onStart -> onResume). My need comes from feeling that onCreate (start of new activity from onAttachedToWindow () ( Theme.Dialog styling). I'm surprised that this on-attached towando () fits into the entire Android activity life cycle official API referee details "When Window is Connected to Window Manager When Called" Does not help much My guess is why it feels more sensitive than the top of my head: I think if If you start activity B from the activity A's (crant), then activity A activity starts b, which can take one or the other (the app to feel less responsiveness), where you attribute Activity A to Attachmenttowondo () Begin activity b, a starts and b Is brought to the fore, so users do not sit for each other with a blank screen or pre-A activity.

Linux / C++: Get Internet IP Address (not local computer's IP) -

How do I get an Internet IP address from the program? 1) If the computer is connected directly to the Internet using a USB modem. 2) If the computer is connected to the Internet through another computer or modem / router. Do I have a way of doing both? The PS actually gives the Internet IP, but how can I use it in my program? You can write socket code to send an HTTP request for that link You can use the system under Unix / Linux / Signin ("wget"); Then open the file "n09230945.asp" and read its contents. Here is an example of how to request to use sockets (I aim to modify online examples for this specific purpose). Note: This is an example and an actual implementation will have to handle better errors: #include

vb.net - Prevent painting of .NET form while form is loading? -

Am I complicating it when all view updates Is there a way to turn off the NET form? When my program first loads, for example, I set the tab control on the tab that was open the last time the user can see the switching tab in the program. I have seen SuspendLayout and ResumeLayout, but either I do not understand what they are doing, or I am not using them properly, because they do not think of any effect Someone told me that there was a way to stop Paint incidents in VB6. Is it still present in .NET? "post-text" itemprop = "text"> For the main window, the easiest thing to do is to create a hidden window, do all your stuff, and then show the window. In this way you will have a full redraw, and parts of the layout were once displayed.

c# - Access to an inner type -

A colleague of mine posted a question on an internal forum that I was thinking about via C # This is possible from. Basically, he has got the interface: Public Interface IPO Finder & lt; T & gt; {T GetT (); } Is it possible to use a thing that implements an interface as another normal type of type parameter and has access to Type T without re-specifying it? For example: public squares foo & lt; P & gt; Where P: The IPOounder & lt; T & gt; {P.P. T GetInnerT () {Return p. GETT (); }} It does not compile, because type is not defined TYPE and therefore can not be used as the parameter of IProvider . Is anything like that possible? Just curious! No, it will need to be Foo to be in general both p and T: public class Foo < P, T & gt; Where P: The IPOounder & lt; T & gt; Otherwise no T for IProvider & lt; T & gt; Obligations to be aware of - The fact is that this is part of the announcement IProvider & lt; T

iphone - Updating parent table after child update in uinvaigationcontroller -

तो आपके पास यूआईएवीएजिएन्ट्रॉलर है, जिसमें एक सेल वाला सेल होता है --- ------------ | पॉल & gt; | --------------- और आप उस पर क्लिक करते हैं और एक स्क्रीन प्राप्त करते हैं जिसमें पाठ फ़ील्ड है जो आप दर्ज करते हैं --------------- | नाम: पॉल | --------------- | आयु: 23 | --------------- | बाल: भूरा | --------------- | आदि | --------------- --------------- | सहेजें बटन | --------------- जब आप स्टीव को नाम बदलते हैं, और सहेजें बटन दबाएं (जो दृश्य चबूतरे), कैसे मिलता है प्रारंभिक तालिका अद्यतन करने के लिए? मैं NSUserdefaults का उपयोग कर से बचाने और लोड करने के लिए उपयोग कर रहा हूँ। जब मैं प्रारंभिक दृश्य पर पॉप करता हूं, तो नाम बदल नहीं होता है ... हालांकि, अगर मैं ऐप को फिर से शुरू कर देता हूं, तो यह वहां है। एप चल रहा है, तो पहले तालिका को अपडेट करने के लिए कैसे काम नहीं कर सकता। आप प्रतिनिधि प्रतिनिधि को लागू कर सकते हैं या एक NSNotification भेज सकते हैं। इसके लिए मुझे लगता है कि कोड की मात्रा उसी के बारे में है, लेकिन चूंकि यह एक दृश्य है, नियंत्रक एक दूसरे के

NSIS - put EXE version into name of installer -

एक नाम वैरिएबल है जिसे आप स्क्रिप्ट में परिभाषित करते हैं: नाम "MyApp" < / Code> यह इंस्टॉलर के नाम को परिभाषित करता है, जो विंडो शीर्षक, आदि के रूप में प्रदर्शित होता है। क्या मेरे मुख्य EXE और इसे नाम के साथ जोड़ दें ताकि मेरा इंस्टॉलर नाम स्वतः "MyApp V2.2.0.0" हो या जो भी हो?

sql - How to write a query get all infomation from one table to another one -

I am creating an Access database that can fetch data from an external source and puts it in a table The data is linked to the source. As we all know that you do not have permission to redefine the linked table. What do I have to do, to get that data from that link and to create another table that I have an extra new field You need to read on appends queries: In other SQL systems, this is something" INSERT INTO "or" INTO INTO "

java - unit testing with junit4 -

मैं जूनिट 4 में एक परीक्षण सूट कैसे बनाऊँ ?? यहां एक उदाहरण दिया गया है: @RunWith (Suite.class) @ सूट। ऊट क्लासेस ({TestClass1.class, TestClass2.class, }) सार्वजनिक श्रेणी DummyTestSuite {}

jquery - Can I get operating system's measurement system (metric or US) in javascript -

Is there a way of measurement system to use JavaScript / Java? I need to display some distance and speed values ​​on the page, but it seems that there is no such a function call, I can get this information. No, you can not do it straight away. You can try this, though: Try to get localization information from http headers or pages (Lang attribute etc). Then you can try to do something and see who you came with.

c# - How do I convert byte to string? -

Is changing a byte (e.g. - number - 65 ) To do this, text hex Representation? By default, I want to convert the bytes to the array (I am harassing the resources) their code-representations such as BYTE data [] = { 0x00, 0x0A, 0x00, 0x01, ...} I have given it the byte - & gt; "0x0A" string In C ++, StringStream , and ssprintf Some compilers can have a IOAA method that will convert an integer into the representation of its text. These are portable functions You can also add an integer of '0' to get a text digit similar to 'A' and 'A'.

browser - static images aren't caching with php-generated page -

Our website was just changed to be generated by mod_rewrite and php scripts. All picture formats follow: & lt; Img src = "/ images / header.png" /> ; I should avoid caching completely because the PHP parser needs to dynamically handle every page on each request; However, the download overhead of large images is cumbersome on each page load. I will ideally provide the header for "cache-control: no-cache, sure-modify" and "expiry: some_date_in_the_past", to force PHP script to be re-verified. Why is not the browser caching static images in all pages with consistent href values? You can tell in your .htacess file that which file extensions you have fixed some headers For content you want to apply, you can provide header and dynamic content that ends in the future, you can write cache-not the modal cache has to be modified again. & lt; IfModule mod_deflate.c & gt; & Lt; File match ". (Js | css | html | php) $"

shell - Is there a Scala version of .irbrc or another way to define some default libraries for REPL use? -

I have written a small library, which uses implicits to add functionality, which only uses REPL in Scal Time is necessary. There is such a library of Ruby - for things like beautiful printing, firing the text editor (such as the interactive_editor mani who invites Vim from IRB - see), debuggers and like I'm trying to write the library, some methods Adds java.lang.Class and java.lang.reels to using the 'BrokerMy Library' uncompression conversion process to get you to know and get the documentation In the beginning, with Google, later possibly the Javadak / Scaloid viewer, and maybe the stack overflow API!). It's an itchy library: I spent so much time copying and pasting classmates in Google that I thought I could automate the process. This is a functionality that developers use to use only in REPL - they really should not add it to projects (partly because it can not be anything that their fellow developers want, But also because you are developing some exploratory

checkbox - Rails check box in form decides on create action in controller? -

I am trying to add a selected box based on my build that decides that an action moves from the controller If any new project is created then: def make @company = Company.find (params [: cz] [: company_id]) @cases = @ company.cases. Crete! (Param [: Case]) response_to do | Format | [Sample: send_to_freeagent]? @case.kreate_frigent_project (current_useur) #flash [: notice] = 'The case was created successfully.' Flash [: notice] = fading_flash_message ("The case was created successfully.", 5) format.html {redirect_to (@kase)} format.xml {render: xml = & gt; @case: Status = & gt; : Created: Location = & gt; @case} and end and I have in my form: What I would like to do, is that whether the selection box is checked that the project is sent to the freezer, if not, the case is made locally just as normal Sending FreeAgeent data If I use the code above, I get an exception caught error: by any means What am i doing I def c

Drupal User Permissions, Only Allow Specific Users to Edit Specific Pages -

I know that I can play a role to allow the user to edit only their own pages, Then the appropriate page is authored by the appropriate user but then I go to many users of per page problems. Is there any way that you can allow a user to edit some (maybe multiple) pages, while in case the accounting for overlap allows more than one user to edit the same page Might be possible? Thanks If you need a module that is accessible to a user Set permissions to specific content type nodes, then use them; If the content type is a book, then you can also try. Remember that setting up of different modules for access control should be avoided, because they struggle with the other. If you have patience, you can create your own custom module, and hook_ode_access_records () and hook_node_grints () suggested by Jeremy You can apply.

Vala for Android? -

Is it possible to write a wall application and run it on Android device? With the new Ndk, you can also write UI applications in C / C ++. As long as you have C ABI, you can call anything from Valla, provided you have it for it. The main obstacle is the lack of glib and gobject, but perhaps it can be compiled. Update: Bero Rosenkanger gave a good presentation on the Android Builder Summit which currently shows available.

Extended Events vs Triggers for Auditing SQL Server 2008 -

Any data I have to put in a log table to be copied or updated is to show it Who updated and when I was thinking about using triggers for this purpose. Due to the reason, only stored functionality is not required, but packages can also be done. Can I use extended events for that? You are much better

Where should I report mistakes in Android documentation? -

This is my first post - I love Android SDK (it was done for a week), but I notice In the official documentation, a small typo that needs correction. In the example source code, the source says "1 countdown timer " on line 1 when " CountDownTimer " (letter "D" capitalization Focus on) An easy fix for one with programming experience, but the code will not be compiled in writing, which may be confusing for anyone who uses this code for the first time. This is where the documentation bugs are presented, and if not, where should I go for deciding? There is a link to report errors in the Android documentation: < / P>

php - Determine if on product page programmatically in Magento -

I want to insert the tracking code on all pages of a Magento site, and if the page has to use a different syntax A CMS page, a category browsing page or product view page. I have a custom module that has been installed with a block that now puts a general tracking code on each page, from the inside of the block, I am using CMS pages, category pages And differences How do the product pages? I started: Dana :: app () - & gt; GetRequest (); I can see that Dana :: app () - & gt; GetRequest () - & gt; GetParam ('id'); Returns the product or category id on the product and category pages, but does not differentiate between those page types Dana :: app () - & Gt; GetRequest () - & gt; GetRouteName (); Return "CMS" for the CMS pages but the category "Returns the list" for both browsing and product view pages, so I use that category and product pages as separate Can not I Can I use safely to have some indicators in this re

unix - How to determine what user and group a Python script is running as? -

मेरे पास सीजीआई स्क्रिप्ट है जो "IOError: [Errno 13] अनुमति अस्वीकृत" त्रुटि प्राप्त कर रहा है वेब सर्वर की त्रुटि लॉग। इस समस्या को डीबग करने के एक हिस्से के रूप में, मैं उपयोगकर्ता और (विशेषकर) ग्रुप को प्रिंट करने के लिए स्क्रिप्ट में थोड़ा सा कोड जोड़ना चाहूंगा कि स्क्रिप्ट चल रहा है त्रुटि लॉग (संभवत: एसटीडीईआरआर)। मुझे पता है कि मैं बस sys.stderr के मानों को मुद्रित कर सकता हूं, लेकिन मुझे यह कैसे पता चलेगा कि किस उपयोगकर्ता और समूह की स्क्रिप्ट चल रही है? (मुझे विशेष रूप से समूह में दिलचस्पी है, इसलिए $ USER परिवेश चर मदद नहीं करेगा; सीजीआई स्क्रिप्ट में सेटगिड बिट सेट होता है, इसलिए यह वेब सर्वर के "www-data" के बजाय समूह "सूची" के रूप में चलाना चाहिए - लेकिन मुझे यह देखने के लिए कोड की आवश्यकता है कि यह वास्तव में हो रहा है।) आयात ओएस प्रिंट ओएस निकम्मा ()

Can I use PowerShell with SQL Server 2005? -

I know that SQL Server 2008 has highlighted some features in PowerShell as snapins. Now I want to know whether I can use PowerShell with SQL Server 2005? I think the answer is not , right? Thank you. Yes - you can use PowerShell with SQL Server 2005. SQL Server 2008 minishell, sqlps .exe, which works with SQL Server 2008 with server 2005 and 2000. To get the SQLS, you have a separate download form available as a part of installing SQL Server 2008 Management Studio or SQLS. In addition to this, you can write directly the PowerShell code using SQL Server Management Object (SMO). SMO is the underlying class used in SSMS and SKLPS and it was first used in SQL Server 2005. Like SQLS, SMO will work with SQL Server 2000. The codepex project I coordinate offers more than 130 functions and uses SMO and PowerShell which work with 2000 R2 versions of SQL Server 2000.

cakephp - how to prevent an element to validate -

For all I am using the cakep framework for my project, in my form, on this two other text boxes Clicking takes a checkbox. The method validates using the kppp I agree to the form data, but I want to avoid verification for that text box when the checkbox is not checked. This check is checked only when the checkbox is checked. Please help me thanks in advance Before you make your model Call service for this and add additional verification criteria for this model. For example: Validate ($ options = array ()) before the function {if (! Empty ($ this- & gt; data ['model' ] ['Field one']) $ $-> this-> Valid ['fieldTwo'] = array (/ * normal verification rule * /); Back true; // required or validation fails}

sql - update two or more tables with the single statement -

How do I update two or more tables without the help of which section? Thanks You can do this Updateable view < / Strong> and instead of the trigger For this, you have to create a view on your base tables and for this view, add "trigger instead" Later you can update the scene directly. Check the following links for more information

javascript - Select next element of a given class -

I want to hide and show some form in my page. There is a link for each form, My code looks like this: $$ ('I') Click on this link Please, .flagLink '). Each (function (s) {$ (s) .observe ('click', function (event) {// here to hide and show the closest form}};}); < P> I tried to: $$ ('. FlagLink'). (Function (s) {$ (s). 'Click', function (event) { $ (S) .next ('form') Toggle ();});}); This works, but I'd like to be more precise: $$ ('. FlagLink'). Each (function (s) {$ (s) .bosch ('click', function (event) {$ (s) .next ('. FlagForm') toggle ();});}); But the .flagForm selector does not work. My code looks like this: Flag First of all I hide all the forms in the page: $$ ('. FlagForm') . Each (function (s) {$ (s) .hide ();}); Then I add an onclick event to them: $$ ('. FlagLink'). Each (function (s) {$ (s) .bosch ('click', function (event) {$ (s) .ne

communication - Interface between a DSP/Microcontroller and a PC application -

I am using DSP to control a sensorless brush DC motor, the DSP is on a board with one What would be the best way to communicate between the PC application and DSP, because it is running because there is a parallel port and a massive connection (this is an eZdspTMS320F2812)? Ideally I want to program a GUI such as starting a button, stopping, speeding up, reducing speed ... but I have never done anything like that before which port and method would be the easiest to use? Thank you You can also use simple RS232 communication. I always use because it is cheap and easy to implement. RS 232 transceivers are very cheap (like Max 232 from Maxim-IC) and easy to use Apart from this, they come in many packages such as DIP or SOIC for example and can be found in almost all electronic outlets. You can use any USAR from your microcontroller to link MAX232. Then, using PC serial-USB converter (or if your PC has a serial port, it's easy), you can use serial port programming from any

how to read hindi text from a file in c++? -

संभव डुप्लिकेट: एक फाइल में हिंदी पाठ शामिल है। मैं इस फ़ाइल को पढ़ना चाहता हूं और उस पाठ में कुछ कार्रवाइयां करने के लिए चाहूंगा जिसमें वह शामिल है। इसलिए, अगर कोई कृपया यह बता सकता है कि उसे फ़ाइल से कैसे पढ़ा और इसे संभाल (या सिर्फ प्रिंट करें)। पूर्व: अगर फाइल में मैं एक भारतीय हूँ। तब मेरे प्रोग्राम को इस सामग्री को फ़ाइल से पढ़ना चाहिए और मानक आउटपुट पर टेक्स्ट के ऊपर प्रिंट करना चाहिए। मैं इसे लिनक्स पर करना चाहता हूं। डायरेक्ट कोड अधिक फायदेमंद होगा। एन्कोडिंग पर निर्भर करता है यदि आपकी फाइल यूनिकोड में एन्कोड की गई है, तो आपको बस एएनएसआई सी फ़ंक्शन ( fwscf , fgetwc और इसी तरह) का उपयोग करना होगा ताकि आप किसी भी भाषा में किसी भी फाइल को पढ़ सकें ।

ipad accelerometer doesn't work -

I have created a visual controller that works fine on my iPhone, I sent this view controller in the iPad app . The friend but the accelerometer was not working ... here is the code I used: I made the announcement: This is in my viewcounter code - (zero) viewDidoadload {[Super Viewedload]; [[UIAccelerometer shared accelerometer] setUpdateInterval: 1.0 / kUpdateFrequency]; [[UIAccelerometer shared accelerometer] Set Deliaget: Self]; } and then: - (zero) accelerometer: (UIAccelerometer *) Accelerometer did the speed: (UIAcceleration *) Acceleration {accelValueX. Text = [NSString StringWithFormat: @ "x:% 0.3f", acceleration. X]; AccelValueY.text = [NSString stringWithFormat: @ "y:% 0.3f", acceleration. Y]; AccelValueZ.text = [NSString stringWithFormat: @ "z:% 0.3f", Acceleration. Z]; } But the 3 labels did not change the text ... The only difference between the iPhones and the iPad is that the view controller on the iPhone is the base v

Execute a jar file using Ant -

I am trying to create a runner jar file from java classes from ant. Java classes use external jars. When I implement build.xml, exception is not found while running its display class Java program. Its collection is okay. Part of my source code: & lt; Path id = "project-libpath" & gt; & Lt; Fileset dir = "$ {lib.dir}" & gt; & Lt; Include name = "* .jar" /> & Lt; / Fileset & gt; & Lt; / Path & gt; & Lt; Path id = "project-classpath" & gt; & Lt; Fileset dir = "C: / xmldecode / lib" & gt; & Lt; Include name = "* .jar" /> & Lt; / Fileset & gt; & Lt; / Path & gt; & Lt; Target name = "compilation" dependent = "ready" & gt; & Lt; Javac srcdir = "$ {src.dir}" destdir = "$ {classes.dir}" & gt; & Lt; Classpath refid = "project-classpath" /> & Lt; / Javac & gt; & Lt; /

mysql - Update a field thanks to a subquery based on another field -

I use a MySQL DB, and I want to update a field based on another table. Something like this: Table 1 set field 1 = Table 2. Id where in field 2 (table 2 to table 2. Select name); I know this query will not work, but here's the idea. Is this also possible? You can use a correlated sub query as the following: Match value will be refunded This will increase an error if more than one matching value is returned or the zero is returned, the field is canceled. If that last action is not desirable, you will need the where section. Update Table 1 SET Field 1 = (Select Table 2. 2. From the table table table 2. Where table 2. Zone column = Table 1. Join column) < P> Edit With a record of 0 or more than 1 match you can SELECT table1.JoinColumn, COUNT (DISTINCT table2.ValueColumn ) Include Table 1 in Left 2 Table 2 on Table 2 Join column = Table 1. Table 1 through Zone column group. Zone column hosting COUNT (DISTINCT table2.ValueColumn) & lt; & Gt; 1

math - How to reflect an angle across the Y axis -

I am not a mathematician, but I have somehow got into the development of the game as a hobby. Anything beyond basic mathematics, I have a lot of trouble, in which it can be ascertained how in contrast to some angle, in the opposite direction, X axis and amp; An image more than 1000 words (especially uneducated words) says: I basically want to reverse the direction of the artillery objects that follow a robot. When the robot changes from facing the right to face the left side, then I do (180 - angle) as everyone suggests to me, but it really reverses the angle, by which They target the cannons while defining the targets. So, I need to do something else, but it escapes my knowledge. To keep it in other words, I work in 2D, so I want an angle facing the right to face right. <0> "Completely true" 180 "left" 90 "up" and My angles are defined: 270 "Down" I want something that is aiming with an angle of 9 when the reverse

winforms - What is the Browser version of a WebBrowser control in Windows Forms -

I'm creating a Windows Forms application that uses Vebbraujr control Can someone tell me that control engine How does it use? What is NAT framework version has been fixed on the basis I developed what I against it or whether it is based on the version of IE installed on the client machine? Does the client also need IE? In other words, if a site looks right in my application on my machine, what it believes will render safe it right on everyone's machine? Thank you! This version of IE installed on the target machine. There can be only one, IE does not support side-by-side installation of versions. You will work to not know your app without any problem for a fact unless you do not test it on those machines are installed with version 6, 7 and 8. This is usually the burden of the author of the web site.

algorithm - Python - How to find a correlation between two vectors? -

Let me locate them by looking at two vectors X and y Correlation, that is, their linear dependency / independence are both dimensions similar to the vectors. Results [-1.0] 1.0] should be a floating point number. Example: x = [- 1, 2, 0] y = [4 = (X, Y) Search [- 1.0 .. 1.0] . It should be a simple creation that includes list-understanding. No external library is allowed. Update: OK, if dot product is enough then here's my solution: nx = 1 / (sum (x for x for x * x)) ** 0.5) NY = 1 / (y (Y for y in y)) ** 0.5) cor = sum ((x * nx) * x (y * ny) x, z in zip (x, y)]) Right? Resolve the equation of the cosine angle between two vectors, which is always in the range of [1, 1], and what will happen to you The split dot is equal to the product.

php - How to flock() an image? -

I'm looking at an image flock (). Currently I am using the following $ img = ImageCreateFromPng ($ img_path); Swarm ($ img, LOCK_EX); It seems that the file handle of the GD library is not valid with the bunch. How can I swap the file using this image? function swarm works only on file handles (or if they are locking So, if you want to lock an image while reading it, you have to open it twice: $ f = fopen ($ imgpath, 'r'); If (! $ F) {// handle error (file probably does not exist, or no permission?)} If (swarm ($ F, LOCK_EX)) {$ img = imagecreatefrompng ($ imgPath); // ... your belongings are flock here ($ F, LOCK_UN); } Fclose ($ f);

php - Design pattern for creating an XML document from a database query that has a 1:many relationship -

All, Sorry in advance for the obscure title. Here's what I'm trying to do ... I'm working on an application for which to get a list of items, ask a database . That list of items will be formatted in an XML document that will return to the querying front-end. To make it simple, assume that the items in the books are in the books, each book has the following characteristics: ISBN, title, author, value is also between reviews of 0 and n in each book < P> Then, the data is stored in 2 tables: "book_info" and "book_reviews" have a line in each book's "Book_Info", and between "0 bookmarks" and "between bookmarks" I want XML that comes back to look like this: & Lt; / Books & gt; As you can see, there is a review of the first book, the other has no third to the third and third. My question is: What is the most efficient way to create a structure like this? For example, I can get a list of

entity framework - Share edmx Betwen .NET projects and C# Class Library -

I had two separate projects that used the same database, similar methods, etc. That's why I've created a new solution and added those two projects I have created a C # Class Library Project and I have written two other methods in two other ways. I have also created an edmx file for the DAL layer. I have added C # Class Library Projects in the context of other people, but now I have a problem. When I try to connect to the database, I get an error message: "Connection was specified" is installed in the ATLIC, not destined to use with EntityClient or not valid ( I have translated it from Portuguese, so it is 100% correct). App.Config has a C # Class Library, a connection string: Do I have to add a connection to the web.config of other 2 projects, which is called edmx from the C # class library. If yes, can someone show me an example? thanks I solved it by copying the connection string of APConfig (C # Class Library) into another 2 projects.

cruisecontrol.net - cruise control and displaying reports -

I want to display a list of unit tests that fail my cruise control.net dashboard. I dashboard it A build in the config was added to the report Everything was great until I decided to throw an error, if the unit test failed, the programmer would get a notice through CCTA. On the information screen it shows only a build error. How can I output the stuff that needs the Dashboard and can the CCnet notify the user if the unit test fails? I put the merge task in the block of publishers. The publisher block is already running ... if any work fails then it prevents other operations from running and so I have never merged.

Get version of gem within ruby -

संभव डुप्लिकेट: क्या एक मणि की आवश्यकता है और फिर रब्बी के भीतर उस मणि की संस्करण संख्या प्राप्त करें? आप कोशिश कर सकते हैं Gem.loaded_specs [$ NAME_OF_GEM]। संस्करण

c++ - Validity of a Socket -

I created the socket using the following lines of code and I get a valid socket and establish connection between client and server Is the machines It is likely that the socket network becomes invalid due to disturbances or any other reason. If so, how do we check whether the socket is valid or not. Socket SocServer; // sockaddr structure to set up ServerSock.sin_family = AF_INET; ServerSock.sin_addr.s_addr = INADDR_ANY ServerSock.sin_port = htons (portnumber); To create a socket for the 5005 // port number // portnumber if ((SocServer = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {Description is false; } // wPortNumber to bind the socket (bund (SocServer, (sockaddr *) & ServerSock, sizeof (ServerSock)) = 0) {return false; } // to listen for connections on wPortNumber (Listen (sockers, somexone)! = 0) wrong (return); } I have INVALID_SOCKET which means Socket 0 in other words. There is no other way out because my SocServer can check a value that will check for 2500

php - About unit testing a function in the zend framework and unit testing in general -

I'm diving into the world of unit testing. And I'm lost in a way I'd like to test if that is learned today is a function of work is so unit test I I have the following function: public function getEventById ($ id) {return $ this- & gt; GetResource ('Event') - & gt; GetEventById ($ ID); } That's why I wanted to test follows this function: public function test_Event_Get_Event_By_Id_Returns_Event_Item () {$ p = $ this- & gt; _model- & gt; GetEventById (42); $ This- & gt; Emphasizing criteria (42, EventManager_Resource_Event_Item_Interface); $ This- & gt; Emphasis type ('EventManager_Resource_Event_Item_Interface', $ p); } But then I found the error: 1) EventTest :: test_Event_Get_Event_By_Id_Returns_Event_Item Zend_Db_Table_Exception: No adapter found EventManager_Resource_Event / home / user / public / ZendFramework -1.10.1 / library / sf / model / Sarkfip: 101 /var/www/nrka2/application/modules/eventManager/mod

c# - Casting Down Data Contract Objects -

I have found an object on my client which is coming from the class being sent on the WCF contract, I'm killing problems because this class is ending, looks like, and deserialization on the server side determines which object to create and generate, and since the object is only present on the client. / P> I saw the KnownType attribute and tampered with the KnownType configuration section, but they all affect the server (receiving) side of the contract only. What I have to do is generate derivative class and only the information of the base class is sent on the serialized and pipes, using the WCF. The use of casting simply does not change the type of object, and it is still serialized. It seems that the known type of mechanism is somewhat backwards, is there any way to handle it from the client side? Regards Tristan

network programming - Android ConnectivityManager information -

I'm trying to get a better hold of Android's connectivity manager and how it works under the hood. It is very easy to use, but I am searching for a lower level, as it starts and the dirty details of its running in the background. I can not find a good resource about it. Everything is about using APIs. Does anyone understand or have any resources, which can tell me a website, book, white paper, or otherwise? I would really appreciate it. Thanks I just want to get it out of one. The source file is the best way to go to this one. Java.android.net is a directory that holds all the networking Java services. To switch from network to network, however, one has to look in the native layer.

regex - JavaScript Split without losing character -

I want to split some text using javascript. The text looks like this: 9:30 am The user welcomed the action A 10:30, user John Doe. 11:30 am Message User John Do Now, I want to split the string into events. I.e. :: 9:30 pm User Actions A There will be an incident. I am using RegEx for this: var split = journals.split (/ \ d * \ d: /); The thing is, the first two letters are lost. The split looks like this: 30 AM the user took action A. How do I divide so that the split holds the first two / three characters -text "itemprop =" Text "> Use a letterhead: var split = journals.split (/ (? = \ B \ d +) /);

c# - winsock component -

I have a winsock component that has an event created with vb.net in a class library. How do I see it in Tool Box if I refer to DLL in any other project? How do I use it in my C # program? Thanks If this is a proper component registered on your PC You can right click on the tool box and select Toolbox item which describes the dialog. Otherwise, just add a reference to the class and create some eventhalllers, just search for Google for custom eventhollers c # and you should find lots of samples / tutorials, for example The link looks like it shows a good and easy way.

c# - How to delay shutdown of an application when user logs off or shuts down Windows? -

I am writing an application that runs in the background to turn off from startup, and in some cases the application is displayed to me There is a need for the user to choose whether to continue the shutdown or not. This app will only be running on Windows, but may be running on any version since 2000. Although I have certainly done some research on this subject, the way the information about shutting down windows applications (shutdown) seems to be a little scattered if anyone has this subject The best way to handle it, or additional information about the subject, I appreciate it (I have very little experience with C #). Thank you! badPanda EDIT: I know that blocking off is not considered good practice. This is an important business requirement for this application. EDIT: At the suggestion of many commentators below (to redesign that stop blocking is unnecessary), I have used a NotifyIcon Balloon popup to notify users below While application is sending data though it is u

ASP.Net - Gridview row selection and effects -

I am using the following code, which allow the user to click anywhere on the line to select the gridview row Lets mouse over and out) The effect code does not apply to the rowdattound and I can not break it in the event. (It's wired). The control is in user control, which resides in the content page, which contains the masterpages. Secure void gvOrderTypes_RowDataBound (Object Sender, GridViewRowEventArgs e) {GridView gvOrdTypes = (GridView) Sender; // Check that the item being bound is actually a detorve, if it is, // attach the string and related Java characters to the necessary HTML events (E.RO.RowType == Data ControllerType.DATAV) {E. Ro Attribute ["Onmouseover"] = "Javascript: setMouseOverColor (this);"; E. Ro Attribute ["onmouse"] = "javascript: setmoouget collar (this);"; E. Ro Attribute ["onclick"] = page. Clientscript GetPostback Client Hyperlink (GVORX, "$ Select" + E.R. Ro Indexes); }} Scratch Thi

java - Understanding Hibernate saveOrUpdate and the Persistence Life Cycle -

Let's look at a simple example of a dog and a cat who is friends is not a rare incident. Apart from this, there is also the advantage of being more interesting than the case of my business. We need a function called "SaveFriends" which takes the name of the dog and the name of a cat. We will save the dog and then cat to work for this example, the cat will have to get references to the dog back. I think this is not a perfect example, but it is lovely and works for our purposes. FriendService.java public int saveFriends (string dog name, string quatname) {dog fido = new dog (); Cat felix = new cat (); Fido.name = dogName; Fido = Pashto Sweet Dog (FIOO); Felix.name = catName; [East. A] Felix. Friends = FIOS; [Ex.b] felix.friend = animalDao.getDogByName (dogName); AnimalDao.saveCat (Felix); Public Dog SaveDog (dog dog) AnimalDao.java (HibernateDaoSupport extended) {GetHibernateTemplate ( ). SaveOrUpdate (dog); Return dog} Public Cat Save Cat (cat cat) {g

logging - Translate Basic Config.groovy log4j DSL to external log4j.properties -

The following is a basic log4j configuration inside Config.groovy using log4j DSL with Grails 1.2, as it is expected Works (log errors: 'grails.app' root {error} Errors in the given file: log4j = {appenders {file name: 'file', file: " C: /error.log "file '}} How will this be translated into a property style log4j configuration file? The following does not work: Log4j.rootLogger = ERROR, fa log4j.appender.FA = org.apache.log4j.FileAppender log4j.appender.FA.File = C: /error.log Log4j.logger.grails.app = ERROR, FA I suspect that there will be an error in 'translation of grails.app' There is something along, but I do not really know, besides, the file can not be created, while with the first DSL version, it starts when the application starts. If it does make any difference The property file is configured externally (though, the external log4j.groovy file works fine): grails.config.locations = ["file: $ {baseir} / Ext Conf / log

python - Updating a module level shared dictionary -

एक मॉड्यूल स्तरीय शब्दकोश 'डी' और डीजेंगो वेब अनुप्रयोग में विभिन्न धागे / अनुरोधों से पहुंचा जा सकता है। मुझे नए डेटा के साथ हर मिनट 'डी' को अपडेट करने की आवश्यकता है और इस प्रक्रिया में लगभग 5 सेकंड लगते हैं। सबसे अच्छा समाधान क्या हो सकता है, जहां मैं चाहता हूं कि उपयोगकर्ताओं को या तो पुराना मूल्य या डी के नए मान और बीच में कुछ भी न मिले। मैं एक समाधान के बारे में सोच सकता हूँ जहां एक अस्थायी शब्दकोष नए डेटा के साथ बनाया गया है और इसे 'डी' को सौंपा गया है लेकिन यह निश्चित नहीं है कि यह कैसे काम करता है! अपने विचारों की सराहना करते हैं। धन्यवाद शायद सबसे अच्छा - मॉड्यूल स्तर पर: < कोड> आयात थ्रेडिंग डॉकैब = थ्रेडिंग। लॉक () डी = {} और हर तक पहुंच d ( नहीं बस संशोधनों!) एक के साथ ब्लॉक में है: डॉक के साथ: पाया = कश्मीर d और जैसे (यदि आप पायथन 2.5 पर हैं, तो आपको अपने मॉड्यूल के ऊपर स्थित __future__ आयात से_स्टेटमेंट से भी होना चाहिए)। यह डी लॉक के साथ, तो परिवर्तन क्रमबद्ध हैं। d तक गैर-संशोधित पहुंच के आसपास ग

What HTTP status response code should I use if the request is missing a required parameter? -

I'm thinking 412 (precondition failure) but could be a better standard? The status code means that the server understands that position 422 based on the most appropiate is. The content type of the request entity (hence a 415 (unsupported media type) status code is inappropriate), and the syntax of the request unit is correct (thus 400 (poor request) status code is inappropriate) The instructions contained in were unable to process, for example, this error condition may occur when an XML request body is well-formed (i.e., the syntax is correct), but meaningfully incorrect, XML instructions. They say that malicious XML is an example of a bad syntax (calling for 400) a faulty query string appears to fit this, so 400 is a well-formed query-string Does not seem appropriate, which is an ultimate memory. UPDATE @DavidV correctly states that this idea is for WebDAV, the core is not HTTP, but using some popular non-WebDAV API 422, any better status codes ( ) Are due to th

Which iPhone is best for application development, 2G OR 3G? -

I want to test the iPhone app to test the device. I am confused about the version of the iPhone which is best for iPhone application development. Can any of you suggest me, 2G or 3G is better? Your Instant .. Thank you. You will be better off waiting for iPhone 4, available in just two weeks to an old model By purchasing the iPhone operating system, the new version of iOS 4 will limit your ability to take advantage of all the features.