Posts

Showing posts from March, 2013

Is there a tool to remove unused methods in javascript? -

I have a collection of javascript files from 3rd party, and I get all the unused methods to get the size at a more reasonable level Please. Is there an address for a device that does this for JavaScript? Give a list of at least unused / used methods, so can I manually trim? It will be in addition to some running YUI Javascript compressor tool ... Otherwise I think that to help me do this, write a Pearl script. Not because you can do "usage" methods in this way in a very dynamic way. obj [prompt ("give a method name")] ();

php - why does my image roll over behave this way? -

Roll my image at work ... but there is only one way. Function Heartwork (ID) {if (document.getElementById ('heart' + ID) .src == 'images / heart line'); {Parent.document.getElementById ('heart' + id) .src = 'image / unknown' '; } If (document.getElementById ('heart' + id) .src == 'image / unknown'); {Parent.document.getElementById ('heart' + id) .src = 'picture / heart'; '; }} & Lt; Img src = "images / heart.png" id = "heart". $ Line ['id']. "Alt =" love! Width = "16" height = "16" range = "0" onmouseover = "heartover '." ('$ Line [id]') ". '; Return back," On-Houseout = "Heartwort" (' $ line [ID] ') ". '; If I do any other work on the IF statement, but they do not work together ... Attention: Try it with: One else If is not destiny. figure it out ... duh: if i have (...

python - Boolean evaluation in a lambda -

Just tooling around for your own entertainment, and I want to use lambda, because I think so. Can I change this function with lambda? DEF isodd (number): if (number% 2 == 0): Returned wrong other: Back right Primary, yes. But I am interested to know ... And if you do not actually need a function lambda Without it, you can also change it :) (number% 2! = 0) The self is an expression that evaluates for right or wrong is. Or even normal, bool (number% 2) which you can do so simple: If number% 2: print "Odd!" Other: Print "Even!" But if it is readable or is probably not in view of the viewer.

vb6 - How to Pass a Late Bound Parameter -

In VB6, I am trying to pass a late bound object into another form. frmMain Vb dim x set x = CreateObject ("MyOwn.Object") frmDialog set as a dim f fv = new frmDialog f.SetMyOwnObject x as a parameter in the frmDialog parameter is a string in which type name is the late-bound object, "MyOwn.Object" ByVal and ByRef do not make any difference, no clue? There is a problem in remembering. I used the warp (y). The result is 8, for vbString. This object must be 9 - ssorrrell 1 hour ago Use the print y in the immediate window to find the contents of y - ssorrrell 55 minutes ago This is to confirm my doubts It looks like MyOwn.Object should contain a default property or method that gives the string. Therefore, when you try to debug . Print , this will return the value of the default property / method when you hover the variable in the IDE, then VB6 will display the value of the default property / method. When you call VarType call y , this ...

c# - WPF MultiBinding -

I have two text boxes, one for billing address fields and one for shipping address fields. When the user types something in the billing address text box, the shipping address text box receives the same value due to the following binding scenario: & lt; Text box name = "txtBillingAddress" text = "{binding billing account, update resource trigger = property changes, mode = two}" /> & Lt; Text box name = "txtShippingAddress" & gt; & Lt; TextBox.Text & gt; & Lt; Multibind converter = "{static resource address converter}" & gt; & Lt; Binding element name = "txtBillingAddress" path = "text" mode = "oneway" /> & Lt; Binding path = "shipping address" update source resource = "asset changed" mode = "dove" /> & Lt; / MultiBinding & gt; & Lt; /TextBox.Text> & Lt; / Text box & gt; It works fine up to a point billing addres...

c++ - How do I generate an HTML file using XSL? -

As I understand, there are two parts using XSL to create documents: 1) An XML document that refers to an XSL stylesheet 2) An XML Stylesheet Suppose I want to generate a document using XSL, and then send it to a friend. Without reliance on the stylesheet available on the Internet, and without including the stylesheet as a separate file, how can I send it as a file and it just works? I think the ideal I 'd' conversion "like sending output, not just XML or XSL. Can this be done? You have two options: As you suggest Embed XML / XSL in a file according to XSLT space () if your friend has to convert the converted document (production of XML / XSL conversion) You are not sure that your friend will be able to process on the XML / XSL file itself, then you really have only one option. Are inserted

c# - How would I uniquely identify an entity in Entity Framework? -

I am using entity framework as my ORM for an asp.net (webforms) application. Suppose I had a "list / extension" set of pages in my application, when you click on a row in the list page, I would like to pass some type of ID of that line to the details page, which I In my specific case to load the row from my data level, the primary key is only a "line ID" identity column. However, EF likes to hide the primary / foreign key, so you can not access them (by default). I am new to EF, and I am thinking that there is a best practice to identify a line outside the context of the unit. I think I can add a unique identifier column and a matching property to my unit model for my record, but it seems to be meaningless for 2 unique identifiers for this line, to carry out the identifier at the presentation level Is a Better Way? In my _ItemDataBound () event handler, I am thinking that I can do something like this: Var declaration = (announcement) e.Item.DataItem; St...

javascript - animate textarea content -

I have a paragraph of a user entering the text in the text. line1 line2 line3 Can it be done only with jquery? Intentionally, all text will be blackened when a button will be converted to red in color of each line (2 seconds each line) / P> Edit: Sorry, friend again, you did not realize that you told Textaia at this time. No, it can not be done. However, you can: When the button is pressed, hide the textaria and display a divis in one place with content from the texture. Instead of displaying animation on it Of course this will not be editable anymore, but as I do not know what you are trying to achieve, this can be a work. Here is an example above. & lt; Textarea id = "ta" & gt; & Lt; / Textarea & gt; & Lt; Div id = "ta_div" style = "display: none;" & Gt; & Lt; / Div & gt; & Lt; Br / & gt; & Lt; Input type = "button" id = "go" value = "go" /> & Lt; ...

cross browser - Are there any trick to append ... by CSS? -

See my problem I have an element whose width = 50 px And to put me in that element is my string " This text is longer than 50px and will appear in two or more rows " What do I get in my element Do 50px width + ... is the text like this: This text is more than 50px and will be ... Is there any good Or the possibility of doing this with CSS Per way? There is a CSS property for this, but: text- Overflow: ellipisis; It's supposed to work in Firefox, but none is beautiful. Some Essential Reading:

.net - Windows Mobile Device with Webcams Plugged In -

I'm looking for the possibility of touching a webcam (better any webcam so that I'm not tied to any particular hardware vendor Be sure to write a Windows Mobile 5 or 6 device, and a piece of software app that allows a webcam to take photos or video streams to click on a button in that software app. So, I'll need it to know that it is possible to write software app to do this on the Windows Mobile 5 or 6 platform? What exactly should a webcam do (for example, TWAIN)? I had a look at the internet but there is no luck till now Thank you. Thank you. It will not be difficult to do this if the main reason is that most webcam USB devices are And I do not have any Windows Mobile devices that can work as a USB host. Perhaps you can do this with a Bluetooth camera. In that case, the manufacturer must supply the driver / SDK which can be run in the Windows Mobile.

Comparing MD5s in Python -

For a programming drill I created for myself, and later for use in a pretty non-secure system , I'm trying to compare MD5 hash to the one that is stored in a plain text file and it is extracted by the check_pw () function and submitted from a CGI form The password created with md5_pw ( ) is created to create all the hash in the program A is used. For any reason, if (pair [1] == md5_pw (pw)) always fails , although my program prints the same hashes in my error checking lines: print "PW is from the file:", pair [1], "& Br> & gt; Print "This is the MD5 PW you have entered:", MD5_p.view. (PW), " " Where am I messing up? Code: def md5_pw (PW): "" PD's MD5 returns to hex digest. " "M = MD5. NUU () M. UPDATE (" 4 HJ 2Vic 7Q DHD 9 SDFFF 9 "+ PW) Returns M. HexDogest () Def Check_PW (User, PW, Pwfile):" Return "if user is correct Name and password match, wrong otherwise Pwf...

asp.net - Parse aspx page for Checkbox inputs via the C# Codebehind -

I am trying to parse the HTML side of the ASPX page with the following C # code. Basically I have more than one checkboxes whose names are like this: The XX with qlcbXX is an item ID extracted from a database. What I would like to do A) Paste the link Selection for all checkbox inputs b) Determine whether they are checked c) If you add a list that is called keepList and addlistist then addlistList Any ideas? thanks -Seth It seems that this will work: Zero IterateControls (Control Parents) {foreach (control C. control in parent) {if (C is the checkbox) {keepList.Add (c); } And {removeList.Add (c); } If (c.Controls.Count> 0) {EertratHugh Hair (C); }}}

How long should functions/methods should be in average? -

We've all read a lot of long methods or actions, where your eyes are bleeding when you back Return Statement We have also seen those one-liner functions which seem useless ... I just wanted to ask: Do you think the best average length for the function / method? is? Keeping in mind that every language has its own way, you can specify what you are talking about in your answer. Thanks! "No matter the length of the average function" You must use thumb rule, function / method should have a very accurate functionality, which should be named after its name. If you can not define "what this does" on your name, you should split it but this length may vary, because some very specific tasks require a lot of code. And as you have said, seeing some functions, your eyes are bloody, if they come in blood, then something is wrong with the function;)

Do any Java libraries use annotations for code generation? -

Is anyone familiar with a library that uses the technique (annotations and classifying) that standard object management is automated for string Forms (), equivalent () and hashcode () equals for standard Java classes? Yes, project does this by Lombok. See . It does not support Jawak only, but also eclipses, so the methods are not in the source code, but are displayed in the inline view.

SQL Express connection string hell ASP.Net -

SQL Express 2005 is running locally. I have a project written by someone running on the same machine. What I want to do is connect to it, can not it be right? This is what I use in my old classic ASP code to kill another database running on the same example: provider = SQLOLEDB; Data source = milapop \ mssmlbz; Continue the security information = true; User id = test user; Password = latin; Initial Catalog = TestDB Net code throws a wobbler because it is written using SQL Server drivers, which does not like content provider. Here is the original connection string from your code: server = (local); Initial catalog = database; User ID = TheUser; Password = thePassword; I'm trying out many options from there, they all get "SQL server does not exist or access denied" (what a beautiful mixed error message!): Data Source = Localhost; Integrated security = true; Initial Catalog = Database Data Source = Localhost \ SQLEXPRESS; Integrated security = true; Initi...

control - Winform usercontrol in WebForm -

I want to display a "folderview" which I can drag and drop files, but via webform To I am doing this through a webbrowser control pointing to local drives. This code works in a Win form user control, but what I have to do is to embed this control into a web form. It is an intranet, so security etc. is less than one problem. However, when I add things like permission into my control, like droop or webbrower control, it stops working - I get an image placeholder, which I consider to be an error. Can someone give me an idea which is wrong or perhaps suggests a different solution? Hi, I understand it when you deploy a new version of your user control, GAC Download Cache - Gastil / CLC has to be cleaned, but I think your DLL version may be ready. I do not think the web browser control works at all but I may be wrong. I have been able to drag and drop msg files with Outlook Automation

What happend to the visual XSD editor in to the Visual Studio 2008? -

विजुअल स्टूडियो 2005 में एक उत्कृष्ट दृश्य XSD संपादक है: वीएस में 2008 मैं इसे अब और नहीं ढूंढ सकता ... XML स्कीमा संपादक को वीएस 2008 से बाहर निकाल दिया गया था विभिन्न कारणों से। हम इसे एक नए डिजाइनर के साथ भविष्य के संस्करण में बदलने की योजना बना रहे हैं।

javascript - Is google AJAX Libraries API bypassing same origin policy? -

से: https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript समान मूल नीति एक मूल स्रोत से किसी दस्तावेज़ के गुणों को प्राप्त करने या अन्य गुणों से प्राप्त करने से एक दस्तावेज़ या स्क्रिप्ट को रोकता है। यह नीति नेटस्केप नेविगेटर 2.0 में वापस सभी तरीके रखती है। तो क्यों समान मूल नीति लागू नहीं की जाती है ?, जब इसके पास एक स्क्रिप्ट टैग होता है: & lt; script src = "http: //ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js "> & lt; / script> मुझे यकीन है कि मुझे याद आ रही है ' कुछ ', मैंने पढ़ा है बार की एक गुच्छा, लेकिन पता नहीं लगा ...

standards - Office Open XML: Relationship not used in the document -

I have an open office XML document, where a relation is defined in the relationship, not used anywhere in the document Is not it, neither in the MainDocumentPart nor in any other part whether it is an illegal openexmail document or not, due to uncertain relations, the document can be considered invalid. This does not seem to cause any problem.

javascript - How to check if a text is all white space characters in client side? -

How does a user input text have all white space characters (space, tab, enter etc) in the client side? / P> Thank you in advance! This question has been tagged with jQuery. In JQuery, you can run the following: if ($ .trim ($ ('# myInput'). Val ()) == '') Warning ('input is empty') ;

asp classic - ASP Login page for ASP.NET Application -

In my workplace, we have several classic ASP and ASP.NET applications. Although all these applications are integrated through a single sign mode, doing separate tasks, which are controlled by a main application. The main application is in classic ASP and verifies user ID and password initially and then stores the user ID in the session variable, which is then validated by all other ASP and ASP.Net pages. Used as a user. (For Dot Net pages we use session bridging) Is this a classic ASP certified? (I do not know the classic ASP) Since that time I was introduced for this setup, I need to worry that this setup is innocent. Is there a better way to do this? Is it possible to get certified for both classic ASP and DOT net in the same login page? What have I always done about my classic ASP applications that you have described when the user logs in Then their credentials are authenticated and then user ID and other relevant information is stored in the session cookie. The ...

Do I need a server to use git? -

If I work from my computer or whatever, then I need a network server and files in there Check-in? If I am using git , should I still be a server or am I actually saving files on my server? This includes many hosted solutions for Git repositories, and. The word of your question indicates what you can misunderstand The guit (and the normally distributed version control system) are all about whether you introduce the guitar to the unofficial introduction or git Like to be able to read like an introduction.

Is there a standard mysql connection pooling library for C? -

I have one application using database access. Is there a standard way of implementing the database pooling connection to such an application? It does not appear to support. "thread-safe high level multi database connection pool library", looks very promising Before I suggested that can be used to do this, such as client side caching load-balance Translate between different database access APIs If the MySQL library is dynamically linked, then this application should be done without conjugating The issuer. When I last seen in 2009, the suggested SQL relay production may not be fully prepared for use, but it seems that.

How do I change the color of a scrollbar in Delphi? -

How do I change the color of the scrollbar in Delphi? Make your life easier and just download a componet i.e.: Because where Until I know that you can only change the background of the scrollbar ScrollBar1.Color: = clRed;

relationship - How to layout a subscriptions database (like youtube)? -

Like Youtube, I have a useful, table with a table (video) and categories with objects. Now, I want a user to subscribe to a class, but how can I do this effectively? I need a category of a class for which the user sees the member (many-to-many relationships), but I need to keep track of which object (video) the user has not seen yet, how do I is that so? There is just another table that tracks the video the user sees. Then, after selecting which video to show the user, check against the viewed video table to make sure they do not see it yet. You can still use this table to show the user a list of all the videos they have visited, or display a complete list of that site, currently viewed on the site etc. going.

iphone - Detect touch *anywhere on the screen* in cocos2d? -

I'm really sorry, I know that there are many questions to ask about the Cocos 2D touch detection (Including those who answer me a bunch), but I can not get any of them to work. Instead of asking my questions, I have to comment on the answer I added, but I do not have enough representatives to leave comments. Whatever I want to do, anywhere on the screen a user closes the animation as a tap. This is my code so far: - (BOOL) touches with ccTouchesBegan: (NSSet *) event: (UIEvent *) Event {NSLog (@ " Touch started "); UIT * touch = [touches any object]; CGPoint Location = [Touch Location: [Touch View]]; Location = [[Directors Shared Directors] Convert Condanet: Location]; CGRect mySurface = (CGRectMake (100, 100, 320, 480)); If (CGRCentcentsPoint (Mersfofus, Location)) {NSLog (@ "Event Handle"); Return Kaffintheld; [[Director share director] Stop Animation]; } Return kEventIgnored; NSLog (@ "Event unrecognized"); } I have tried both BOOL a...

javascript - jQuery animate problems -

I use the following snippet to create the background light of an element, then gradually for more than 30 seconds Fade: $ ("#" + post.Id). CSS ("background-color", "light blue"). Value ({background color: "white"}, 30000); Two questions First of all, instead of being white, is there a way to fade the ambiguity up to 100%? In this way I do not need to change "white" if I choose to change the background color of the page? Second, once every 10 or 15 times, the background light blade stays and fails white. I am using the latest version of jQuery and the UI core. What could be wrong? Edit: Bounty is the solution to the problem in relation to the second question. EDIT2: Obviously I had to go into oblivion because I said that I was able to solve my solution but did not show it to him. My mistake. I did not want to promote myself My code works 100% time and does not require jQuery. A display and code can be found here: ...

.net - Why is Windows.Forms in System and not Microsoft? -

I always thought the root namespace in .net, " system " was primarily For which there was not much dependency on a particular platform. I was thinking that anyone has any thoughts or insights, because Windows.Forms namespace system and not Microsoft because it seems pretty worn out in a platform. (Any flame war or unnecessary MS Bass, please, if possible!)) I have read somewhere that the system * Namespace is for those things which are part of the core. Net structure, while Microsoft. * Nom place additional "Price-added" alternative extras, or things that are in development. Edit: Brad Abram has discussed this in his blog post Additionally, A quote from Visual Basic 2005 refers to the .NET 3.0 programmer : Microsoft-Root namespace contains Microsoft-specific items. In theory, any vendor intermediate language ( IL) can apply .Net languages ​​that translate into code. If you were to create such a language, then items in Microsoft ...

php - Accessing session data outside Joomla -

I'm trying to run an application outside of Joomla (not in the form of a plugin) and I'm logged in user's Want to use information (user id) I'm thinking how should I go about doing this? Is there a file in which I can join? I tried to use $ _SESSION but it appears blank. Is there a simple solution to my problem? Thanks for your time. Actually it seems as easy as not. Joomla comes with its unique session-ID-generation and some encryption in place, using handheld sessions, so the only way to get Joomla session data is to use the appropriate Joomla functions (as suggested by other suggestions). To do. There was a recent project where we needed to move a Joomla certified user in a separate application. We did this by adding a Joomla adapter which provides the Joomla user class immediately, the user reads the data, puts everything in an encrypted cookie and redirects back to our application. There we read encrypted cookies, instantiate our own user objects and dis...

c++ - Can I cast std::vector<Animal*> to std::vector<Dog*> without looking at each element? -

I have a base class in which several squares have been expanded. I have some generic library utilities that make a vector-oriented pointers for the base class so that any of the sub-squares work, how can I remove all elements of vector to a particular child class? // A method is said to be believed that animals with dogs thrown in animals are passed. Zero myDogCallback (Vector & Lt; Animals * & gt; and Animals) {// I have all the elements of animals / vectors & lt; Dog * & gt; Dogs = Artists (Animals); } My inexperienced solution will look something like this: // A method is said to be believed that a vector in which the animal is planted The dogs are gone by the passage. Zero myDogCallback (Vector & Lt; Animals * & gt; and Animals) {// I have all the elements of animals / vectors & lt; Dog * & gt; Dog's; Vector & lt; Animals * & gt; :: Iterator Eater; (Iter = animals.begin (); iter! = Animals.end (); ++ iter) {dogs.push_back (dy...

c# - Define optional implementation methods in Interface? -

Is it possible to define an interface with optional implementation methods? For example, I have the following interface definition in the form of the IDTider in my Core Library: Public Interface IDataReader & lt; T & gt; {Zero Start Reid (T Data); Zero stop (); } However, in my current implementation, the stop () method has never been used or implemented in all my implementation sections, this method can not be applied, as That is to throw NotImplementedExcetion as the default: class MyDataReader: IDataReader & lt; MyData & gt; {... public void Stop () {// This does not appear to be an implementation of an incomplete code throwing notepointed exception (); } Of course, I can remove the throw exception code and leave it blank. When I created this Data Reader Interface, I thought that it might stop the process of reading that we will use the stop () sometime later in the future. Still, it is not possible to alternatively prevent this method? I think th...

encryption - Php, should i use sha1 or others version of sha? Whats are the differences? -

I am going to generate a random password for my users. Maybe I'll use salt and shaw method. But I came to know that there are other versions of sha1, like sha256, sha512 etc. What is the difference between sha versions? Which is better, more secure and faster (performance)? Who should I use? Edit: I'm a php user, thanks :) Password generation is not as straightforward as you think. For example, if you are generating a password for a site that can be accessed by a mobile phone (or any device with only one numeric keyboard), then you should ensure that your password is consistent with two The letters will not be placed on the same key. There is a huge UI fault. An example: consider dfe4Pl7 as a password to type it, once used, to type symbol Received from, 3 Press, then press three times, wait again and '3' press twice. it's useless. In more general terms, the password should be generated so that the wrong interpretation could possibly be avoided...

validation - Disable jquery call on postback -

I have the control to change a password that is controlled by jquery on a harmonious device, when the user Asp.net validation controls are displayed if the password changes varies. However, because the disk collapses by default when a postback occurs, the div is collapsed, so you will have to change your password to see the verification message. What is the best way to set up the Div to show the verification message is shown? You can use the Page_ClientValidate () function to check whether someone There are validation errors if you lie, you can see the div.

python - How to do scheduled sending of email with django-mailer -

I am creating a dynamic app for which to be able to create email and then send them at a certain time. I was thinking that I could use the Degenego-Mailer to put things in and I can send it back. However, theire is listed in the sample case list, this is the list that it is a feature, I can not know how to do it. What should I need to be able to set the 'when_send' field in django's message model -mailer, and when cron jobs fire the send_mail function, those people are required to filter Who has the date 'when_to_seend' which is more than the current time ... def send_all (): "" "Quit all eligible messages in queue." "Lock = file lock (" send_mail ") logging. Debug (" get lock ... "): lock.acquire (LOCK_WAIT_TIMEOUT) has already been left: logging.debug (except" locktimeout " Excluding the return, "Lock is already locked.") After returning: Logging. Debug ("Waiting for lock timing out. Wa...

asp.net - What's the most used format for webpages for mobile? -

This is a long time because I have seen anything in the mobile world so I am very much in touch. I have a website (done in ASP.NET) which is currently live and I need to make it a mobile version. What is the best / most commonly used format of pages these days mobile? Is it cutting the HTML page with some graphics etc. or is it WLL or something else? The types of handsets being targeted can be anything - I think what's in the pocket of people Thanks I do not think some smart phones such as iPhone WML do. I would like to be on XHTME with small graphics (not HTML only - it is important to have XHTML because this is less processor intensive, and you should write good code anyway).

encoding php scripts on fly -

संभव डुप्लिकेट: मैं उड़ने पर PHP स्क्रिप्ट को एन्कोड करने के लिए एक एन्कोडर की तलाश कर रहा हूं, ताकि मैं यूजल से यूआरएल यूआरएल का अनुरोध कर सकता हूं और उस यूआरएल पर लॉक एन्कोडेड फाइल वापस कर सकता हूं। मुझे नेट पर खोज करने के बाद यह मिला लेकिन ऐसा लगता है कि वे अब इसे लंबे समय तक अपडेट कर चुके हैं और इस सॉफ़्टवेयर के लिए डिकोडर्स भी ऑनलाइन उपलब्ध हैं, जो लोग काम करने का दावा करते हैं। ////////////// /////// EDITED ///////////////// ज़ेंड गार्ड काफी महंगी है, मैं 300 डॉलर से कम की तलाश कर रहा हूं, Ioncube लिनक्स प्लेटफॉर्म के लिए एन्कोडर्स प्रदान करता है, तो क्या मैं इसे ऊपर उल्लिखित तरीके से उपयोग कर सकता हूं? धन्यवाद। मैं ज़ेंड गार्ड का उपयोग करता हूं यह एन्कोडिंग, अस्पष्टता, और लाइसेंस नियंत्रण प्रदान करता है। जबकि चाचा सही है कि यह सही 1-रास्ता एन्कोडिंग बनाना असंभव है, यह बेकार नहीं है। आपका लक्ष्य भी आपके कोड को रिवर्स-इंजिनियर करने में असंभव बना देता है, बस आर्थिक रूप से व्यवहार्य नहीं है।

How do you create an extension in C#? -

I wrote this extension in VB.NET for stringbuilder: import system . Compiler services public module sbExtension & lt; Extension () & gt; _ Public Sub-AppendFormattedLine (as ByVal oStr System.Text.StringBuilder, _ ByVal as the format string, _ ByVal as the arg0 object) oStr.AppendFormat ("{0} {1}", String.Format (format , Arg0), ControlChars.Newline) and all sub lieutenant; Extension () & gt; _ Public Sub-AppendFormattedLine (as byVal oStr System.Text.StringBuilder, _ ByVal format string, as byVal arg0 object, as in the form of _ ByVal ARG1 object) oStr.AppendFormat ("{0} {1} ", String.Format (Format, Arg0, arg1), Control Chairs.NewLine) and Sub End Lt; Extension () & gt; _ Public Sub-AppendFormattedLine (ByVal oStr System.Text.StringBuilder, _ ByVal as the format string, _ ByVal as the arg0 object, _ ByVal as the ARG1 object, _ ByVal as ARG2 object) as oStr. AppendFormat ("{0} {1}", string.format (format, arg 0, arg1, arg2), control...

c# - progmatically rewritemap rules at runtime -

Is it possible to add static rhythm rules to ASP.NET 3.5? I have: - & lt; Rewrite map & gt; & Lt; RewriteMap name = "my name" & gt; & Lt; Add Key = "/ Sale" value = "/ Test.aspx? Id = 10" /> & Lt; Add Key = "/ Sales-and-Marketing" value = "/ Test.aspx? Id = 10 & dog = cat" /> & Lt; / RewriteMap & gt; & Lt; / RewriteMaps & gt; But do you want to add these programmatics to runtime? I know a little while, but you can program it in different configurations through URL & lt; Rewrite & gt; & Lt; RewriteMaps configSource = "urls.config" /> & Lt; Rules & gt; & Lt; Rule name = "Rewrite rule 1 for static redirect" & gt; & Lt; Mail url = ". *" * / / Gt; & Lt; Conditions & gt; & Lt; Add input = "{StaticRedirect: {REQUEST_URI}}" pattern = "(. +)" / & Gt; & Lt; / Status & gt...

c# - Why does Visual Studio recompile non dirty projects? -

I have a solution with some projects with dependency. When I have a project and recompile, Visual Studio compiles all the projects again, even if I have changed them (or any of their predecessors) or not I only # Using projects I tried to clean out the output - no change I checked the dates of my files - no future date. Has anyone seen this behavior? Is there Any treatment for this? A possible reason for this problem is incorrect timing stamps on your files; check the files in your project and Make sure they are not stamped at some point in the future.

objective c - @properties question on iPhone development -

I use what I read, @properties and @ synthesize. The compiler has different properties for our gates and satellites. So when I look at the source code of an Apple example, JetKat, which uses only one class for the entire game (different from the App Rep) and still most properties of that category @property () Are defined and synthesized, even if no other classes try to get / set them, what am I going to misunderstand here? Thanks typeprop = "text"> Using properties is generally good practice synthesized setters memory Management (maintaining, or just specifying, depending on how you have your assets configured) will do the right thing. There is a way to provide a clear separation between them / html>

mysql - SQL Joins in Rails -

Below is trying to work in the existing database in the Rails, MySQL works very well in the console: Select the title, add blog_name from exp_weblog_titles, exp_weblog_titles.weblog_id = exp_weblogs.weblog_id LIMIT on exp_weblogs; + ------------ + --------------- + | Title | Blog_name | + ------------ + --------------- + | What do we do Chicago_Pages | + ------------ + --------------- + 1 line set (0.00 seconds) Although rail In the console, this is what I get: & gt; @title = title.find_b_sql ("select title, exp_weblog_titles from blog_name exp_weblog_titles.weblog_id add exp_weblogs" exp_weblogs.weblog_id LIMIT 1 ") => [# & lt; title title:" what do we do "gt; ] I have indicated to the fact that for some reason the Railways will display columns only from the first table in console mode without any tricks Can anyone tell me how to connect ? says responsible However, I guess what you want: class title & lt; ActiveRecord :: ...

linq - Will there be IQueryable-like additions to IObservable? (.NET Rx) -

The new IObservable / IObserver framework in the system. Reactive libraries coming in NET 4.0 are very exciting (see and link). It may be too early to guess, but will this be the IQueryable-like framework designed for a new terminal? Instead of a series of calls to get a special case of use, instead of a series of sources, assistance will need to be done in pre-processing events. For example, if you have a very 'chatty' event interface, then using subscribe (). Where (...) will get all the events through the pipeline and filter the client What I am thinking is that there will be something similar to the IQueryableObservable, to make these LINQ methods some ' Smart ', which is implemented in the source. I can imagine some network server architecture that can use this framework. Or how about an AD-ON SQL server (or an RDBMS for that matter) that will allow the .NET code to retrieve new data information (triggers in the code) and those notifications require the...

Refactoring Derived Classes' Methods to Common Base Class' Method? (C#) -

In my project, I have some functions in the devised classes that are similar to one section, which is different in each. I want to draw the law up to the base class. Functions look like this: func (parameters) {// normal bits if (someVar == "value1") {htmlFilename = line; } And if (someVar == "value2") {subVideoLink = line; } And if (someVar == "value3") {linksH2HeadingWritten = true; } // common bits} where the center lines of different functions look like everyone but different values ​​for "somevar" and different variables in "variable = line"; Format. This is a normalized form: if (someVar == "CommandName") {variable = line; } The function can be found in the dictionary to send, but it seems that I can not make a dictionary with the referee string ... Then I call the boolean cases of 'variable' to be "true" or "false" We will remove the values ​​with string versions alo...

php - Grabbing the information from a url? -

I have an online project "Question of the Week"; This project allows users to submit their questions. These questions are saved in a mysql table; The question is also sent to another simple post.FPP which stores the question in a phpBB. I want to use this phpBB for each question to discuss that question. So now, my project stores the question in the SQL table as well as posts a question in phpBB. But when the question is posted in phpBB, it stores "" in it's t = 24 question I get somehow to capture this URL and remove T = 24 So that my project can have a click enabled link for every question that guides the question of its particular phpBB page. Let's say your project (the user query allows you to post questions is inserted into SQL table and it also says phpBB / simplepost.php posts Questions phpBB) and this question can be seen in php: "" Please suggest me what I should do. How can I catch "t = 24" from this URL? When ...

iphone - Why is my CLLocation speed so inaccurate? -

I am playing a bit with the iPhone SDK and I want to show the current speed in my application. There are so many apps that can actually be accurate, especially for low speed like running or biking. The best I've seen is Runkeypair. But, in my application, the speed is absolutely wrong. It is always zero at low speeds, and at high speeds it shows some values ​​but they are seldom updated and are not really useful - (zero) locationManager:. (CLLocationManager *) Manager didUpdateToLocation: (CLLocation *) newLocation fromLocation: (CLLocation *) oldLocation {if (newLocation.timestamp> oldLocation.timestamp & amp; newLocation.verticalAccuracy> 0.0f & amp; ; 500.0f; // GPS active newLocation.horizontalAccuracy & lC & amp; kCLLocationAccuracyHundredMeters & amp;; // Good quality GPS signals //newLocation.speed> 1.0f & amp; / Enough movment for precise speed and course measurement // GPS active //newLocation.horizontalAccuracy & lt Old locati...

How can I turn on and off the bluetooth on iphone sdk programatically? -

How do I tell the program when the Bluetooth device is turned on or on? And in moral case, turn it off or in the program? Thank you Have you turned off Bluetooth when you run the GKTank application Appears that popups are talking about? I suspect that this pepper is a class function - I have not seen any way to ask Bluetooth status directly. However, if you try to make a Bluetooth call when Bluetooth is off, then you get a G2CessionCannotEnableError error code (Bluetooth is currently unavailable).

c# - Search and replace non-HTML content -

I have to write some code that will search and replace the entire word in a string outside the HTML tag. So if I have this string: string content = "brown fox has jumped over lazy dogs" and ; String keyword = "the"; I need to do something like this: if (content.ToLower (). It contains (keyword.ToLower ()) content = Content.Replace (keyword, string.format ("& lt; span style = \" background-color: yellow; \ "& gt; {0} , keyword)); But I do not want to change "the" in bold tags or "only", "the" before. Try it out: content = RegEx.Replace (content, "(? & Lt;; & Gt;)" + keyword + "(?! ( "+ keyword + '& lt; / Span & gt; '; Edit: I have fixed the "this" case, but it is not where more than The keyword is wrapped in HTML, like, "Fox jumped on the lazy dog." What are you asking, almost everyday HRM, RegEx and impossible with...

php - solve apache problem when more clients connect the site -

I have a php web application on the web server, connect between two oracle db servers in load ala ... Application smarty template engine used in the web .. and ajax jquery problem - When more client web application connects the site does not stop or the apache is running then we restart Apache. - Some web pages are slow. I want to fix the problem and how to do Apache and demonstrate with more customers. You have not given too much details, so some (common) possibilities: Using PHP opcode caching Use a different static media server for all static media. Run with MaxChildren / APC, XC, Z MaxClients and related options. It is possible that you are just getting a lot of visitors, upgrade to a fast machine, or load the balance between multiple app servers.

How to convert from a mouse position to a character position in a JEditorPane in Java Swing -

I am currently trying to solve a problem where the Zeddercan should find the position in a piece of text where Mouse was clicked. Actually, when a user right-clicks a word, I need to know what to do in order to do what I need to know in terms of which user Clicked on. I know that I can easily get mouse position from mouseEvent which has passed in the mouse pressed method, and I am told that you can change it to get character index in the piece of text - though I It did not figure out how to do it. The ViewToModel () method has been tried on JEditorPane but it is giving me wrong position in the text, or I am using it wrong or it does not work in this way. Any thoughts? encoding viewToModel () The correct way to do this is: Public Zero Mouse Clicked (MouseWave E) {ZDatorPan Editor = (ZdTrapane) E.GetsSoS (); Point Point = New Point (EATAX), EETEGEE ()); Int pos = editor.viewToModel (pt); // whatever you need to do here)

cocoa - What is the best way to store document specific settings in a Core Data Document? -

I am using a NSPersistantDocument supported by core data in my data. There are many settings in each document that are only relevant to that document, for example, the document needs to keep the unique ID of an Address Book group, to update it later on. The way I want to come to it, its second model should be, DocumentSetting , which has two features; A key and a value, which is NSString s. Ideally I want something like NSUserDefaults , but stored in the document. Has anyone done this before? Is there any better way to do this? SetdatData: NSPersistentStore can be used to store the method -document settings store metadata How to find documents about using. As has been advised in the docs, there are limitations of some sizes that can be kept there. If you need to store a bit more than some key / price combinations, then I recommend creating a new unit in my data model to store such data.

Django, setting selected="selected" on a radio input -

A simple form with ModelChoiceField is displayed as a radio button (inherited widget). A change event for each post I am using, each user selects a radio button: shipping_choice = shippingChoiceField (queryset = ShippingMethods.objects. All), empty_labil = none, widget = forms.RadioSelect (attrs = {'Class': 'order', 'onchange': '$ ("# shipping_choice"). Submit ()',}))) I need the radio that the user selected thought, the page is actually "selected" when reloaded. Adding an additional 'ARR' selected will not be, 'because it should be done when users actually make the first option. P Form has a initial attribute that you can use: Your code (initial = {'shipping_choice': current_choice}) Again, I think you're using ModelF orm , in this case, you should just enclose the example: form = YourForm (example = order) # where "order" is your example ... Or maybe you do not unders...

css - "text-decoration" and the ":after" pseudo-element -

इस सवाल का पहले से ही एक उत्तर है: 10 उत्तर सभी सही सोच लोगों की तरह , मैं एक लिंक पर क्लिक करने से नफरत करता हूं और बहुत देर तक खोजता हूं कि यह ब्राउज़र-अपंग पीडीएफ या माइक्रोसॉफ्ट ऑफिस फ़ाइल की ओर जाता है। मैंने सोचा था कि मैं ऐसे लोगों के लिए जीवन को थोड़ी आसान बना दूँगा जो ऐसे फाइलों के आगे बढ़ने वाले लिंक के बगल में थोड़ा सा आइकन दिखाएगा IE8 के अंत में : के बाद छद्म-तत्व का समर्थन किया, मैंने सोचा कि सीएसएस घोषणा काफी सरल होगी: a.file_pdf: after {content: url ('/ छवियों / pdf.png '); पाठ-सजावट: कोई नहीं; पैडिंग-बाएं: 5px; } IE8 में, यह ठीक काम करता है। फ़ायरफ़ॉक्स और क्रोम में, यद्यपि, टेक्स्ट-सजावट: कोई भी को नजरअंदाज नहीं किया जाता है, और नीचे की रेखा आइकन के नीचे पूरे बिना अनियंत्रित रूप से फैला हुआ है। एक अतिरिक्त टैग मैं इसे एक अलग तरीके से, एक पृष्ठभूमि की छवि और एक पैडिंग (जैसे) कर रहा हूं: a [href $ = "। Pdf"] { पैडिंग-दायें: 21 पीएक्स; / * आइकन के लिए स्थान * / पृष्ठभूमि: यूआरएल (ग्राफिक्स / पीडीएफ) कोई भी दोहराने वाला ...

php - Best Practices for __get() and __set() -

__ get () and __ set () on it To use the variable, I want to get input on how they are used in general, I am thinking that when the best time to use the overloading function, and where you have used one (if you have). Just to be clear, we are talking about these tasks: Using lazy model gates (__get ()) I do not remember using magic, magic methods are often in my app, but I miss a situation where __ gets () was very helpful. In those days, I was developing an application in the KP PHP framework which was launched in many models and specific controllers, even though the method was one or two of them (Only the cake was working). So I decided to turn that lazy model into lazy (to load the models used for the first time). What I did is very simple __ get () function with a specific name that was looking for a model and loaded it 3-4 lines of code Was like. I have defined that in AppController (all the KPPHP classes come out of that controller) and suddenly my app use...

Controlling mouse with Python -

How to control the mouse cursor in a python, that is, move it to a fixed position and click under Windows ? test on WinXP, after installing Python 2.6 (in my case pywin32-214.win32-py2 .6.exe): Win32api, win32con def (X, Y): win32api.SetCursorPos ((x, y)) win32api.mouse_event (win32con.mouSEEVENTF_LEFTDOWN, x, y, 0,0) win32api Mouse_event (win32con.MOUSEEVENTF_LEFTUP , X, y, 0,0) (10,10)

creating a server project in vb6 and ms-access -

I am creating a project in Visual Basic 6 and MS-Access about it's college management system and a server based application . Customers can use the system in the server. But the main problem is how can I access my client's access file located in the server computer. ?? If my database file has already been opened in the server computer then my clients can not access the file in the server. Is there any other way to solve the problem? How can I create a database file in the login so that all my customers can use it together? Please help ... I believe you will find your answer. Quoted from MSDN article: To prevent this behavior, you must ensure that all users who open the database have read, write and create rights for the folder located in the database. Additionally, if you are using the Security-Enhanced Access Database, you will need to ensure that the user who opens the database also has permission to read and permission on the folder containing Workgroup Informa...

Dynamically store lines of strings using C -

I want to store lines of dynamically wire using C language. For example, sadasdasda5245sdf fadfa6456 Fasdf90-70 = 790 The number of such rows and the length of each line can be anything. There is no way to dynamically store the whole thing. There are many data structures that allow you to dynamically add items In order to know in advance what the maximum elements are required, there are linked lists, binary search trees, balanced trees, attempts, heaps and many more. Similarly, there are several ways of dynamically allocating stars of different lengths. The easiest possible would be to use a simple one: typedef struct _node {struct _node * next; Four * values; } Node_t; Keep track of head , the first item in the list, and the next node in each next field indicates. For example, to cross the list, you will type something like this: currentNode = head; While (currentNode! = NULL) {/ currentNode-> Do something with value * / currentNode = curren...

python - How can I launch a background process in Pylons? -

I'm trying to write an application that will allow a user to initiate a long-running process ( 5-30 seconds). After this, the user should allow the production of the process to be checked as it has been prepared. Output will be required only for the user's current session so that no longer need to be stored for a long time. There are two questions about how this can be accomplished when availing the benefits of the Pylons framework: What is the best way to start the background process, such as a pilot controller with? What is the best way to get back the output of the background process? (Do I need to store output in sessions, data, etc. in the database?) Edit: The problem is whether I have an order Launching a controller waiting for sub-publication to end before continuing, using the subprocess in an administrator, which shows the blank page to the user who loads until the process is completed Used to be. I want to be able to redirect the user to a status p...

ruby - What are the benefits of using the Rails gem instead od vendor/rails? -

I recently started working on a small private project on tracks on Ruby, and participated in some such things It can be appreciated if anyone has enough information to help me find a definite answer to what I could not do. All my questions are given below: Instead of using the gems of the rail, what is the profit in the seller / rail? Is there any benefit to using Rail 2.3.2? Which plugins I expected to use, some of them are not compatible with 2.3.2 (ActiveSpold)? Does it offer great improvement over 2.2? What is the benefit of using Ruby 1.9? Many plugins are not yet compatible. Does it offer a great improvement over the older versions? Thanks for any help, you guys may be able to offer. The seller / train probably makes your project more portable Deployment: Types of things can work to install, especially if you upgrade "Framework Gems" (you have to manually do this). The downside to the seller / rail is that your deployment is a bit bigger (more fil...

c++ - Sockets - send and receive -

I am currently writing a chat server in C ++ when a user joins it, then I open a socket And I make one to send two more data, to get another data. Now my question: I have to check that what is the second thread is currently using the socket, or what / recv function will wait until the socket is ready? is sending and getting it together from the TCP socket should be perfectly fine. (Except for any possible OS bug)

c++ - Tracing memory corruption on a production linux server -

दोस्तों, क्या आप मेमोरी भ्रष्टाचार को सी ++ के साथ निर्मित उत्पादन मल्टीथ्रेडेड सर्वर पर लिनक्स एक्स 86_64 ? मैं वर्तमान में निम्नलिखित समस्या का सामना कर रहा हूं: मेरे सफ़र सेगमेंट के दौरान कई घंटों तक मेरा सर्वर दुर्घटनाग्रस्त हो जाता है और मुख्य डंप से पता चलता है कि त्रुटि malloc / calloc में होती है जो कि निश्चित रूप से स्मृति को दूषित होने का एक संकेत है। असल में मैं पहले से ही बहुत कुछ किस्मत के बिना कुछ उपकरणों की कोशिश की है ये मेरा अनुभव अब तक है: वालग्रिंड एक महान (मैं भी सबसे अच्छा कहना चाहता हूं) उपकरण है, लेकिन यह सर्वर को बहुत धीमा बनाता है जिससे यह उत्पादन में अनुपयोगी हो। मैंने एक मंच सर्वर पर कोशिश की और यह वास्तव में मुझे कुछ स्मृति संबंधित मुद्दों को खोजने में मदद की, लेकिन उन्हें फिक्स करने के बाद भी मैं अब भी उत्पादन सर्वर पर क्रैश करता हूं मैंने अपने स्टेज सर्वर को वालग्रिंड के तहत कई घंटों तक भाग लिया लेकिन फिर भी कोई गंभीर त्रुटियों को नहीं खोजा जा सका। इलेक्ट्रिकफेंस को एक असली मेमोरी हॉग माना जाता है, लेकिन मैं इसे ठीक से काम नहीं कर सका। यह याद...

php - How to build recursive function to list all combinations of a multi-level array? -

I have an array that contains elements of any number in each element including an ID and an array called "Options" (With any number of elements). Array (3, 5)), array ('id' ===================================== ================ (2, 4, 8, 9)), array ('id' => 20, 'options' => array (2, 6, 7)), // ... any number of elements); I want to create another array on the basis of this one. Each key ID field is an 'option' array value, and the value is an array of the next element, and then the next, and so on. Basically I should give each combination of the arrays (like a tree) given above, in order that the array was defined: $ new = array ('10 -3 '= & Gt; array ('15 -2' => array ('20 -2 ', '20 -6', '20 -7 '), '15 -4' => array ('20 -2 ', '20 -6', '20 -7 '), '15 -8' = & gt; array ('20 -2 ', '20 -6', '20 -7 '), '15 - 9 ...

c++ - Trying to make a void function edit a 2D array! -

OK, this is a newbie question, and I understand that the function parameters I have given for the function are probably bad By the way, but what I'm trying to do here: I got a CHAR_INFO (buffer) of an 80x25 2D array that will be recursive of the infinite loop on the console screen. Because the buffer will be constantly changing (like a ninja game), I want to change the array to each loop. I can easily integrate the loop in the main function, but for learning and organization, I wanted to divide it into my own function WriteBuffer (); I'm looking everywhere how I can pass the 2D CHAR_INFO array in the context in context so that I can edit it, but nothing is working. Please do not tell me to use vectors or anything, I I want to work with whatever I have found here. #defineWIN32_LEAN_AND_MEAN #include & lt; Windows.h & gt; # Include & lt; Stdlib.h & gt; #define SCREEN_WIDTH 80 # sparse_heightet25 std using the namespace; Blank WriteBuffer (CHAR_INFO ** b...