Sunday 15 March 2015

perl - How does an object access the symbol table for the current package? -


How can I use the symbol table for the current package? For example, I have something like this:

  My $ object = MyModule-> new; # It appears in the current package, to see if Run_me is a function of the name, in I #, I would like to know that a sub-reference is $ object-> Do_your_job;   

If I use the __ package __ in the implementation of do_your_job , then in the MyModule package Will search How can I see it in the right package?

EDIT: I will try to clarify it. Let's say I have the following code:

  package MyMod; Sub new {return blessing}, $ _ [0]} sub do_your_job {my $ self = shift; # Of course find_package_of is fictitious here # Just for this example, $ pkg should be my $ pkg = find_package_of ($ self); If (defined & amp; amp; amp; {pkg. ':: run_me'}) {# function is present, it is called}} package main; The sub-run_me {print "X" should run me. \ N "; } My $ x = MyMod- & gt; new; # Run_me should meet in this current package and open it. $ X- & gt; Do_your_job;  

Now, $ x should be anyhow to note that the main is the current package, and its symbol table search I Scalar :: Util , but it still gave me MyModule instead of main . Hopefully, it's just a bit obvious now.

you just want

caller Tells the package from which it was called. (Here I added some standard pearl.)

  Use symbol qw & lt; Qualify_to_ref> # ... my $ pkg = caller; My $ symb = qualify_to_ref ('run_me', $ pkg); My $ run_me = * {$ symb} {CODE}; $ Run_me- & gt; () If set to $ run_me;  

To see it and see if it is defined and to call it, it will be duplicated because the standard Pearl does not do normal subxpress emissions, so that you 1) again This can be achieved, and 2) check the definition of the slot, and 3) Run it if it is defined.

Now if you make an object in a package and use it in another, then it is not going to be of great help. You need to add additional code such as 'owning_package' in the constructor.

Package MyMod; # ... sub new {# ... $ self- & gt; {Owning_package} = caller || 'Main'; # ...}

Now $ x-> In {owning_package} , there will be

main '.


ruby on rails - which authentication method is best for a client app having to interact with a web application that has authentication? -


Just wondering what people would suggest for an approach to a WinForms client that my web application (Rails on Rails, Which will use AuthLogic for authentication).

For an example option: * Authentication becomes a token for every HTTP request, * session, unless it is excluded from other time?

It can be considered as the normal client for the web, I think the application type question, i.e. using standard HTTP / HTTPS etc. web application

Thanks

I found you boy .. !!!

Voice:


osx - Sending mail from a Bash shell script -


I am writing a shell script for Mac which opens an automaker application and sends an email notification that sends an email from default mail The Account Automatator app in Mail.app also adds a text file that is written to the script.

  • Problems with this solution

    1. This is visible in the GUI when sending
    2. This stole the focus if mail is not the current application
    3. It should be dependent on establishing mail account in future.

    I suspect these shortcomings may come around, send me an email, enter settings, send Address etc. I would like to deploy this script on many computers (10.5 and 10.6) without having to be enabled on the computer, it is possible to do this script, so it will install the 10.5 Base Mac and Open and Open X. And 10.6?

    Update: I have received the -bs option for Sendmail, which I think is what I want, but I am at the loss of specifying settings

    In addition, to clarify, the reason I want to specify the SMTP setting is that the mail sent from the local host on the post 25 through the postfix, most will be blocked by the corporate firewall but if I use the server and a specified alternative I think the problem will not run in

  • since the Mac. & Nbsp; OS & nbsp; X python is included, but considering using a Python script instead of the bash script. I have not tested the part of the send, but it follows.

    Python Script

      #SettingsSMTP_SERVER = 'mail.myisp.com' SMTP_PORT = 25 SMTP_USERNAME = 'myusername' SMTP_PASSWORD = '$ uper $ ecret' SMTP_FROM = 'sender @ Example.com 'SMTP_TO =' recipient@example.com 'TEXT_FILENAME =' /script/output/my_attachment.txt 'Message = "" This is the message to be sent to the customer. "" # "Import the message now Smtplib, create email from email import encoder, import OS message = email.MIMEMultipart.MIMEMultipart () body = email.MIMEText.MIMEText (message) attachment = email.MIMEBase.MIMEBase ('text', 'plain') attachment.set_payload (open (TEXT_FILENAME) .read ()) attachment.add_header ('content-configuration', 'attachment', file name = os.path.basename ( TEXT_FILENAME)) encoders.encode_base64 (attachment) msg.attach (body) msg.attach (attachment) msg.add_header (, 'sender' SMTP_FROM) msg.add_header ('to', SMTP_TO) # Now message mailer = smtplib. Send SMTP (SMTP_SERVER, SMTP_PORT) # Edit: mailer is already connected # mailer.connect () mailer.login (SMTP_USERNAME, SMTP_PASSWORD) mailer.sendmail (SMTP_FROM, [SMTP_TO], msg.as_string ()) mailer.close ( )  

    I hope it helps.


    svn - Deploying a Website from Subversion -


    I'm new to subversion and thinking how do you move from development to platform to build?

    I think I understand the concept of creating branches created for release but how do I actually deploy the branch?

    Ideally, I can only install a new website and copy files from the branches, but I am concerned about copying any SVN binding to the output.

    If this is appropriate, then it is a Visual Studio website project and I am using VisualSVN server, Tortoise SNN and eye to integrate with Visual Studio.

    svn export

    except for all replaceable cruft Exporting Files


    winforms - Drag and Drop between 2 list boxes -


    The list is trying to drag and drop between boxes and I have seen so far all the examples really smell good

    Can anyone tell me or show me a good implementation?

    Did you see?


    Determine existence of results in jet SQL? -


    In jets, I want to test that some conditions be returned to any result.

    I want a query that gives a record exactly: "correct" if there are any results, then "wrong" otherwise.

    This works in MS SQL:

      Select when in the current state (SELECT * FROM) Foo WHERE & lt; Some status & gt;) THEN 1 ELSE 0 END;  

    This is what I tried to do in Jet:

      SELECT IIF (EXISTS (SELECT * FROM Foo WHERE & lt; some condition & gt; ), 0, 1);  

    Gives me an error:

      Reserved Error (-3025); There is no message for this error  

    Any ideas?

    Note I do not want to select "true" several times by attacking an FROM block at the end, because it can be slow (if there were many records in the FM table) Or undefined (if the table had 0 records).

    build automation - How to setup a DotNetNuke Development Environment with Source Control? -


    My team is developing a new DotNetNuke web application and would like to know that the development environment with source control setup What is recommended and automated to do? We want to keep separate DNN source code from our custom modules and extensions source code.

    The DotNetNuke compiled module template for Visual Studio wants us to store the source code in the desktop module directory of the DN source code and output it to the DNN source code bin directory. Is this the recommended structure? I want to put files in different places, but then it is more difficult to run locally and debug because each change requires modules to be installed. Also, how to organize any change should be an automated build?

    How have others installed it? Is there any recommended best practice?

    We usually call the module code in the desktop module and the website's Build in the bin directory.

    In the source control, we map the individual modules instead of the entire website. Depending on what we are working on, a module can be a complete project in source control, or we may have multiple related modules in the same project, living next to each other.

    Arranging changes automatically is somewhat difficult in DNN It is highly recommended that there is a build script that package your module in an installable form. You can copy the reinstallable package into the website's install / module folder, and you can get the URL /Install/Install.aspx?mode=InstallResources , Which will install any package in it folder.


    asp.net - Get details of object from database - keep ID secure -


    I have a list of books from the database. When a user selects the book, I want to get the information for that book and display it on the screen. However, I would like to keep a hidden book ID from the customer-side, so what would be the best way to move the ID of the book selected? I think my brain has melted, so I'm probably looking somewhat clear. Sessions do not seem to be the only way to transfer information, but I'm not sure how to implement any system, where an item is selected (whatever the control type is most appropriate), and the item's ID to someone The server is retrieved and recovered related information. (ASP.NET + Using SQL Server) Thanks for any advice

    Do you really want to Want to hide the database ID, as in a scenario where the user has some alternative uses for the database and you want him to find the book in a difficult way?

    Usually the requirement is not to keep a secret, but to prevent users from recognizing IDs (for example to apply one of the few funnels to navigating an item) Or for sharing an ID with other users, for example, a URL is correct for http://example.com/books/0867316672289 , where 0867316672289 is the same visitor to same Will present the book, but the value of the user Sapas can not hit, so 0867316672288 or 0867316672290 404 rupees will land it may be necessary that another a 404 to registered users 0867316672289.

    The id really adds a very low value to the scheme described above by keeping 'secret' (i.e. storing it in session and keeping track of session status 'current book') and only makes things complicated

    A solution is to encrypt the ID using a site secret key. You get a 16-bytes encrypted block (like AES block size is used) by an int ID, which can be returned to the original ID later on the incoming site. Due to the huge size of the solution space (16 bytes), visitors can not guess other IDs. If you want to make pseudor-aids sticky for a user, then you can make the encryption key user unique (such as received by the user ID) or add additional information in the proxy ID (for example also encrypt the user id and check This in your request handler).


    concurrency - NHibernate not throwing StaleObjectStateException when <Version> used and data changed in database -


    I have been mapped to NHibernate with optimistic concurrency control using an NIT timestamp column as the version number Mapping is like the following:

      & lt; Class name = "entity" optimist-lock = "version" discriminator-value = "0" & ​​gt; & Lt; Id name = "id" & gt; & Lt; Generator class = "parent" /> & Lt; / Id & gt; & Lt; Version name = "version" column = "version" generated = "always" not saved-value = "blank" type = "system.bit [], mscorlib, version = 2.0.0.0, culture = neutral, public token = b77a5c561934e089 "/> ... & lt; Subclass name = "ChildEntity" discriminator-value = "1" /> & Lt; / Square & gt;  

    I test what happens when the data in the database is between the data in the row and between the records. To do this, I am running an update statement with a record directly in the table that is in the process of being updated by NHibernate, it directly changes the version number of the records in the update table.

    Expected, the NHibernate managed update does not happen on the specific line (this is good), however, no exception is entered during the commitment. I expect a StaleObjectStateException when the transaction was done so that I can roll back the transaction and inform the user. Is not this expected behavior? Am I missing something?

    My code looks like this:

      _session.BeginTransaction (); ... Load Objects in the Season: IList & lt; ChildEntity & gt; ToChange = _session.Find ('some status'); Forex Currency (Change Separate Items for Change) {itemToChange.Status = Status.Updated; } ... _session.Transaction.Commit ();  

    Items are related to the same session and all tasks are completed within one transaction. Child Entrepreneurship unit is a subclass of base class, in which optimistic lock is set on version.

    How are you modifying data? StaleObjectException is thrown only when the NHibernate attempts to update the line and the version number is no longer the other column is irrelevant. Is it possible that you are not updating version number in your test?

    This is the basis:

    A User A & amp; Get the object from the database with B version = 1

    SQL: SELECT [object] from [table] where id = [id] and version = 1

    < P> B user A update object which varies in version 2

    SQL: UPDATE [TABLE] SET [Object] (& version = 2) where id = [id] and version = 1 1 line updated

    C User attempts to update B object, but StaleObjectException is updated with version = 1 Receives as CTO (version Updates 0 record receives the first phase) database.

    SQL: UPDATE [TABLE] SET [object] where id = [id] and version = 1 returns 0 rows and stell object findings removed.


    printing - Python print buffering -


    Let me know your last question again. I just created Python as script language while using Python in ArcGIS. Equipment subprocess. Runs an external program (runs) using Pappen. When I run the tool from ArcGSIS, a window appears that only runs the following

     . RunFLOW C: \ Flow C: \ Flow \ FLW.bat Start Time: Mon Nov 30, 16 50:37 am 200 9 script running Rnflo ... full script RuFLOW ... execute (Rnflo) successful completion time: Mon 30 Nov 16:50:48 2009 (time has passed: 11.00 seconds)  

    script Import follows

      # Import system modules # 1 :: input Vertical prj_fld = gp.GetParameterAsText (0) Flow_bat = gp.GetParameterAsText (1) OS sys, string, OS, Arcgisscripting, Upprkriya # Geoprocessor object GP = arcgisscripting.create () # W Create Read Ramitr value. chdir (prj_fld) p = subprocess.Popen (Flow_bat, shell = True, stdout = subprocess.PIPE) stdout_value = p.communicate () [0] print '\ tstdout:', wrapper (stdout_value)  

    When I run the same program from the command window, it prints the screen-filled information (date, number of iterations etc.). I want to see all the information in the window which appears after the model is run from Orgis, besides what is being printed in it. I tried to print, communicate, flush, but could not be able to do this. Any suggestion

    When I run the script as it is now, it runs executable, but as

      error 999,998 it returns an error like this :? Any more files here  

    Thank you

    I do not know anything about ArcGIS, So I may be shooting here in the dark, but ... If you want a stdout, then you usually do not want the dialog () method to make you something like this:

      P = subprocess.Popen (Flow_bat, shell = true, stdout = subprocess.PIPE) stdout_value = p.stdout.read ()  

    with a process < em> Interacting to communications () method is used for documentation:

     < Code> interact with the process: send the data to stdin. Read the data from Stdout and stderr until it reaches the end of the file. Wait for the process to finish  

    I think that when ArcGIS runs your script that stdin is not connected and causes the script to be excluded for some reason Is formed.


    security - Does using non-SQL databases obviate the need for guarding against "SQL injection"? -


    This may sound like a clear (or not so obvious) question, but let me explain how Google's database technology, I'm coding a Google App Engine site using BigTable. Any app engine coders will know that Google has its own limited query language that is called GQL. As a result, I do not want to do any investigation for the SQL (or GQL) injection in my app because I believe that Google is not using a raw string query on its backend methods to get the data.

    In addition to this, libraries seem to end the need to see if there is a malicious user database manipulation command injection, for DB technologies such as CouchDB, Mangaodi, and other objects or documents (aka NoCQL) Whether or not it is doing They often have libraries that map the objects directly to the objects in their preferred language. I know that there are several SQL libraries which do it properly, but I think that at some level they are adding parameters to run a query on a string, and thus I still have to use SQL along with those frameworks Injection protection should be used.

    Am I short-sighted? Or is it just a matter of time until the next great DB system is captured and then I see the injection in those systems?

    "injection" holes text reference is to do with mismatch every time you make a string of text strings In another reference, you have to encode to fit the changing reference. Strangely strings, together with a clear eye-blindness, seem simple, but the difficulty of string processing is confusing.

    Due to purely object-based interfaces, the database is immunized with injection vulnerabilities, such as parameterized queries are in SQL

    but none of them has GQ in particular. This is a string query language, and if you add untrusted unloaded content to a query like "WHERE title = '% s'"% title ", then you are just as weak as you would like full- On SQL It may be that limited capabilities of GVL have made it more difficult to take advantage of the application to fully compromise, but it is certainly not impossible at all, and in the best case your application is still wrong and When people will attempt to use apostrophes legally. / P>

    There is a parameter binding interface in GQ. I use it. Resist the attraction of string hacking.


    iphone - objectForKey stringValue crashing my app? -


    I have a class that I use to set up an object in the array. In this class I have a custom "initWithDictionary", where I parse a JSON dictionary However, as I am running in NSNull To get around it, I set up a class that handles exceptions, so when a string is NSNull , it should be sent to @ "" Is replaced by Or for -1 integers

    This is my NullExtensions class:

      @interface NSNull (valueExtensions) - (int) intValue; - (NSString *) stringValue; @end @implementation NSNull (Value Extension) - (Int) Interview {Return -1; } - (NSString *) stringValue {return @ ""; } @end  

    However, in my initWithDictionary method, the following code crashes my app:

      self.bookTitle = [[parsedDictionary objectForKey: @ "Book_top"] string value];  

    Perceived dictionary does not work with NSNull or a valid string regardless of the object only if I do the following (and the string is not empty):

      self.bookTitle = [parsedDictionary objectForKey: @ "book_title"];  

    Is stringValue wrong in this case? And if so, how do I use it correctly for setting up the correct NSNull replacement? Instead of creating categories on

    Thx

    NSNull , For which you also need to add the same category to NSString (This is the reason that accidents do not respond to string strings because the actual strings) - instead of a support category on NSDictionary Try making use of " stringForKey " code uses Johan and a NSString , maybe all other types as empty string Chci way should be mapped.


    xml - How can I make my Java Servlet class handle SAXException's? -


    When I compile my Java sublett code, I get the following error ...

      javax.servlet.http.HttpServlet; Overridden method does not throw org.xml.sax.SAXException  

    In my overridden doGet () function, I am using JAXP to process XML, which apparently I need to handle SAXExceptions. But when I tax "SAXExeption" in the list of exception types, I want to work to handle my doGet, I get the above error.

    You can not declare an overriding method, which throws the checked exceptions, which does not throw the method override has gone. In other words, HttpServlet.doGet () has been declared as throwing IOException and ServletException, so you can not use any exception type in your doGet method's Forage Clause.

    However, you can wrap SAXException as a servicelet to get around it:

      Secure zero code (HTTPPrilateral request) HTPserve Response Response Servicelet Specification {JxP.PolicyHARASXExation ()); } Grip (SAXException E) {New Service Exception ("Parsing Failure near JNSP", e); }}  

    eclipse - How to Write Ant Scripts? -


    Can anyone tell me how to write ant script (if I want to create my own) means any tutorial is available ?

    Eclipse / Netbeans provide ant scripts automatically but it is possible to edit and customize them as per the requirement? If so, how to do it and how to optimize the workspace provided by the IDE.

    EDIT: Is there any good book available for ANT? Please suggest.

    Thanks

    Some signals:

    • Window> Preferences> Server - Configure Target Server Runtime
    • Right-click Project> Properties> Java Build Path - Adding You Additional Jar and Library
    • Show Window> View> Server - Server Opens the panel, Alpele has acquired the Web Development Platform (WTP) plugin, where you can start / stop a server and deploy it. Can manage the applications.

    emacs - Setting different c-basic-offs for different projects -


    I usually use 4 white spaces in indented C programs, but to keep things in line with open source projects , I have

      (setq c-basic-offset 4)  

    Currently assigned my indenting style to my .emac file

    And when I want to work on those 2-white-space indenting projects, I have to close my MX, value the number Must be Odit and resume. Is there any easy way to do this?

    Many thanks.


    PS Setting C-Basic Offset Variables Whenever I open a source file, it's a lot of work, is it possible to choose different values ​​depending on the working directory?

    Create a file in that directory that you want to designate .dir-localals.el , and to edit it:

      ((C-basic-offset.4))  

    Note: This is a new functionality in Emacs 23.1.

    This brings benefit from the documentation in the link:

    .dir- Localals.el should contain a list made specifically in the file. Goodbye to AMAX mode name (symbols) in this list; Each elite variable Specifies the value for the balls when the respective mode is turned on. The special mode name 'nil' means that its goodbye applies to any mode. Instead of a mode name, you can specify a string that is used for the project The subdirectory of the directory is a name; then this follow up applies to all the files in that subdirectory.

    Here is an example of a .dir-localals.el file:

      (void) ((Indent-T Ibs-mode.T. (tab-width 4) (Phil column 80)) (C-mode. ((C-file-style "BSD").) (Java-mode. ("C / file-style." BSD "))) (" src / imported ". ((Zero. (Change-log-default -name. "ChangeLog.local")))))))  

    .net - partial argument match in rhino mocks -


    In my unit test instead of IgnoreArguments, I want to use some partial matches of logic in Rhino's tests. How to do this?

    Thanks, John

      // set fooStub = MockRepository .GenerateStub & lt; IFoo & gt; (); // act fooStub.Bar ("arg1", "arg2", 3); // assert fooStub.AssertWasCalled (x = & gt; x.Bar (Arg & lt; string & gt; .Is.Equal ("arg1"), Arg & lt; string & gt; .Is.Anything, Arg & lt ; Int> .Is.Equal (3)));  

    tdd - junit - share a fixture between testcase -


    I wonder if there can be a stability that can be shared between tests, for example a hibernate session .

    Do you want all your tests (not testcases) to share your hibernate session?

    Create it in your setup () method, only if it is not already created, and it has been stored in a stable member of its testcases class as a singleton implementation.


    emacs - function to call same shell command in dired -


    I would like to be able to call the same shell command on files that were left without the need of eMACC command input As the input will always be the same. Specifically, the command is "open" (for Mac OS X).

    I tried to tire-tired-do-shell-command function- in dux-aux.el but at the end of the interactive day.

    I want to be able to force this function to tire-mode so that I do not need the Mac OS X Finder to navigate files and navigate files. open them. This will allow me to fully move into emacs.

    Thank you.

     (defun direct-open (interactive) (Dior-do-async-shell-command " Open "OpenOffice-RG (Tire-Out-Mark-File-FilesTri-Prefix -RGR)) - 

    Edit:

    We safeguard existing window configurations To be able to use the save-window-excursion -map (KBD "co") via the output buffer's mess:

     (defun dired-open () (interactive) (Save-window-tour (dired-do-async-shell-command "open" current-prefix-arg (tired-min Cadence-marked-files present-prefix-RGR))) 

    ruby - How do I enable SASS line numbers in CSS output? -


    How do I enable line numbers in CSS output if I am using SASS? I have received an article but I do not understand where to do the amendments

    Can you help me?

    If you set it to true then the name of : line_comments The option is, the sauce will place the line numbers in your compiled output.

    How to set this option depends on how you are using Sass if it is in Rail, Merb, or Rack app, then you Sass :: Plugin.options [: Line_comments] = true .

    If you are using Compass, then set line_ size = false in your configuration file.


    PHP - Drop down list to display .txt contents -


    I have a form in which the song is a drop down list of titles, I am able to click on the title of a single song I want to be and the song has to be loaded on the same page. Songs in .txt files are included in a folder called "songs".

    Example:

    included in the drop down list: Song 1 Song 2 Song 3 and so on.

    When the user clicks on the song, appears on the same page content corresponding .txt file. any idea?

      & lt ;? PHP $ Song = Intwal ($ _get [ 'Sang_id']); $ Songs = array (0 = & gt; NULL, 1 = & gt; song1 ', 2 = & gt;' Song2 ', 3 = & gt;' Song 3 '); Echo file_get_contents ($ Lyrics [$ song]. '.txt'); ? & Gt;  

    Good luck!


    exception - Delphi 6 stack trace -


    संभव डुप्लिकेट:

    क्या किसी को पता है कि डेल्फी 6 में एक अपवाद बढ़ने पर स्ट्रिंग में एक अच्छा अनुकूल स्टैक ट्रेस कैसे प्राप्त किया जाए?

    अपवाद लॉग में स्टैक ट्रेस शामिल कर सकते हैं। आप पागल (नि: शुल्क गैर वाणिज्यिक लाइसेंस हैं) को छोड़कर कोशिश कर सकते हैं।


    firefox - Clear cache with greasemonkey -


    I have a web application running in a kiosk, which is set with gyasinby so that we can Customizing many things and ensuring that the customizations are only on kiosks I'm digging through the GM API, hopefully there will be some functionality to affect the browser settings, but alas Looks like it affects only pages that run in the browser. Is there a way that the browser should ask the browser to clear this cache when there is a certain event in the application?

    "post-text" itemprop = "text">

    Ordinary JavaScript is not allowed to do this, it will apparently have a security hole.

    GM javascript does not have sufficient privileges. The Firefox extension works with high privileges, which is why the add-on can clear the cache.

    Some options:

    1. If you start with your own Firefox extension, that's probably some kind of incidents and / Or clear the cache on the timer.

    2. Javascript can reload the page, and specify that the cache can not be used: window.location.reload (true) .

    3. You can set up a cron job or Windows scheduled tasks , to kill the Firefox task, run something similar once per day, Then restart Firefox

      This is probably a good idea, like Firefox gets dip and hog memory, if the left has to walk too much like this, you can restart the entire computer and on each restart Can consider cleaning.


    How can I get all files in a directory, but not in subdirectories, in Perl? -


    I get all the files that match a certain criterion ( -M , the age of modification) How can I get it? Days) in a list of directories, but not in their subdirectory?

    I wanted to use File :: Search, but it seems that it always goes to the subdirectory.

      @files = grep {-f & amp; Amp; (-M) & lt; 5} & lt; $ _ / * & Gt; @for folders;  

    Spring Web Flow form binding -


    I have a Java web app running in the spring web flow frame and hibernate as ORM. I would like to ask what is the best practice in complying with form values. Do I represent each form or bean so that I have an object where I can bind form? I can try to get value in the URL as a parameter, but I do not think this is a good way.

    What I was trying to do is use that flow flow from xml and use them as the parameters in the calling function.

      & lt; View-state id = "editform" model = "registerbiz" visible = "../xhtml / framework / edit" & gt; & Lt; = "Dummy" on "editButton" & gt; Infection; & Lt; Set name = "flowScope.newPassword" value = "requestParameters.newPassword" /> & Lt; Set name = "flowScope.confirmPassword" value = "requestParameters.confirm password" /> & Lt; / Transit & gt; & Lt; = "Delete Employees" from "Delete" /> Changes on; & Lt; = "Successful" to "back" on "login" = "successful" /> & Lt; / Visual state & gt;  

    I print $ {newPassword} in the XHTML file but no output was found. So I was thinking of representing an object to form the form and binding values ​​and accessing my flow in XML.

    & lt; directly with your domain (hibernate) object Form: bind & gt; to use, if you do not need additional objects just for the sake of populating with data, if you have a domain object per screen, then you have the SimpleFormController of spring

    .

    collections - Why does my class not work properly in a Java HashSet? -


    I am working on a project that involves using a class of HashSet That's what I'll name the test . I have defined the declaration like HashSet :

      hashaseet & lt; Test & gt; T = new hashset & lt; Test & gt; (); T.add (new test ("asdf", 1)); T.add (new test ("Hello", 2)); T.add (new test ("Hello", 3));  

    I tried to use

      t.contains (new test ("asdf", 1));  

    But it returns false However, when I type HashSet < Character & gt; then it works fine I tried to override the previous equal declaration, but it does not work, I try to leave equal alone But I still got the false I want to know what I am doing wrong?

    Also, I have not edited the hash function, I only test. Axel (object o) has changed. This is a simple project and the Java documentation says that it uses o.equals (this), I thought I would not have to do this.

    You may also need to load the hash code () method.


    Prototyping Object in Javascript breaks jQuery? -


    I have added a simple .js file to my page in which some very common worldly The task is added in the object and array prototype.

    Through trial and error, I have thought that Object.prototype does not matter, or it causes javascript errors in jQuery:

    The culprit?

      Object.prototype.foo = function () {/ * nothing and break jQuery};  

    I am getting the line 1056 of jquery-1.3.2.js , in the entry: function {} declaration:

      / * Object does not support this property or method * / name = name.replace (/ - ([az]) / ig, function (all, characters) {return letter.toUpperCase ();});  

    Apparently live. Blank is undefined.

    Although it is clear that there is something that I am not wrapping my head with prototype, I have failed to understand what it is.

    To be clear, I am not looking for an alternative solution, I have handled it ... What I see is Why? . Why does the object.prototype add functions to break this code code?

    You should never expand Object.prototype Is more than; Do not do this, it completely breaks the Javascript's "object-to-hashtables" feature.

    You can ask John Raisig, and he'll tell you.


    c# - ASP .NET - Format datevalue in GridView that pulls from MySQL table? -


    MySQL डाटाबेस के पास इस प्रारूप में एक दिनांक फ़ील्ड है:

    yyyy-mm-dd (2009-12-01)

    जब इस फ़ील्ड को ग्रिडविव में खींचा जाता है तो स्वरूप में परिवर्तन होता है:

    yyyy-mm-dd एचएच: मिमी ( 2009-12-01 12:00)

    मैं ग्रिडव्यू कैसे प्राप्त करूं, डिफ़ॉल्ट डेटाबेस स्वरूप को परिवर्तित न करें?

    (सबसे समाधान जो मैंने पाया है कि सेटिंग सेट करना एएसपी: बाउंडफील्ड में मान लेकिन इसके लिए संभावित खतरनाक HtmlEncode = false) की आवश्यकता होती है

    मुझे नहीं लगता कि यह दिनांक / समय क्षेत्र पर HtmlEncode = false सेट करने के लिए जोखिम भरा होगा। यह संभावना नहीं है कि किसी भी एसक्यूएल इंजेक्शन का हमला संभवतया हानिकारक स्क्रिप्ट को डीटैप वैल्यू में लगा सकता है।

    ऐसा लगता है कि आपको जो समाधान मिल चुके हैं वह शायद डेटाफॉर्मटस्ट्रिंग को सेट करने और एचटीएमएलएएनडोड = फाइल सेट करने के लिए है। मैं उन समाधानों में से एक के साथ जाना होगा जो आपने पहले से ही प्राप्त किए हैं।

    या जैसा यहां पाया गया है:


    email - reading mails using python -


    How can I use Python from my mailbox ??

      import getpass, Imaplib M = imaplib.IMAP4 ('IMAP4.gmail.com:993') mlogin (getpass.getuser (), getpass.getpass ()) m. Selection () type, data = m. [0] .split (): for the zero in the search (none, 'ALL') data type, data = M.fetch (num, '(RFC822)') print message '% s \ n% s \ n' % (Num, data [0] [1]) m. Close (M) Logout ()  

    This is my code. But when I execute its throwing error:

      traceback (most recent call final): The file "e: / jagdish / python progs / readmail.py", line 2, & lt; Module & gt; M = imaplib.IMAP4 ('IMAP4.gmail.com:993') file "C: \ Python25 \ lib \ imaplib.py", line 163, __init__ in self.open (host, port) file "C: \ Python25 \ Lib \ imaplib.py ", line 230, in open self.sock.connect (" host, port ") file" string "; line1, in connect gear: (11001, 'Getaddrinfo failed')  

    Can anyone help me with this ???

    Three issues:

    1. Hostname imap.gmail imap4.gmail.com
    2. IMAP4 creator takes two parameters: host and port (not separate from colon)
    3. Gmail expects you to talk to the SSL

    like this:

      import imaplib m = imaplib.IMAP4_SSL ("imap.gmail.com", 993 )  

    winforms - Saving (Rich)TextBox's to memory and switching them off with a richtextbox in my form in C# -


    My goal is a main richxbox in this form, and then there are many different rich textbox back-end, backwound text The box is added, deleted, and edited behind the scans all the time ... and I need to swap my richtextbox to form in the backdated with the rich box. Did I originally have a dictionary

      dictionary & lt; String, Rich Textbox & gt; RichTextBoxs = New Dictionary & lt; String, Rich Textbox & gt; ();  

    And just go to

      string data = "string"; Rich Textbox Box = New Rich Textbox (); Box. Text = "for session" "+ data +" \ "start!"; Box. Tag = (string) data; RichTextBoxs.Add (data, box);  

    and saves it fine, but the moment I try to do something like

      richTextBox1 = rich textbox [[string data]];  

    Nothing happens! I can copy attributes like

      richTextBox1.Text = RichTextBoxs [[string data]]. Text;  

    Works fine, but I need to copy all the properties with all the advanced color formatting of the text box. I do not know why this is not working, because As far as I know it should be!

    Summary: I need to swap text box with text text

    ~ Code appreciated! And thanks in advance!

    To solve your problem, you just do not have Rtf property, not text property:

      richTextBox1.Rtf = rich textbox [[string] data] .rtf;  

    But I agree with David Hegge that you should directly deposit the RTF string directly into the dictionary, not in other hidden rich text boxes.


    utf 8 - Batch UTF-8 Validation Tool? -


    Is any app / service / method known to validate a group of XML files for UTF-8 Can I use it for?

    Actually I have an XML file that can be UTF-8 and some of them contain some fake characters, so they do not render correctly in the content viewer.

    I know that I can see one at a time with the methods found in this answer:

    ... but how do thousands of XML files at one time?

    Why can not you take one of the solutions with the linked question and apply them in your situation Can you? It seems that it will be easy to iterate over all those files you want to see, run iconv -f utf8 on them and emit a list of files where they fail.

    Update
    Since you have not specified a situation or environment under which you need to test this, it is difficult to provide solid advice. Methods of testing what you want, have been offered, so it is a matter of knowing that what you have available to implement the solution.

    Considering a basic * nivial envornment, this simple shell script provides basic checks, alerting specific filename globbing issues.

      #. / Bin / sh f * * .xml; If do Iconv -f utf8 $ f & gt; / Dev / null 2 ​​& gt; and 1; Then, when you provide more information about your specific needs, make $ FFE  

    , however, it is difficult to know whether any answer of the people is really relevant.


    osx - MySQL lost after upgrading to Snow Leopard -


    I soon made a mistake of transferring the leopard.

    I thought I have mysql files, but the last backup is about a month old.

    Now I have upgraded the Snow Leopard computer, and not trying to run the old MySQL server. So I have read that you have to re-install MySQL with a new version that I did and it was running properly and it started right away.

    However - it seems that this sets up a new installation, but since the older version can not be started

    I tried mysqldump but it was not connected.

    Any ideas will be great!

    Have you tried PHPMyAdmin to try and export with the database?


    datetime - Why is parsing "%Y-%m" using strptime in R giving an NA result, but "%Y-%m-%d" works? -


    इस सवाल का पहले से ही एक उत्तर है: < / P>

    • 8 जवाब

    मुझे एक परिणाम मिल रहा है मैं आर में नहीं समझता हूं।

    यदि मैं एक वर्ष और दिन स्वरूपित% Y-% m (जैसे "2009-12") के साथ strptime का उपयोग करता हूं, तो मुझे एक एनए मिलता है परिणाम। लेकिन अगर मैं एक दिन जोड़ता हूं, जैसे "2009-12-01", और इसके अनुसार प्रारूप स्ट्रिंग बदलता हूं, मुझे परिणाम मिलता है। उदाहरण:

      & gt; स्ट्रिपटाइम ("2009-12", प्रारूप = "% Y-% m") [1] एनए & gt; स्ट्रिपटाइम ("2009-12-03", प्रारूप = "% Y-% m-% d") [1] "2009-12-03"  

    ऐसा क्यों है?

    अपडेट: मैं जिस चीज़ के बारे में उत्सुक हूँ वह है क्यों एक साल और एक महीने में स्ट्रेटटाइम का विश्लेषण नहीं होता है, और इसका कारण यह अजीब लगता है कि यह ऐसा नहीं करेगा क्योंकि यह करता है केवल एक वर्ष का विश्लेषण करता है, या एक वर्ष और एक दिन:

      & gt; स्ट्रिपटाइम ("200 9", प्रारूप = "% Y") # वर्ष केवल काम करता है। वर्तमान माह और दिन का उपयोग डिफ़ॉल्ट रूप से करता है [1] "2009-12-02" & gt; स्ट्रिपटाइम ("2009-03", प्रारूप = "% Y-% d") # वर्ष और दिन। काम करता है। वर्तमान माह को डिफ़ॉल्ट रूप से उपयोग करता है [1] "2009-12-03" & gt; स्ट्रिपटाइम ("2009-03", प्रारूप = "% Y-% m") # वर्ष और महीने। काम नहीं करता है ? [1] एनए  

    यह समझाने के लिए अद्यतन क्यों डुप्लिकेट नहीं है इस प्रश्न के बाद संभावित डुप्लिकेट को कुछ वर्षों से पूछा गया और यह एक अलग एपीआई में आर : asDate फ़ंक्शन। यह प्रश्न, rptime फ़ंक्शन के उद्धरण के बारे में है जो कि R 3.1.3 के रूप में भी लागू होता है।

    यह मेरे लिए समझदार व्यवहार जैसा लगता है जैसा कि मैंने इसे देखा, एक बेहतर सवाल होगा "यह आपको यह करने की अनुमति क्यों देता है: स्ट्रिपटाइम (" 2009-03 ", प्रारूप ="% Y-% d ") ?"

    मुझे लगता है कि आप क्या हासिल करने की कोशिश कर रहे हैं (एक निर्दिष्ट महीने और वर्ष के साथ एक पॉसिक्सलट ऑब्जेक्ट अर्थात्, लेकिन आज के दिन):

      as.POSIXlt (पेस्ट) ("2009-12", दिन (Sys.Date ()), sep = "-"))  

    How can I use Perl to record MP3 files on Windows? -


    Is there a Perl module for recording MP3 files specifically on Win32? If yes, then you can provide an example.

    You can use it to record in WAV format. You can use WAV for MP3 to encode.


    php - Zend Framework - Getting a helper from within a registered plugin -


    Is there a way to access a support group from within a registered plugin? From within the controller, anyone can use:

      $ this-> _helper-> GetHelper ($ helperName);  

    Specifically, before we do a redirect, we use Flash Messenger Assistant to pass error and information messages around different pages. In one of our plugins, we log out a user and set the index and controller on a separate page. We can manually set a value in the request, but it seems that what is used for FlashMessenger and for that we have to do it for this special case.

    You should use this to get a helper anywhere outside the controller. See similar questions:


    visual studio 2008 - Change right-click context menu options in VS2008 -


    When I right-click in my class library, I get some quick options, such as items from the popup list ( new item ... ), a user control, etc.

    New item ... is not required to click, then select it from there.

    Is there a way to do this in the configuration? I call it VS I can not understand.

    Tools -> Customize -> Check "Context Menu" -> Project and Solution Context Menu

    It should be one of those menus


    build - How can I best share Ant targets between projects? -


    Is there a well-established way of sharing goals between projects? I currently have a solution, but it is a little rude. Here's what I'm doing here.

    I have a network that is hosted on ivy-tasks.xml which is hosted on one server on our network. Other targets for managing project dependency in this file are included among boilerplate tasks. For example:

      & lt; Name of the project = "ant-iv-work" default = "init-ivy" xmlns: ivy = "antlib: org.apache.ivy.ant" & gt; ... & lt; Goal name = "Iv-download" until "skip.ivy.download" & gt; & Lt; Mkdir dir = "$ {ivy.jar.dir}" /> & Lt; Echo Message = "Establishing IV ..." /> & Lt; Get src = "http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest = "$ {Ivy.jar.file} "usetimestamp =" true "/> & Lt; / Target & gt; & Lt; Target name = "ivy-init" depend = "IV-download" description = "- & gt; defines iv functions and loads global settings" & gt; & Lt; Path id = "ivy.lib.path" & gt; & Lt; Fileset dir = "$ {ivy.jar.dir}" includes = "* .jar" /> & Lt; / Path & gt; & Lt; Taskdef resource = "org / apache / ivy / ant / antlib.xml" uri = "antibu: org.apache.ivy.ant" classpathref = "ivy.lib.path" /> & Lt; IV: Settings url = "http: //myserver/ivy/settings/ivysettings-user.xml" /> & Lt; / Target & gt; ... & lt; / Project & gt;  

    Due this file is hosted because I want no :

    • Check the file in each project It will be duplicated, which makes it difficult to maintain the goal.
    • My Build. Depending on the Xml source control a project is examined - this will make the build more XML at the top-level just to access the file.

    What do I do with this file in my projects' build.xmls:

      & lt; Property Name = "Download.dir" location = "Downloads" /> & Lt; Mkdir dir = "$ {download.dir}" /> & Lt; Echo message = "download import files at $ {download.dir}" /> & Lt; Get src = "http: //myserver/ivy/ivy-tasks.xml" dest = "$ {download.dir} /ivy-tasks.xml" usetimestamp = "true" /> & Lt; Import file = "$ {download.dir} /ivy-tasks.xml" />  

    The "dirty" part about this is that I have to do the above step out of a target , because it should be at the top level, besides me, still This XML must be included in all build.xml files for which it is needed (i.e. some duplication is still).

    Above that, there may be additional situations where I have general (non-Ivy) jobs that I want to import if I want to use these functions to depend on iv dependency management Problems are also coming, as long as I resolve the dependency, I had to be inside a target in my build.xml, and was unable to import

    " Text ">

    If you are using ANN 1.8+, you can import build.xml directly from the hosted location.

    Since ant 1.8.0 work can also import resources from URLs or classpath resources (in real terms) If you want to know whether the existing build file has a source file or a URL, then you can consult the property ant.file.type.projectname (using the same example above ant.file.type.builddocs), which That it has the value "file" or "url".

      & lt ;! - importing.xml - & gt; & Lt; Name of the project = "import" based = "." Default = "..." & gt; & Lt; Import file = "http: //myserver/ivy/ivy-tasks.xml" /> & Lt; / Project & gt;  

    RAILS - paperclip don't work with Ajax -


    I have an application which is working fine with form_ to upload an image using the paperclip.

    The problem is, because of the Javascript security model, this picture can not be uploaded through AJX.

    I should know: What is the best way, which actually works with Rail 2.3.x, to send a file via AXA via Rail? IFRAME technology? SWFUpload? Any other ideas?

    VP

    The way to go for iframe technology is to upload the AJAX file There is currently anything implemented in this way and I have followed the tutorial from this page:

    In the tutorial, he uses attachment_fu but this code works well with paperclip.

    Hope it helps,

    Caleb


    sqlite - Python 3: Best string compression method to minimize the size of a sqlite3 db -


    I recently created a script that parses multiple web proxy logs into a clean sqlite3 db file, for me Is working very well ... the size of the file with a hassle is pressed to use this format (a sqlite3 db) and the dragon handles it natively as a winner, so my question is this .. What string is the best way to compression, which I used to do Can new use when the file size zlib only concern? Base-n? Klingon?

    Any advice will help me load, then string compression for characters compliant for the URL.

    There is a SQLite extension to provide compression here.

    This extension provides a function that can be called on the individual field.

    Here is some example page from text

    Make a test table

    sqlite> table test (name varchar (20), surname varchar ( 20));

    Insert some text into the test table in the test table, you can also insert binary material and put it in the Blob field

    sqlite> Insert test values ​​(mycompress ('This is a sample text'), mycompress ('this is a sample text'));

    It does not show anything because our data is in binary format and select Compressed

    sqlite> from Test *;

    The following works, it dissolves the data

    sqlite> from the test select myuncompress (name), myuncompress (surname);


    c# - Best way to fade in/out image -


    What is the best (least resource heavy) way of removing the image in every 20 seconds with the duration of 1 second

    (About an image of about 350x130px) For a simple screensaver I need this which is going to run on some low level computers (Xp).

    I am currently using this method against a picture box, but it is very slow:

      Private image lighter (image imelite, int level, int NRD , Int nGreen, int nBlue) {graphics graphics = graphics.frame image (imgLite); Int conversion = (5 * (level - 50)); Pen yellowite = new pen (color. Formarbb (conversion, nred, ngreen, nblue), imgLight with * 2); Graphics. Drainline (PLEET, -1, IGGLightWith, IMGlightHight); Graphics.Save (); Graphics.Dispose (); Return imglight; }  

    You might use a color matrix on MSDN just like this example.


    java - Error while validating XML file with XSD -


    I have an XML file, let's call it test.xml and I have a schema for verification (schema.xsd) is. I am also using the last version of TomCat.
    I was wondering what could be the reason for the following errors:

    Error: URI = file: /// c: /../Upload/test.xml Line = 2: Document is invalid : No grammar found.
    Error: URI = File: /// c: /../Upload/test.xml Line = 2: Document root element "TEST_ROOT" must match DOCTYPE root "tap".

    Synergy

    I do not know TomCat and because you have about this error I have not posted any details. Suppose that when you validate XML against your XSD, can you get it?

    At first I try to check with the XML line on the command line, this will give you some more information that is wrong in your document.

    If you post some more details, we will be able to assist you.

    If you are an XML NuB, then I suggested that you read before the tutorial. To wit. The Almighty will help you

    It may be a good start ...


    nhibernate - help building castle dynamic proxy -


    इसलिए मैंने

    से स्रोत खींच लिया इसे vs.net 2008 में खोलें

    < P> समस्याएं:

    1. vs.net विधानसभा को नहीं खोल सकता
    2. असेंबली हस्ताक्षर असफल

    मैं क्या कर रहा हूं , बल्कि नहीं कर रहा है?

    अपडेट

    इसलिए मैंने नंद डाउनलोड किया, मेरे पाथ में बी.ए.टी. फाइल सेट करें, ताकि यह सीएमडी प्रॉम्प्ट में काम करे।

    इस त्रुटि हो रही है:

    बिल्ड विफल, \ buildscripts \ common-project.xml (48, 3) अवैध तत्व अज्ञात कार्य या डेटाटाइप।

    अब मैं डायनामिक प्रोक्सी प्रोजेक्ट का निर्माण कैसे करूं?

    अपडेट यह मैंने जो किया है, स्क्रीनशॉट देखें:

    ओह और मेरा नन है:

    @echo off "ई: \ देव \ उपकरण \ nant-bin \ nant-0.86-nightly-2009-05-05 \ bin \ Nant.exe"% *

    आप पढ़ सकते हैं। :)


    c# - WPF window pre-loading -


    While switching between windows in my full-screen WPF app, this screen is shown for the first time, then the display of the monitor windows Black before going This is only for the first time when the window is displayed. Is there a way to pre-load each window, is not it?

    This is what I have done:

      myWindow.Show (); MyWindow.Hide ();  

    But there is a visible flicker.

    Then I tried:

      myWindow.Height = 0; MyWindow.Width = 0; My window Windstate = windowstate Normal; MyWindow.Show (); MyWindow.Hide (); MyWindow.Height = Screen.Primary Screen.bound.height; MyWindow.Width = Screen initial screen. Bounds. With; My window Windstate = windowstate Maximum;  

    There is no flicker, but when I showed the window, it was shown in one strange situation for each other, then updated to display properly.

    I had a similar problem. Finally I created a splash screen and loaded the control behind the splash screen in a separate thread. It stopped flashing, but made the Intel App more prolonged.


    Differences case sensitivity in SELECT COLUMN and COUNT, mysql? -


    OK, I'm confused here. In my database I have 5 rows of this data => "string@domail.com" (all lower case), and this is my code, query1 (I'm using php and mysql):

    < Pre> $ str = 'STRING@DOMAIN.COM'; $ Sel = mysql_query ("SELECT COUNT (*) from the table where` column` = '{$ str}' '); $ Num = mysql_num_rows ($ sel); ebb $ num;

    The result is 1. But if I change to Query 2

      select column from the table where `column` = '{$ str}'"  

    It returns 5 returns.

    And another question is if I want to find the rows in the number of rows of the database, 1 or 2 queries, then which query should I use for the query speed period?

      $ num = mysql_num_rows ($ sel);  

    This returns the number of rows you have selected from your query. For a query, when you select COUNT (*) from your table, then it returns a row with one cell: the value of this cell is 5. The second question, select all entries with value from $ str , so mysql_num_rows ($ sel); Really return 5.

    For the other question, the first question is more efficient, but if you are looking for the number of rows with the value $ str , then mysql_num_rows () but.


    acts as ferret - acts_as_ferret multi model search not working in rails app -


    I am trying to solve a strange issue / fer_ir_arret

    Of course I googled and posted The question is:

    Actually AAP works on a single model with a model that works on a single model using the setup / AAFRb file I have. Even when I do a multi-model search in this console, it works, but only in the rail app I get:

      Unchanged method 'ferret_rank =' for & lt; Object that has a match & gt;  

    If someone has the same experience / problem and can leave a light, I would appreciate it.

    PS: I follow the following tutorial where I am now

    Have you installed the plug-in or just the gem? You may want to install plug-ins.

    I will also try to rebuild the index.

    For my purposes, I switched to solar and life is very easy. There are lots of things in Spinks that I need.


    php - Advantages / Disadvantages of pconnect option in CodeIgniter -


    ['pconnect'] is correct / code

    Incorrect - Is using a constant connection

    What do you suggest me to fix this?
    Do I set a wrong format to hit an important display?
    To see the general best practices for consistent potential connections, what could potentially cause a problem if you set this potential TRUE?

  • If you have:
    • Dedicated web server and database in production
    • and a correct output-like test environment
    • and still feel that your performance problems are due to database connection time, < / Li>
    • Too many (mostly inactive) ) Due to the many RAM used by the connection
    • P>

    • P> If you think that the connection latency is causing a problem, then convert it to your display test system and < Em> measure consider that effect.


  • How to made jQuery modal overlay to 100% transparent? -


    How to make jQuery's modal overlays (deep transparent background) can be made 100% transparent so that it does not show at all

    You can set the Opacity option to 0.

      $ ("# yourdialog"). Dialog ({Model: true, overlay: {opacity: 0, background: "black"}})  

    Kindness,

    donation


    How to extract first 30 characters from XML file? -


    Can anyone tell me how to remove the first 30 characters from the XML file?

    Open the file in Notepad, and select the first 30 characters. Press Ctrl-C

    If you want to program this program, then you have to tell us what language you are using.


    python Encoding Problem? -


    मैं source.sql (sql स्क्रिप्ट) फ़ाइल से पढ़ा

      INSERT को `Tbl_abc` वैल्यू (1111, 2222, 'सीमेंट', 'ताया', 'एमएमई', 'ग्रेनट', नल, नाउल, न्यूल, नाउल, न्यूल, नाउल, नल, 4688, 0, नल, नल, मेलिलॉट 01/02 / 09 ',' माइलॉट 01/04/09 ', नल, नल);  

    और dest.sql पर लिखें मेरी सूची के साथ formated

    मैं उदाहरण के लिए एन्कोडिंग के साथ समस्या से मिला:

      Gerrant = G डीएफ़ डाटा माइग्रेशन (डेस्ट, सोर्स, टीबीआईएन, रिटर्न_डेटा = ट्रू): '' '' '' डाटा = [] के लिए codecs.open (स्रोत, 'आर', "यूटीएफ -8") के लिए। Xreadlines (): प्रतिस्थापन = 1 = ln.replace ("INSERT IN` "+ tbl_name +" `मूल्य (", "") प्रतिस्थापित 2 = Replace1.replace (");", "") list_replace = replace2.split (',') s = list_replace data.append (list_replace) अगर return_data == सही है: ouputdata = [डेटा के लिए घ d अगर डी [1 ] == '0' और डी [6] == '0'] रिटर्न ओरूटडेटा रिटर्न_डेटा == गलत: वापसी डेटा  

    मैं प्रिंट डाटा माइग्रेशन ('dest.sql', ' ('1111', '2222', '' सीएलईएमटी '', '' ताया '') "," एमएमई "," जी / एक्ससी 3 \ xa9rant '', 'NULL', 'NULL', 'NULL', 'NULL', 'न्यूल', 'न्यूल', 'न्यूल', '4688', '0', 'नूल', 'नूल', '' माइलॉट 01/04/09 '', '' माइलॉट 01/04/09 '', 'नाउल', 'नाउल']] लेकिन मेरी औपुत फाइल में अभी भी समस्या है। कोई मेरी सहायता कर सकता है?

    कृपया .encode ("utf-8") का उपयोग करें , जब आप .sql फ़ाइल को भी लिखते हैं।

    फ़ाइल खोलें

      fileObj = codecs.open ("someFile", "r", "utf-8" )  

    कहता है कि आप इसे पढ़ते हैं

      data = fileOjb.read ()  

    ... कुछ करें पर डेटा

      खुला ("newfile", "w")। लिखें (data.encode ("utf-8"))  

    getting same property from mysql with php -


    Assume that I have 1 current user id and second user id for which current user ........ ... if both have the same options then get mysql data .....

    For example, User 1 has uploaded a picture and User 2 has also uploaded the photo ....... How can I match user1 to user2? Query should be like this ........

    Choose from users * where id = 'user1id' or id = 'User2id' and imguploaded = '1'

    whether this question is correct or not, but it is not working for me .......... !! I would like a working query, like * select from those users, such as imageddoded = 1

    where brackets Due to preference with ... where user (id = 'user idid' or id = 'user idid') and imgolded = '1'

      select / pre> < P> If you do not, mysql will visualize the default priority and interpret the query in this way:   and imguploaded = '1')  

    No damage will result.

    To see that both users have actually uploaded a picture, which you can create:

      select COUNT (*) As the count of users in the form where (id = 'user1id' or id = 'user2id') and imguploaded = '1'  

    and then check if count == 2


    c# - Unable to connect from remote machine -


    I have a problem and if I do it or not, then I can not see it at home. Here is the code

      using the system; Using System.Net; Using System.Net.Sockets; Using System.Threading; Using System.IO; Using System.Net.Security; Classroom Program {Private Static IPAddress ipAddress = IPAddress.Parse ("127.0.0.1"); Private static port = 6000; Private Static String Data = Faucet; Static zero main (string [] args) {thread thread = new thread (new threadstart (getredread)); Thread.Start (); Console.ReadKey (); } Get public static void () {while (true) {TcpListener tcpListener = new TcpListener (ipAddress, Port); TcpListener.Start (); Console.light line ("waiting for connection ..."); TcpClient tcpClient = tcpListener.AcceptTcpClient (); Console.light line ("Connected to {0}, tcpClient.Client.RemoteEndPoint); while (! (TcpClient.Client.Poll (20, SelectMode.SelectRead))) {Network Stream Network Stream = tcpClient.GetStream (); Stream Reader Stream Reader = New Streamminder (Network Stream); Data = Stream Reader. Readline (); if (Data! = Null) Console.light line ("Received Message: {0}", Data);} Console.lightline ( "Disconnected ... \ n"); tcpListener.Stop ();}}}  

    I have a simple program to connect to this and Send a string with data and it works fine on the local host but there is a problem when I am trying to connect with each other.

    I even locked the firewall on my PC and router Every time I tried to connect to my friend's laptop, then his computer refused. Maybe I am doing something wrong?

    Of course, Code> ipAddress a local address , Because it is only working at this time. Any suggestions what to do?

    It will have to be set to accept connections from any IP, where IPAddress overload function:

      System.Net.IPAddress.Any  

    Use instead of 127.0.0.1 and it will fix your problem.


    Copying minor updates to another branch with git -


    I have started playing with GIT locally, and have come up in a matter of use that I'm sure Not that how best to handle

    I am working on a spike in a branch, but then came in a simple improvement that applies to the master too. I have found the best for this moment:

      git stash git checkout master // My Correction Manually git commit- a git checkout spike git pop  
    < P> Just a little curved for a line, and it involves doing me two same improvements twice. I can not help feeling that there should be a better way of doing this. In your answer, please also consider the case where there are other changes in the same file that I do not want to take.

    If the changes you want to apply to a master are a complete commitment to the spike branch, then Cherie-pick command was created for this situation.

      git stash GIT checkout master GIT cherry-pick and lt; Hash & gt; GIT checkout spike GIT step pop  

    If you only want a share of the Commit, use it:

      git stash git checkout master git Cherry-pick- N & lt; Hash & gt; # Tinker with index until it changes, which you want to apply for Master GIT Commit GIT Checkout Spike GIT Step Pop  

    php - Sugar CRM Soap call not working properly -


    I have a CRM example of sugar and I was trying to get some data from using soap service.

    Below is the code that I am using for this.

    When I run the same code, sometimes it is returning the right data, sometimes it does not happen.

    Can anyone tell me that the problem is this ??

    Add "nusoap.php"; $ Client = new saponal ('http://asdf.net/test/urbancrm_2009_06_22/soap.php'); // Log in SugarCRM $ auth_array = array ('user_auth' = & gt; array ('user_name' = & gt; '******', 'password' = & gt; '******* '),); $ Response = $ client- & gt; Call ('Login', $ auth_array); If (! $ Response ['error'] ['number']) {// successfully logged into $ session_id = $ response ['id']; // $ response = $ client- & gt; Calls ('get_entry_list', array ('session' = & gt; $ session_id, 'module_name' = & gt; 'user', 'query' = & gt; '', 'order_by' => Offset '= & gt;', 'select_fields' = & gt; array ('id', 'USER_NAME')); $ Response = $ client- & gt; Call ('get_entry_list', array ('session' = & gt; $ session_id, 'module_name' = & gt; 'itf_Apartments', "query" => "itf_apartments_cstm.neighborhood_c = 'loop', 'order-b' = 'Gtc: '$ 2_bedroom_plus_den', 'penthouse', 'photo_c', 'building_type_c', 'neighborhood_c')); // $ response = $ client- & gt; call ('get_entry_list', array ('session' = & gt; $ Session_id, 'module_name' = & gt; 'itf_Apartments', 'query' = & gt; 'itf_apartments_cstm.urbanlux_id_c = "1 (' name ',' studio ',' variable ',' one_birdroom ',' one_border_plus _den ',' ',' order 'B' = & gt; '', 'offset' = & gt; '', 'select_fields' = & gt; two_bedroom', 'two_bedroom_plus_den', 'penthouse'))); // store id and user name as a key value pair in the array // echo "---"; Print_r ($ response); } Else {echo "else"; Print_r ($ response); }

    ?>

    You need to change the password Before passing for certification, MD5


    Scala: pass Seq to var-args functions -


    Given a function that takes a variable number of arguments, e.g.

      def foo (os: string *) = println (os.toList)  

    How do I cross the sequence of arguments of the function? I would like to write:

      val args = seq ("hi", "there") foo (args)  

    Obviously, it does not work .

    foo (args: _ *) moves a single argument Instead of applying the sequence in the form, each element in the sequence will be used as a logic.


    c# - How can I show an error message when trying to run an exe file without its dlls? -


    I have a C # application that has added a DLL to the context. When I try to run Windows X from Windows (after compilation) and DLL is replaced then I want to apply to show an error message.

    How can I do this in code?

    If exe can not find any required dlls, it will already display an error Something on the lines of:

    The program can not start because example.dll is missing from your computer. Try to re-install the program to fix this problem

    The fact is that you can not find one of the many things:

    A) DLL is not actually referenced by your program.

    b) You have added DLL to the XE.

    c) The DLL is found elsewhere by CLR (thanks pondidem)


    c# - Why does this static factory method involving implied generic types, work? -


    विचार करें

      सार्वजनिक वर्ग ट्यूपल & lt; T1, T2 & gt; {सार्वजनिक ट्यूपल (टी 1 वी 1, टी 2 v2) {V1 = v1; वी 2 = वी 2; } सार्वजनिक T1 V1 {प्राप्त करें; सेट; } सार्वजनिक T2 V2 {प्राप्त करें; सेट; }} सार्वजनिक स्थिर कक्षा टपल {// जादू !! सार्वजनिक स्थिर ट्यूपल & lt; T1, टी 2 & gt; नया & lt; T1, T2 & gt; (T1 v1, T2 v2) {नया ट्यूपल & lt; T1, T2 & gt; (v1, v2); }}  

    उपरोक्त कार्य में "मैजिक" का हिस्सा क्यों लगाया गया है? यह Tuple.New (<, "2") के बजाय नए ट्यूपल & lt; int, string & gt; (1, "2") की तरह सिंटैक्स की अनुमति देता है, लेकिन ... कैसे और क्यों?

    मुझे Tuple.New & lt; int, string & gt; (1, "2") की आवश्यकता क्यों नहीं है

    इसे सामान्य प्रकार का अनुमान कहा जाता है और यह केवल सामान्य तरीकों के लिए काम करता है। आप नया के लिए तर्क के रूप में जो कुछ भी चाहते हैं, उसके उदाहरणों को पारित कर सकते हैं और कंपाइलर का अनुमान है कि आप विशेष सामान्य ट्यूपल को वापस लौटने का मतलब है जो कि Tuple & lt; int, string & gt; ...


    java - How to make sure I'm using the "server" JVM? -


    Sun JVM comes in two types: -client and -server , where server VM is optimized for long-running processes, and is recommended for server applications.

    When I run java with a parameter, it displays the usage option, which includes the following text:

     is the default VM server, Because you are running on a server-class machine 

    After seeing this, I did not have trouble connecting the process to -server in the startup command.

    However, recently on the JVM crash log, I saw the following line near the end of the file:

     vm_info: Linux-X86 JRE (1.6.0_14-B-08) ) For Java hotspot (TM) client VM (14.0-B16), Created on 21 May 2009 02:01:47 with "java_re" with gcc 3.2.1-7a (j2se released) 

    I think the Java client is using VM, despite this what the help message says in the message. I'll add the -server option to my startup command, but now I doubt if my question is: Is there any way to ensure that the VM that I'm running is actually server VM Is, without compelling a JVM crash?

    The OS is Ubuntu 8.04, but I am using JDK 1.6.0_14 which I downloaded from Sun's website.

    you can

      System.out.println (System .getProperty ("java.vm.name"));  

    What returns on my machine:

    Java HotSpot (TM) client VM

    or < / P>

    Java Hotspot (TM) 64-bit server VM

    Of course, you should not do anything important on this value, because it may be in the future Will change, and will be completely different on another JVM.


    garbage collection - Understanding Java's GC logs -


    I turned on Verbose GC option on my JDK, and now I have lines like

     [CMS -Compatible-sweep-start] 25.622: [CMS-concurrently-sweep: 0.023 / 0.024 seconds] [Times: user = 0.02 sys = 0.00, actual = 0.03 sec] 25.623: [CMS-concurrently - reset-start] 25.629: [ CMS-concurrent reset: 0.007 / 0.007 seconds] [times: user = 0.01 sys = 0.00, actual = 0.00 seconds]  

    Anybody can tell me exactly Is

    1. CS + users and what is the difference between the real-time?
    2. What does "0.023 / 0.024 seconds" mean? According to

      , two numbers 0.023 / 0.024 are CPU / wall bars


    windows runtime - WinRT Originate Error 0x40080201 -


    After

    When I wrote a few codes and heavily parallelized a IVectorView & lt and hit an error, StorageFile ^ & gt; ^ & Gt; . The debug output was: 0x40080201 ::

    The first chance to generate WinRT error in tool.exe at 0x76e86118

    The first chance exception is in tool.exe on 0x76e86118: Microsoft C + + Exception:. Something like the code: FailureException ^

    on the Platform :: Memory Location 0x02daec60:

      work & Lt; Vector & lt; Longer & gt; & Gt; GetDatesTakenFromFiles (IVectorView & lt; storagefile ^ & gt; ^ filesInFolder) {Vector & lt; Work & lt; Longer & gt; & Gt; DatesTakenTasks; {DatesTakenTakenTasks.push_back (create_task (File & gt; Properties & gt; GetImagePropertiesAsync ()) for each file (AutoFile in filesInFolder) then ([FileProperties :: ImageProperties ^ Attribute] {Properties & gt; DateTaken. UniversalTime;})); } When to return (starting date deeds), expiry (dayTentcutus); } After some investigation I came to know that  file  

    post < > The object must do this from inside the internal lambda:

      work < Vector & lt; Longer & gt; & Gt; GetDatesTakenFromFiles (IVectorView & LT; StorageFile ^ & gt; ^ filesInFolder) {Vector & LT; Work & lt; Long & gt; & Gt; DatesTakenTasks; For each of the files (automatic file in the files folder) {datesTakenTasks.push_back (create_task (file-> Properties-> gtImagePropertiesAsync ()). ([=] (FileProperties :: ImageProperties ^ properties) {// I do not know Why, but the file was being cleaned. This prevents it. UNREFERENCED_PARAMETER (File); Return Properties-> DateTaken.UniversalTime;});} When Returns (Start (Dates, Taker Tasks), Termination (Datacentacatak));}  

    As a side note, I have to tell that this error happened only when FolderDepth :: Uth , but FolderDepth :: Deep .


    polymer - Insert data-bound HTML into standalone auto-binding template -


    It is possible that you can override the data bidding default behavior of polymers to avoid HTML using the Injection HTML method.

    It's okay for some use cases, but is there any way to prevent HTML just from standalone templates?

    For example, type my HTML page & lt; Body & gt; has a template that looks like this; How can I save myHTMLsnippet from avoiding the HTML of the value?

      & lt; Template = "Auto binding" & gt; & Lt; Div & gt; {{MyHTMLsnippet}} & lt; / Div & gt; & Lt; / Template & gt;  

    I can get an alternate solution by nesting the element inside the binding template Was there.

      & lt; Template = "Auto binding" & gt; & Lt; Div & gt; & Lt; Template = "juicy-html" content = "{{myHTMLsnippet}}" & gt; & Lt; / Template & gt; & Lt; / Div & gt; & Lt; / Template & gt;  

    javascript - Why does my $watch only ever fire once? -


    I'm fitting some widgets and the $ watch expression works perfectly in a file But now I took a new controller and markup into a new controller in a new controller and after the initialization, I set a fire at $ watch once, but when editing the typing in related input No.

    = Function (input) {Console.log ("detected change")} $ scope. $ Watch ("addressInput", testReceivingAddress)}]

    Wrapper HTML:

      & lt; Ng- included src = "'partial / getRecipientWidget.html'" ng-controller = "getRecipientWidgetController" ng-init = "recipient = certificate" & gt; & Lt ;! - NG-Init does not affect the bug. - & gt; & Lt; / Ng-included & gt; HTML of  partial / getRecipientWidget.html  

      & lt; Md-text-float ng-model = "addressInput" HTML  

    & gt; & Lt; / MD-text float & gt;

    I suspect that there is some chance magic? I have left ng-init to make it clear: To create a clearly more complex, reusable widget which in this example is $ scope.cert < / Code> will work on its recipient .

    This is because ng-include contains a new legacy radius on HTML , So your controller does not have the same reference as $ scope.addressInput as the $ code = $ scope.addressInput . GetRecipientWidget.html

    It's not easy to explain, but keep you within the HTML of ng-controller getRecipientWidget.html (And not included above), or you can use an object like some.addressInput instead of raw addressInput , which is the reference problem on raw types Avoids (number / string).


    yaml - symfony: logical operations inside config.yml? -


    Is it possible to take logical action in the config.yml file?

    For example I tried this:

      width: 50 height: 30 width _ more_heat:% width% +% height%  

    But I get an error.

    the way you are. But there is a way to work to consider. You can do this in the dependency injection folder inside your bundle extension file. If you can, then take the width and height parameters of the bundle, maybe a core bundle or something else.

      Class Expands My Extension Extension {/ ** * {@inheritdoc} * / Public Function Load $ Configs, Containerbuilder $ Container) {$ Configuration = New Configuration (); $ Config = $ this- & gt; Process configuration ($ configurable, $ configs); $ Loader = new loader \ xml fileloader ($ container, new file locator (__dir __. '/ .. / resource / config')); $ Loader-> Load ('services.xml'); $ Sum = $ Container- & gt; GetParameter ('width') + $ container- & gt; GetParameter ('height'); $ Container- & gt; Setpayeter ('width_more_height', $ sum); }}  

    angularjs - Stripe-angular dependency injection error Unknown provider: -


    I'm injecting a bar angle in a module to create a stripe token, but I think some dependency injection problems Are:

    I have got angular-stripe directive loading in Strips.JS and Index_Ok

       

    And I'm injected correctly on the basis of the documents:

      Angular. Module ('formApp'). Controller ('formController', ['$ scope', 'appointment', 'bar', function ($ radius, appointment) {stride .cost published ('my-key-here');}]);  

    What am I doing wrong?

    Here is my error

      Error: [$ Injector: unpr] Unknown Provider: stripeProvider & Lt; - Strip & lt; - formController http://errors.angularjs.org/1.3.14/$injector/unpr?p0=stripeProvider%20%3C-<div ui- see = "" class = "ng-area" & gt; Trip% 20% 3C-% formController  

    You list tab As a dependency, but do not keep it in your work any time:

     . Just add a  bar  parameter ('formController', ['$ scope', 'appointment', 'tab', function ($ scope, appointment) { 

    (

    r - Creating a random sample from a dataframe with a nested structure -


    This question builds from a SO post

    I was trying to remove a random sample in a row I'll frame the data using the nesting situation.

    The use of the following dummy dataset (modified by iris ):

      Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 Setosa 2 4.9 3.0 1.4 0.2 Setosa 3 4.7 3.2 1.3 0.2 Setosa 4 5.3 2. 9 1.5 0.2 Setosa 5 5.2 3.7 1.3 0.2 Virginia 6 4.7 3.2 1.5 0.2 Virginia 7 3. 9 3.1 1.4 0.2 Virginia 8 4.7 3.2 1.3 0.2 Virginia 9 4.0 3.1 1.5 0.2 Verilikor 10 5.0 3.6 1.4 0.2 Verilikor 11 4.6 3.1 1.5 0.2 Verilikor 12 5.0 3.6 1.5 0.2 Written code  

    The code given below works fine to take a simple sample of 2 rows Does:

      ir though, i For each level of a particular variable, I want to take a sample of 2 rows, however, what I want to do [sample (neuro (iris), 2),]  

    for example Create a random sample of 2 rows for each level of variable 'species', such as:

      Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 Setosa 4 5.3 2. 9 1.5 0.2 Setosa 6 4.7 3.2 1.5 0.2 Virginia 7 3. 9 3.1 1.4 0.2 Virginia 11 4.6 3.1 1.5 0.2 Verilikor 12 5.0 3.6 1.5 0.2 Whirlilor  

    Your Thanks for the help!

    dplyr is very easy with:

      Library (Dplyr) Iris% & gt;% group_by (species)%>% sample_n (size = 2) # Sepal.Length Sepal.Width Petal.Length Petal.Width Species # 4.6 4.6 1.4 1.4 Setosa # 2 5.2 3.5 1.5 0.2 setosa # 3 6.5 2.8 4.6 1.5 versicolor # 4 5.7 2.8 4.5 1.3 versicolor # 5 5.8 2.8 5.1 2.4 Virgina # 6 7.7 2.6 6.9 2.3 Virgo  

    The number of columns you want Group can

      CO2%>% group_by (type, treatment)%>% sample_n (size = 2)  

    html - Deleting a row using PHP but only works sometimes -


    I am having trouble removing a line from the database; The connection is perfectly fine, because I tested it with other things and the variable is to delete the correct ID in $ first .

      & lt ;? Php if (isset ($ _GET ['output'])) {$ generation = $ _GET ['output']; $ Arr = Explosion (".", $ PRODUCT, 2); $ First = $ arrival [0]; $ Filename = "production / $ first.php"; Echo $ first; If (file_exists ($ filename) == true) {$ str2 = "Delete from output WHERE production_id = '$ first'"; If ($ mysqli- & gt; query ($ str2) == true) {echo "successfully removed first $"; Unlink to ($ filename); }}}? & Gt;  


    c++ - Why don't many compiled languages include compile time Reflection? -


    I am researching this topic for potential future data serialization programs. I am very surprised that many popular languages ​​(C ++ mainly but not even corrosion) are not supported, do not compile time reflection.

    It often comes in data serialization, looking at a class, the ability to loop on their data members, get their method name, retrieve the name of the class, and all $ DATA_FILE_TYPE is unreliable Push by form.

    I am asking from the perspective of one scientist. I often deal with different hardware, storage data is cheaper, not used. Due to being able to safely save the Structors and Classes format for a format and write serializer and deserillizer, it will be astonishing not to worry about changing the class.

    The compiled time is a good example of the benefits of reflection. Although it uses a meta-compiler program, in which the source code is read at the first pass, ideally it is not. It's 2015, and for many people it is disappointing not to be able to write a route for the data format of its need (HDF 5, JSON, TXT, ..) like a library.

    Am I describing any possible compiled language possible?

    C, and therefore C ++, is built on the basic premise "What do you pay for Do not use it. "

    The reflection takes a great deal of the outstanding amount. The useful things for a scientist are for an embedded system that is trying to fit just two megabytes of RAM. .

    This is a pain, but a library can be applied to reflection. I use such a thing in my code, but only small fist subsystems are required because I am running on the system Where exceptions and plain old RTTIs are very expensive

    To resolve: You will see QT. It's a framework for C ++, it provides run-time meta data plus many other things

    Edit: Pure compile-time solution: LEX and YACC / FLEX . There is nothing wrong with a vector in any way, but there is no reason that your parser should leave the function of the serialization because many of the Java generators do the work.


    sql - Very special join on float value -


    I was stuck with a difficult query (in MS Access 2013). I want to do a fairly simple job:

    I have two tables (see examples given below): Table "Score" with an exam and a score of the table "grading_key"

    There is a field called "quotient" in the score table in which one percent represents the percentage of success (1.0 answers to all the questions are correct). The grading_key table has a part limit that separates a grade level from the next. Thus the "grading_key" table can be used to get grades for the value of any value.

    A grade can be obtained by performing:

      grading_key WHERE {ANY_QUOTIENT_VALUE} to top Top 1 grade & lt; = Quotient  

    Sample Tables:

      | -read_key- | | ----- Score ----- | Quotient Grade StudentId Quotient 0,92 1 123 0,85 0,87 1,5 321 0,8 0,81 2 766 0,91 0,76 2,5 222 0,78  

    My problem is that, I want to include a score and grade in a query, resulting in the addition of each grade with a grade in the table "grade_key" to the table "score" (see the desired_model below). Unfortunately I just can not join, because the quotes in "scores" do not match the grade limit defined in "grade_key" Currently I have used a VBA function (calculateScoreForQuotient ()) but I want to remove the VBA dependency because the resulting table should be called outside of MS Access and in this case VBA functions do not work.

      | -------- desired_message ------- | StudentId Quotient Grade 123 0,85 2 312 0,8 2,5  

    Does anyone know a way to get the desired table with plain SQL? I played with different combinations of Johns and WHEREs for a while, but my best result was to associate all the available grades with each student (not really meaningful).

    Any help will be safe on my day; -)

    You can use a related sub-query, student. You can use Max () or Top 1 with the order by section, whatever you want.

      Select Student ID, Quantit, (Select grade from Max where the grade quality  Student =) Quality as student from grade  < / Pre> 

    c# - Creating Dependency Properties for custom control -


    After

    I try to create a DependencyProperty for my custom control I am doing.

    I want to be able to set a property, which will be set as a string, separated by commas, but as a list of strings Stored in memory

    Here's what I have so far:

      public class FileTypeListControl: Control {public static read-only DependencyProperty FileTypeListProperty = DependencyProperty.Register ( "FileTypeList for", typeof (List the & lt; string & gt;), typeof (FileTypeListControl), new PropertyMetadata (new list of & lt; string & gt; () { ".txt"}, OnFileTypeListPropertyChanged, OnCoerceFileTypeListProperty), OnValidateFileTypeListPropety); Public listing & lt; String & gt; File Type List {Return (List & quot; String & gt;) GetValue (FileTypeListProperty); } Set {set value (file type listproperty, value); }} Public static void OnFileTypeListPropertyChanged (DependencyObject source, DependencyPropertyChangedEventArgs e) {} public static object OnCoerceFileTypeListProperty (DependencyObject from object data) {if {var val = (data as a string) KSplit (new char [] (data string } {','}); Return valve; } And if (list of data & lt; string & gt;) {return data; } Other {new list & lt; String & gt; (); }} Public Stable Bull OnValidateFileTypeListPropety (Object Data) {Return Truth; }} & Lt; Local: FileTypeListControl X: ".xml, java, .exe" name = "control" Grid.Column = "2" fileTypeList = /> Now, the problem is that the way I specified the  FileTypeList  property in xaml is not liked, I was under the impression that  OnCoerceFileListProperty  method was to emphasize value in the appropriate type, which I am doing 

    I can use a value converter, but every time I re-use control I do not think so right.

    What am I doing wrong here?

    Type conversions by this Cosavl value callback does not work usually TypeConverters objective is to Public class StringList Commander: TypeConverter {Public Override Bull CanConvertFrom (ITypeDescriptorContext Reference, Type Source Type) {Source Source Type == Type (string); } Public override object Knhwartfom (Aitiipi descriptor contact reference, Kalcrinfo culture, Object value) {return (string) value) Ksplit ( ''); }} ... [correspondent (typef (stringlist command)) public ILIST & lt; String & gt; File Type List {Return (ILIIT & lt; string & gt;) GetValue (File Type Listproperty); } Set {set value (file type listproperty, value); <}>

    Also keep in mind that property must be of the IList & lt; String & gt; By declaring it as list & lt; String & gt; .

    You will be given the new list as your default value for the property & lt; String & gt; () { ".txt"} as to avoid the use of any expression, because this value is used for all FileTypeList the "examples" of your estate when you upset a control frequency < / Code> Add a string for the property, this change will also occur in other control frequency, as long as they have a default property value.

    The default value should be null for all reference type properties, then you can set the default default value in the control creator:

      public FileTypeListControl () {SetCurrentValue (FileTypeListProperty, new list & lt; string & gt; () {".txt"}); }  

    Convert a string representation of a hex dump to a byte array using Java? -


    I'm looking for a way to convert a long string (from a dump), which hex in a byte array Represents the value.

    I could not say better than the person who posted it on the same question:

    But to keep it original, I used to phrase it my own way : Suppose I have a string "00ABF" which I would like to interpret byte [] [0x00,0xA0,0xBf] What should I do?

    I am a new Java novice and it has finished using BigTeeger and Head Hex looking for zero but I think it is ugly and I am sure I am missing some simple. ..

    Here's a solution I think is better than any post so far:

      public static byte [] hexstraat tabetre (strings) {int len ​​= s.length (); Byte [] data = new byte [lane / 2]; (Int i = 0; i & lt; len; i + = 2) {data (I / 2) = (byte) ((character digit (SARATAT (i), 16)  

    The reason why this correction is:

    • Leading zeros (unlike the BigIntega) and safe with negative byte values ​​(byte contrast Parsbaite)

    • does not convert the string to a char [] , or creates stringbuilders and string objects for each single byte.


    javascript - ReferenceError: Can't find variable with SpookyJS -


    I try to make an external function call in Spokijs by doing the same thing to the wiki:

    But when I try the following code, I get this error:

    Reference error: Can not find variable: test

     < Code> try {var spooky = required ('scary'); } Hold (e) {var spoky = ('../ lib / spooky'); } Var urls = ["http://www.google.fr", "http://www.yahoo.com"]; Export.clicker = function (req, res) {console.log ("First:" + visitUrl + "\ n \ n \ n Last in the end"); Var visitUrl = function (urlIndex, nbClicked) {console.log ("hello"); }; Var spooky = new spooky ({child: {/ transport: 'http'}, Casper: {logLevel: 'debug', verbose: true}}, function (mistake) {if (err) {e = new error ('spookies Failed to initialize s); id description = fault; throw a;} spooky. Start (url [0]); console.log ("second:" + url + "\ n \ n \ n on the other side"); Spooky.then ([{test: visitUrl}, function () {console.log ("THIRD:" + test + "\ n \ n \ n end THIRD");}]); spooky.run ();}) ; // Remove this block to see all the things that Casper has to say. // it is enough. // That opinion is Spooky.on ('console', function (line) {console.log (line);}); Spooky.on ('Hello', Function (greeting) {console.log;}); Spooky.on ('log', function (log) {if (log space === 'remote') {console.log (log. Message.replace (/ \ -. * /, ''))}}} ); }  

    These two following logs work:

      console.log ("First:" + visitUrl + "\ n \ n \ n Finally first") ; Console.log ("SECOND:" + visitUrl + "\ n \ n \ nOther seconds");  

    But the third error is responsible for the message:

      console.log ("THIRD:" + test + "\ n \ n \ nAnd third ");  

    Any suggestions?

    Instead of giving a big answer, I would like to comment on your post but I do not have a reputation for it. , Meh

    You can not work in the etching if you want to

      var x = 'helo' spooky.then ([{XinCasper: x}, function () {// do something with XinCasper}])  

    This will work if you want to pass an object or array, then use JSON.stringify and rebuild it in Casper Scope .

    If you want to use spooky function from a mutually scope, use event emitters instead (see most of the last lines):

      Try {var Spooky = essential ('scary'); } Hold (e) {var spoky = ('../ lib / spooky'); } Var urls = ["http://www.google.fr", "http://www.yahoo.com"]; Export.clicker = function (req, res) {console.log ("First:" + visitUrl + "\ n \ n \ n Last in the end"); Var visitUrl = function (urlIndex, nbClicked) {console.log ("hello"); }; Var spooky = new spooky ({child: {/ transport: 'http'}, Casper: {logLevel: 'debug', verbose: true}}, function (mistake) {if (err) {e = new error ('spookies Failed to initialize s); id description = fault; throw a;} spooky. Start (url [0]); console.log ("second:" + url + "\ n \ n \ n on the other side"); Spooky.then (function () {// Casper scope var y = 'some' this.emit ('third', y)}); spooky.run ();}); Spooky.on ('third', function (y) {console.log ('hey, I can' + y + 'output.')}}  

    encryption - Encrypting connection strings for a web farm in Release Management -


    itemprop = "text">

    I am at Visual Studio / Release Management 2013 Web for webpage Somebody wrote a tool for encrypting config files for toolbox? I know that you can do it manually with aspnet_regiis.exe, but it was thinking that someone has made a good process to use it within Microsoft Release Management. Thanks!

    It seems that you have already found the right solution Release Management Toolbox Fully User-Extensible is. Go ahead and create a custom action that calls call with the appropriate command line parameter and you're all set.

    I did this for customers who need config files to be encrypted, it works wonders.