Saturday 15 September 2012

full text search - Find and replace multiple strings in file then output to new filename python -


I am creating a dragon script that can read a source file and generate another file with a string for the name .

For example,

is the source file in the MacDress.Cnf.xml

Let me replace '6000' to '6001' in many places of the MacDrade.com. I need the .xml, so I want to output to newmacaddress.cnf.xl.

I have it

  #! Write open = file = f (file) for file in / usr / bin / python #read and f: if line canteen ('66001'): newline = line.replace ('66001', '60001')  

To add it I can do CSV or whatever else and to do more to run the script.

60002 >> macaddressfromcsv.cnf.xml 60003 >> MacDesFreshCSSVCNF.xml 60004 etc.

Sorry, I am very new to this that any help would be great.

It is not clear from your question what all your goals are, but I address some of them Will try to If you want to take input from a file, then modify it, and then type any other file you can:

  buffer = ""; In open ("input_file") with: buffer = in.read (); # Modify ... open (out of "output_file", 'W') out. Written (buffer);  

Note: You will need to use <__ future__ import with_statement with in Python version 2.5.

You can actually use the function to make multiple replacements:

  buffer = re.sub ('6000', '6001', buffer)  

For additional information on using CSV, please see a more detailed explanation or an example of what you are trying to achieve.


c# - Creating a WPF property grid? -


If I want to create my own property grid control in WPF, then where do I want to start?

As described by @Pop Katlin, it is good to use, but to use in a MVVM scenario Painful; Databinding only works when the control is first loaded, once you try to force another object, it fails. My View Model was added to recover the property grid and set the bound object directly. Bleach!

A better free control is involved; It handles databasing better, and visually it is also good, which has made VS Many hints have been obtained from the 2010 property grid.


split - Excel: SUMIF depending on number in field -


Hi All the best people

update

Do you know what me To tell you to tell me that I am actually trying to do this with numbers and not a letter for example, I have an area of ​​225566 and I am trying to select the areas with whom There are 55 It is only now that I have realized that it can make a big difference

column A | Column B |
225566 | 2
125589 | 3
95543 | 2

(Below I asked earlier and later I realized that I was not asking the right question.) * Let's say I have a table

column A | | Column B |
AABBC | 2nd ADDC | 3
Zbbbc | 2

How can I get SUMIF for the rows where the column A is the field with BB? Let's say that there are hundreds of rows. I realized that from the lesson to the column I have to make some guesses. But I'm surprised that someone will know how I can do this. Thanks a lot. *

Since you are trying to do this on numbers, The array formula will need to be used.

If your test values ​​are in A3: A5 and your values ​​are in B3: B5, this will work:

  = SUM (IF (FINDER ("55", TEXT (A3: A5, "#"))), 0, 1) * b3: b5)  

formula, just kill Use Ctrl-Shift-Enter instead.

This tells the product of par and 0 or 1 from the IF () statement, which tests that each test value, after being converted to text, contains a "55".


sql server - Looking for a script which will script out all database level persmissions( including xp_cmdshell and sql proxy account) -


I need a stored procedure or script that will script all database level permissions - including the permission of xp_cmdshell, Along with any object, as well as allowing a SQL Proxy account.

Thank you!

Your problem is that xp_cmdshell is allowed to have a master database, so long as you do not run the database on the server , You will not be able to do what you want to do if you are trying to give all the permissions for a proxy account to the database, then you should put that account in the db_owner database role, and this Receive those rights through role membership And should. Xp_cmdshell has a distinct clear grant in the master, and should be enabled through sp_configure, and should be used for legacy integration, it should not be used for new development work at the very least, if you use XPICM & SSL Then a proxy account should be setup after example of Tibor:

Write permissions for a specific user by query of DMV The following:

  Select permission.state_desc, or obj inner join the permission.permission_name, obj.name as sys.all_objects as allowed as sys.database_permissions allowed. Major_id = obj.object_id and permission Minor_id = 0 and permission.class = 1 INNER JOIN as grantor_principals as grantor_principals grantor_principal.principal_id = permission.grantor_principal_id INNER as sys.database_principals grantee_principal grantee_principal.principal_id = permission.grantee_principal_id WHERE (grantee_principal.name = N'JohnDoe ')  

javascript - Need a quick jquery solution to capture the current url and inject it into another url link -


My ATMs fried in my brain and I have a time limit, one way I can capture the currently viewed url URLs. Looking for bookmark / social links, put it in another link.

  Facebook link: http: //www.facebook.com/share.php? U = [PAGEURL] MySpace Link: http: //Www.myspace.com/Modules/PostTo/Pages/?u=[PAGEURL] Twitter link: http://twitter.com/home?status=Check+this+out : + [[PAGEURL] Stumble on Link: http: /www.stumbleupon.com/submit?url=[PAGEURL] Dig link: http://digg.com/submit?phase=2&url=[PAGEURL] < / Code> 

I need this to replace [PAGEURL] with the URL of the page visited. Any help appreciates that I am looking for a while and no such answer can be found that fit in this specific situation.

"post-text" itemprop = "text">

helps to see what kind of structure these links are. But, here's some jQuery that can tell you in a good direction. It assumes that your social bookmarking links are in a container with the id = "socials" , but for whatever you take to capture your social link, you can select the mash can do.

  $ (function () {var links = $ ('# socials a'), matchExp = / \ [PAGEURL] /, currentURL = location.href; links.each (function ) {Var currentHREF = $ (this) .attr ('href'); if (current HREF.match (match XP) {$ (this) .attr ('href', currentHREF location (match XP, current URL))}} );});  

It uses the function to get that link, where one indicates a link, then a regular expression (Eve!) To see if the link [PAGEURL ], And to replace [PAGEURL], Location.href, which is the URL of the current page, is here


stop php processing file -


Is there any way to stop php to stop a file and work with it already parsed part To do. I mean:

  & lt; Here are some data & gt; & Lt ;? Php phpinfo (); [Is there anything here that can be kept here]? & Gt; & Lt; More data & gt; [Is there any thing that I can keep here] & lt ;? How do I create PHP?  

>

Another solution can be used:

Eliminates execution of the compiler. It can be useful for embedding data in PHP scripts, such as installation files.

The byte status of starting data can be determined by the __ COMPILER_HALT_OFFSET __ constraint in a __ halt_compiler () presented in the file.

is for general use, when you need to embed PHP and (possibly binary) data in a file, and PHP code needs access to that data.


And in fact there is a difference: this code:

  blah blah & lt; Php phpinfo (); ? & Gt; Glop glop & lt ;? Php exit (); ? & Gt; & Lt ;? How can I make PHP, what is it? & Gt; I get a  parse error: syntax error, unexpected T_STRING  
(probably because I have enabled, I think) < / Em>


However this one:

  blah blah & lt; Php phpinfo (); ? & Gt; Glop glop & lt ;? Php __halt_compiler (); ? & Gt; & Lt ;? How can I make PHP, what is it? & Gt;  

Works fine - after calling this invalid PHP code, __ halt_compiler () .


Simple serial point-to-point communication protocol ---- sample code -


I had read it:

And I'm doing the same thing, and I do not

PS: Code C / C ++, Python ...

Is there an API or sample code? P>

View my answer, but by going to

you can easily speak normal IP protocols.


javascript - YUI3 calling a function -


<पूर्व> top.on ('click', function () {anim.run ();});

मेरे पास एक एनिमेशन फ़ंक्शन है, और सोच रहा था कि मैं इसे इस तरह क्यों नहीं कह सकता

  top.on ('click', anim.run );  

<पूर्व> top.on ('click', function () {anim} रन ();});

या

<पूर्व> top.on ('पर क्लिक करें', वाई। बिंद (एनिमरी.रन, एनिम));

conditional - How can I evaluate chained expressions from a string, in Perl? -


I'm not sure what to call these types of expressions, so an example would be easy ...

There is no way in Perl to evaluate expressions such as a & lt; B & lt; = C ? I have a configuration file that allows the user to provide conditional expression for some tasks. Instead of dividing the condition into two halves (as I usually used in the code), I would like to display it in such a way, if possible.

It's coming in Pearl 6, to make sure but unfortunately, I do not think it's perl One of the things borrowed by 6 is.


actionscript 3 - How many pressed keys Flash can detect? using as3 -


I am developing a little game I use the following code to find out the keys pressed by the player: / P>

  Private Event on Kidadown (Event: Keyboard Event): Zero {// Marmon Keys (event.keyCode == 37} event .keycode == 65) {this.leftKeyPressed = true; } If (event.keyCode == 39} event.keyCode == 68) {this.rightKeyPressed = true; } If (event.keycode == 38} event.keyCode == 87) {this.upKeyPressed = true; } If (event.keyCode == 40} event.keyCode == 83) {this.downKeyPressed = true; } If (event.keyCode == this.shootKey) {this.shootKeyPressed = true; On}  

ONLINE event:

  Private tasks on-up (Event: keyboard events): zero {if (event.keyCode == 37} Event KeyCode == 65) {this.leftKeypress = false; } If (event.keyCode == 39} event.keyCode == 68) {this.rightKeyPressed = false; } If (event.keyCode == 38} event.keyCode == 87) {this.upKeyPressed = false; } If (event.keyCode == 40} event.keyCode == 83) {this.downKeyPressed = false; } If (event.keyCode == this.shootKey) {this.shootKeyPressed = false; } If (event.keyCode == changeColorKey) {trace ('color key release'); Trace (getTimer ()); This.changeColorKeyPressed = True; }}  

Actually the shootie player will hold down almost all the time. And the change ColourKey will be pressed frequently, but do not hold while doing the test, I noticed that onKeyUp events were not removed for the change, holding the shoot and the right arrow. Holding the up and down arrow keys instead of the right arrow is the same effect. If I capture the left arrow key then the events are removed. Why does this happen Is there anything wrong with my code?

The problem you are seeing is not related to your code, but the keyboard technology on your keyboard. The combination of numbers and combinations on the basis that you can press together may vary. I had given a lot of code for you a few years ago and I remember that the problem you mention is not the same with my current keyboard (It seems that it can support five simultaneously characters While the old one supports three).


accurev - How can I view the Eclipse platform logging? -


I am using the AccuBridge plugin for AccuRev. I use the acdiffgui tool to run diff in this plugin . Acdiffgui tool resides in / usr / bin as a symbolic link:

acdiffgui - & gt; / Opt / accurev / bin / acdiffgui

It works well within the eclipse; I can separate two files with no problem, however, ACDGG device is not limited and I would like to use mall instead.

There is no way to configure it from within this plugin, so I've updated the symbolic link to point to the mail tool:

ACDFGUY - & gt; / Usr / bin / meld

Now when I try to isolate two files, nothing happens, even there is no error! Therefore, I would be interested to see the Eclipse output whether there is any sign of what is going wrong.

I have seen the /.metadata/.log file, but there are no errors. Is this the right place to watch, and if so, is there any way to increase the logging level?

Any other suggestions would be greatly appreciated.

From the menu: Window -> Show View - & gt; Error log

or & lt; Workspace-directory & gt; /. Viewing the file system for metadata / .log is used when you start eclipse


javascript - Optimize jquery code -


  $ (textbox)। फ़ोकस (फ़ंक्शन () {$ (spans)। Css ({"पृष्ठभूमि-स्थिति ":" 0 100% "});}); $ (पाठ बॉक्स) .ब्लूर (फ़ंक्शन () {$ (spans)। Css ({"background-position": "0 0"})}};  

यह पहले से ही कम है, लेकिन यह या तो मैं बस बहुत पागल हूं या हम इसे

  $ (textbox) .bind ('focus ब्लर ', फ़ंक्शन () {* टॉगल यहाँ *});  

या कुछ और।

किसी भी मदद की काफी सराहना की जाएगी। =)

इसे आज़माएं:

  $ (textbox)। फ़ोकस (फ़ंक्शन () {...}) .ब्लूर (फ़ंक्शन () {...});  

और हाँ, आप बाध्य () फ़ंक्शन के रूप में निर्दिष्ट कर सकते हैं।

मैं अपना संस्करण अधिक पठनीय पाया।

गुड लक!


asp.net - How to choose between Web Service or Page PostBack? -


Assume that I have an asp.net page that will go to the server after the client side event and "some things" and UI show a return value of this process on subsequent programs.

My question is, if I am working in the same domain, then how should I make a web service and decide about that call, just to increase a post-back up and only on the ASPX page " Some stuff "to handle?

When working in the same domain to overcome some processes, what does the position of creating web-service become meaningful?

There are no hard and fast rules, however, I can offer some high-level directions:

  1. As a result, a significant markup (HTML, JS, etc.) is included or simplified by generating results to gain access to the situation from the original page. Keep in mind that the page object takes an important overhead over it.
  2. Give priority to a web service for those queries that can be parametatized and return structured data back
  3. Prefer a HTTPHandler for the query with simple parameters that are simple, Return full-custom text or binary (such as an image)

mysql - Is it bad to use user name as primary key in database design? -


A friend told me:

Which unique keys do you use? I hope you are not saving the entire username --- it will use too much table space! Assign a unique user id for each (unique) username and secure this user id (must have uninstalled auto_interment or begun unsecured auto_trayment). Do not forget to make a reference

Use the usability ( user ID userID ) references >) User ID

Is the above description correct? I think that's right (for the wrong reason) because the primary key can not be changed

You can change the user name then you should use the userid because it will not change.


iphone - Resizing UINavigationBar on rotation -


I have a subclass of UIViewController that handles a UIView. The View Controller is modeled (it slides down from the bottom of the screen) at the top of the view, I have added a navigation bar Note that this time it is not used by any navigation controller.

When I rotate in the scenario, I want to shrink the nebara in height (as handled by the UI navigation controller). However, I can not set my autorissising mask in the flexible height in the IB, and the code disappears completely by doing this.

Is there any way to do this? How is this done by the UIA controller?

P.S. I do not like to resort to a scaling transformation because it will spoil the text in the title.

EDIT: I solved this with a little help, read the answers posted below.

Instead of setting the autocorrection of the mask, why not see the current orientation just by handler , As well as the Thoratiform Interface Orientation, and set the proper framework?

  - (Zero) UpdateNews {UIInterface Orientation Orientation = [[UIApplication shared application] Status BarOrientation]; If ((UIInterfaceOrientationLandscapeLeft == Orientation) || (UIInterfaceOrientationLandscapeRight == orientation)) {myNavBar.frame = CGRectMake (0, 0, 480, 34); } And {myNavBar.frame = CGRectMake (0, 0, 320, 44); }} - (zero) ViewViewPaper {[Self update Nawabbar]; // ... SNIP ...} - (zero) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) InterfaceOrderation {[Self Update NavBar]; // ... SNIP ...}  

Is there a way to autosize columns in DataGrid .NET Compact Framework -


I want to autocomplete the contents in the column. Also, I want to add my header to the column. Is there any way to get autosackage? (I see that the column headers can be set with DataGridTableStyle )

< P> No, I believe that not is supported by "autosackage" in the compact framework. You have to write your code to get it.


java - Phone number validation using VOIP/SIP -


कार्य मान्य एक यूएस फ़ोन नंबर है संख्या का प्रारूप जांचना पर्याप्त नहीं है । तो मुझे कॉल करना चाहिए और यह निर्धारित करने के लिए कि क्या ग्राहक जवाब दे रहा है।

है वीओआइपी समाधानों का उपयोग करके इसे स्वचालित करना संभव है?

कृपया, किसी भी विचार को आरंभ करने के लिए सुझाव दें।

मैं इसे विंडोज प्लेटफॉर्म पर लागू करने जा रहा हूँ ( शायद .नेट या जावा)। यह मुझे उदाहरण के लिए एक कंसोल एप्लिकेशन है जो पैरामीटर (एक फोन नंबर) प्राप्त करता है और true या झूठे

मैं इस के लिए ट्वििलियो (twilio.com) का प्रयोग करने की सलाह दूंगा। यह वेब अनुप्रयोग का उपयोग करना आसान है जो आपको क्लाउड में इस प्रकार की कार्यक्षमता को बनाने में मदद करता है आपका सिस्टम प्रक्रिया आरंभ करने के लिए एक HTTP पोस्ट अनुरोध करेगा - और आपके वेब सर्वर को कॉल के परिणाम के साथ बुलाया जाएगा। उनकी वेबसाइट कई उदाहरण प्रदान करती है जो कि आप जो करना चाहते हैं वह फिट होंगे।


java - How to use Quartz with EJB3? -


I want to be able to:

  • Define different jobs and triggers.
  • To manage everything from the website (the user must define the hanging)

    That's why I created timer service, timerbase, timer And look at the timerhandle but I think it can not respond to all my needs

    Quartz, on the other hand, allows me to do everything I want, but I have little There is no clue that this How does integrate my job I have read that quartz uses its own threadpool, and I do not know how to handle it.

    I use Jebos Seam in my project, but seam / quartz integration is very limited (or documentation) and not 100% safe (has been viewed on my forum :)

    If someone is able to integrate a good scheduler into their application server (jboss is a plus) and can give me instructions, advice, or even code snippets

I have some experience on the quartz web ॉग ॉग ॉग ー ー You can retrieve that scheduler, add jobs and start serving those jobs.

You do not usually have to worry about Threadpool, if you want, quartz can handle it all. I get the information from the properties files on startup that you have quartz Define the default coming along or can use I am using default because it works for my purposes

As far as the definition of employment is concerned, Make curry classes and call your EJB from there. It is very simple

Hope you have enough to start!

P>

c# - Strategies for multithreaded application -


I can get some complex multithread applications, which currently have 2 files with many files, many of which Global variables have been used everywhere and other practices that I would consider quite smelly.

Before I start adding new features with the current pattern, I want to try and see if I can improve the basic structure of the application, list the data in the app, list A, list B

  • The app has a local copy of the data (for offline functionality); Datafile A, Datafile B

    • < Li> The Thaay TA1 in the app, TB1, which updates the dirty data from the client to the server
    • Thread TA2, update filthy data for customer from TB2 server
    • Thread TA3, TB3 update data in local files from dirty memory lists

    What kinds of different patterns, strategies, programming exercises etc. I am having problems. <.

  • Here are some goals I have invented for myself:

    1. Keep the app as stable as possible
    2. Make it easy for Generic International
    3. Reduce complexity

    Thanks to any keywords or other tips that help me on this project.

  • For excellent suggestions for Quibblesome, I can also add that often reducing the risk of threading problems There is an effective way to do (Unchanging objects, such as strings in NAT and Java, they can not be modified after being created.)


    c# - Handle a Dynamic Select With Dyanmic Linq -


    I am using the dynamic link library which describes Scott Guthrie.

    Examples of Scott Guthrie are great and I used dynamic where there is a lot of statements

    Now, though, I have to face a situation where I am moving selectively The functionality has to be used by Scott Guthrie to show a screenshot of this functionality (in the very last screenshot in the article), but very cleverly it never explains.

    The problem is, though code compilation I run, I do not think how it can work in any useful way. Maybe with reflection?

    Here is an example (Remember, you should use the Danish Linen Library which is described in the above article, this is not the usual Linq System.Linq).

    In my sample here, I have a user table with the UserId, FirstName, and LastName fields, but it does not really matter which database you use to reproduce this issue Too easy. Here's my sample code:

    First of all, make sure that you have a description of the experiment at the top:

      System.Linq.Dynamic;  

    You can then run the following code:

     using  (DataClasses1DataContext dcdc = New DataClasses1DataContext ()) {var x = dcdc.Users.Select ("New UserId, FirstName, LastName"); Foreign (different items in X) {console. WrightLine (item.ToString ()); }}  

    As you can see, it compiles and runs just fine. You get all your records back from the database. However, there is actually no way for anonymous type members access .

    Because the selection query is a string, because there is no type of guess at design time. So I can not write:

      console WrightLine (item.UserId);  

    The compiler does not know if the name of the unknown type of items is UserId, then this code will not be compiled (even if you stop the debugger for you. During that you will see that the Debug Window observes that UserID is a member of FirstName and LastLamem.

    Therefore .. How is this supposed to work? How do you gain access to members of anonymous type?

    This data-band Will work fine for Icing (I suspect that this is the use-case to use it), which uses reflection under the hood. It will work fine with 4.0 in <4.0> Dynamic .

      foreach (dynamic item in x) {Console.WriteLine (item.UserId);}  

    Also ... reflection or TypeDescriptor .

      foreach (commodity object in x) {console.light line (item. Gate type) GetProperty ("UserId"). GetValue (item, empty)) ;}  

    c# - How do you get the latest version of source code using the Team Foundation Server SDK? -


    I am trying to drag the latest version of source code outside the TFS program using SDK, and I Does not work in any way:

      string workspacename = "myvarspace"; String projectpath = "/ testpe"; String Workers = "C: Projects \ Test \ TestApp"; VersionControlServer Source Control; // Actually before this method, immediately ... Work [Work] = sourceControl.QueryWorkspaces (WorkspaceName, sourceControl.AuthenticatedUser, Workstation.Current.Name); If (workspace.line and gt; 0) {sourceControl.DeleteWorkspace (workspacename, source control .auticic user); } Workspace workspace = sourceControl.CreateWorkspace (WorkspaceName, Source Control, Etiquetic User, "Temporary Workspace"); Try {Workspace.Map (projectPath, Work Directory); GetRequest Request = New GetRequest (New ItemSpec (projectPath, RecursionType.Full), VersionSpec.Latest); GetStatus Status = Workspace. Go (Request, GetOptions.GetAll | GetOptions.Overwrite); // This line does nothing - no failure or errors} Finally {if (Vertical! = Zero) {Vertical. Remove (); }}  

    The approach is basically creating a temporary workspace, by using the go method to capture all the items for this project, and Then removing the workstation is the right way to do this? Any example would be useful.

    I am using a different approach that starts working, is taking advantage of the main method Of:

      version control source source control; // Actually instantiated ... ItemsSet items = sourceControl.GetItems (sourcePath, VersionSpec.Latest, RecursionType.Full); Foreign objects (Items in items item items) {// build relative path string relativePath = BuildRelativePath (sourcePath, item.ServerItem); Switch (Item Indem Type) {Case Item Type: Any: Delete New ArgumentOfferance Exception ("Item Type was returned Any, Expected File or Folder."); Case item type. File: Items. Download file (path. Cobain (target path, relative path)); break; Case ItemType.Folder: Directory.CreateDirectory (Path.Combine (targetPath, relativePath)); break; }}  

    android - Is there a way to make ellipsize="marquee" always scroll? -


    "text"> I want to use the marque effect on textView, but text is scrolling only when textView gets focused, because in my case, it can not be done.

    I'm using:

      android: ellipsize = "marquee" Android: marqueerepeatLimit = "marquee_forever"  

    What textview Is there a way to always scroll its text? I did this in the Android Market app, where the name of the app will scroll in the title bar, even if it does not get attention, but I can not find it in API docs.

    I am facing the problem and I have come up with the least resolution obtained from the TextView Is to create a new classroom To make TextView all focus the class should override three methods on onFocusChanged , onWindowFocusChanged and isFocused .

    override the protected zero on the @face shift (boolean focus, int instructions, the first focus is made) {if (concentrated) super.onFocusChanged (Focus, Direction, First Focused went); } @ Override Public Wide On Wandow Focus Change (Boolean Focus) {if (Centered) Super. Indo Focus Change (Focused); } @ Override Public Boolean Focus () {Return is true; }

    Guidance with a translation in Linq to Xml -


    Does anyone explain why it means:

      .... An example of the  

    parameter should be known as please.

    It has also been found to be a bit tricky naming (function selector)

    this question. Suggestions would also be appreciated.

    This is a function that takes excelment as argument and returns an XElement, hence the example To:

      Public XElement Some functions (excel logic) {XElement someNewElement = New XElement (); ... // Do something with something, withdraw account logic, something newElement; } Fx & lt; XElement, XElement & gt; VariableForFunction = Some Functions; ..... Select (variableform);  

    I'm not sure that you have to specify it in the first one variable, then you might do this:

      .... (VariableForFunction);  

    Give it a try (and tell me it works :) :)

    For more information, here is the MSDN, it also states that How to use Representatives:

    function & lt; XElement, XElement & gt; VariableForFunction = Representative (excel logic) {.... // Create a new XElement Return NewxAlert; }

    For example, how to use Lambda:

    function

    Or, in this example, use the lambda directly:

      .... Select (s => {.... ; / /> 


    sql server - The INSERT statement conflicted with the FOREIGN KEY constraint -


    त्रुटि: System.Data.SqlClient.SqlException: INSERT कथन विदेशी कुंजी बाधा "FK__Item__order__3AE27131" के साथ विरोधाभासी है। डेटाबेस "pmall" में हुई संघर्ष, तालिका "dbo.ItemSaved", कॉलम 'आईडी'।

    यहां मेरी तालिका है:

    आइटमसाथ यूनिट

    • आईडी
    • मद आईडी (इस तालिका में आइटम को एफक में सेट किया गया है)
    • ... आदि

    यहां है मेरी डालने बयान:

      ItemSavedUnits में डालने (ItemID, नाम, मूल्य) का चयन ItemID, नाम, मूल्य ItemUnits जहां ItemID = 92,439  

    मैं डॉन से ' टी वास्तव में समझने क्यों अगर मैं ItemSavedUnits.ItemID पर एक FK बाधा कि Item.ItemID और ItemUnits से संबंधित है बगैर किसी अड़चन बिल्कुल है कारण है कि मैं ItemSavedUnits में डालने में कोई समस्या हो रही है। ItemID मैं सम्मिलित करने की कोशिश कर रहा हूँ आइटम तालिका में मौजूद है।

    क्या आप बिल्कुल यह सुनिश्चित कर रहे हैं कि ItemId आइटम तालिका में मौजूद 92439 मौजूद है, और केवल आइटम यूनिट्स में ही नहीं?

    या

    क्या आपके चयन के बयान निरर्थक लौट रहे हैं?


    c# - How to find the Form that hosts a particular a Winforms Control within the Control? -


    I want to be able to access whatever I control in my control code, such as:

      myControl.ParentForm  

    Is this possible? If so, then how?

    You can use the control method:

      form Parent = myControl.FindForm ();  

    How do I alphabetically sort a generic List(Of String) in VB.NET? -


    I created and populated the generic list of strings like this:

      Dim MyList New MyList.Add ("Beta") MyList.Add ("Echo") MyList.Add ("Charlie") MyList.Add ("alpha") MyList.Add ("Delta") as the list (of the string)  

    Now I want to order it

    Does this not work?

      MyList.Sort ()  

    haskell - Inferred type appears to detect an infinite loop, but what's really happening? -


    In Andrew Koinig, the author uses the implementation of ML as a learning exercise and has a & ldquo; Incorrect & rdquo; Type assessment

    For my surprise, the compiler has a type of

      'a list - & gt; In other words, this sort function accepts any type of list and returns a list of integers.  

    It is impossible that the output input should be sorted; How could this possibly be of a different type? The reader will definitely familiarize his first impulse: I wonder if I have uncovered a bug in the compiler!

    After thinking about something else about it, I realized that there is another way in which the function can ignore the argument: Probably sometimes it did not return at all. Indeed, when I do it Tried it, then it happened exactly: sort (blue) returned zero , but sorting any blank list would be in an infinite re-key loop

    When translated into Haskell

      split [] = ([], []) partition Split (x: y: xs) = (x: s1, y: s2) where (s1, s2) = partition xs merge xs [] = xs merge [] ys = [x] Ys merge xx @ (x: xs) yy @ (y: ys) | X & lt; Y = x: merge xs yy | Otherwise = y: merge xx ys merge [] = [] Merge xs = merge (mergeresport p) where (p, q) = partition xs  

    GHC is of the same type Guess:

      * Main & gt; : Merger of T Merge: (Ard A) => [T] - & gt; [A]  

    How does this type of estimate?

    This is actually a remarkable example; An infinite loop is being detected, essentially, compiled time ! In this example there is nothing special about Hindley-Milner's conclusion; It normally does the same.

    Note that ghc gets the split and merge correctly:

      * main & Gt; : T split split :: [A] - & gt; ([A], [A]) * Men & gt; : T Merge Merge :: (Ord T) = & gt; [T] - & gt; [T] - & gt; [T]  

    Now when it comes to mergeresort , it is normally a function, 1 → t 2 for some type 1 and 2 . Then it looks at the first row:

      Mergeresort [] = []  

    and discover that 1 and < Sub>> 2 list type, T 1 = and 2 = [t 4 ]. Therefore, mergeart should be a function [t 3 ] → [t 4 ]. Next line

      Mergers Xs = Merge (Merge), where (P, Q) = partition xs  

    it states that: / P >

    This is the reason why you:

      * Maine & gt; : Merger of T Merge: (Ard A) => [T] - & gt; [A]  

    In the context of logical conclusions is equal to the algorithm described above, but the specific sequence of the steps of the algorithm is as follows, for example, given on the Wikipedia page.)


    C# How to make a generic class? -


    How can I make this general? Class atomic reference (private object _ value; public atomic reference) {_value = new object ();} public atomic reference (object value) {optimistic set (value);} public object comparison Osset (object new value) {return interlock.change (referee_value, new vele)}} Public Zero OptimisticSet {object} while {_value == Interlocked.CompareExchange (reference _value, _value, newValue))} public Obtain object () {return _value;}}

    My unsuccessful attempt:

      class atomic references  {private t _value; public atomic reference} {} public atomic reference (t value) {set (value);} Public T Compare EndSet (T New Value) {// _value is not an object that can be interlocked returns. Exchange (ref _ value, new value);} Public Zero OptimisticSet (T newValue) {// operator Can not use with == type T do {} while (_value == compare Andset (newValue));} Get Public T () {Return _value; }}  

    You need T for reference Type, like this:

    class atomic references & lt; T & gt; Where T: Square {Private T _value; Public atomic references () {} Public Nuclear Reference (T-Value) {Optimized Set (Value); } Public T Compare Endset (T New Vale) {Return Interlocked.Exchange (ref_value, newValue); } Public Zero OptimisticSet (T newValue) {while (_value == Compare and set newvalue); } Get Public T () {Return _value; }} Edit : I would suggest that you change the ways of a property: {Quantity of returns; } Set {while (_value == compare and set (value)); }}

    null - Should References in Object-Oriented Programming Languages be Non-Nullable by Default? -


    Null signals are described as "". Some languages ​​have reference types that can not be assigned to zero values.

    I wonder if there is a reference to creating a new object-oriented language that should prevent the default behavior from freeing empty space. Its special edition can be used to override this behavior. For example:

      MyClass notNullable = new MyClass (); Notline = null; // Error! // a la c #, where "t?" Means "null & lt; T & gt;" my class? Drains = new MyClass (); Drain = null; // permission  

    So my question is, is there any reason to do this in a new programming language?

    Edit:

    I wanted to add that it was indicated that in unstarred types there is a special problem used in ARAS. I also want to thank all for all my useful insights. It is very helpful, sorry that I can choose only one answer.

    The main barrier I have non-default falsifiable reference type is that some part of the programming community is set -Set-usage pattern:

      x = new foo () x.Prop & lt; - Some InitValue x.DoSomething ()  

    For overloaded constructors:

      x = new fu (some inlay values) x.DoSomething () < / Code> 

    and this API designer leaves the bind in relation to the initial value of the example frequency, which may otherwise be blank.

    Of course, just like the 'tap', the set-set-using pattern makes a lot of meaningless, prevents the object status and useful inventions, so get rid of this is actually a curse rather than a a boon. However this API affects some of the design methods in such a way that many people are unfamiliar, so it is not lightweight.

    But overall, yes, if there is a great catastrophe that destroys all existing languages ​​and compilers, only can expect that when we rebuild we will not repeat this particular mistake . Emptiness is an exception, not a rule!


    Which groups should participate in Agile? -


    We have programmers, front end developers, designers and UX teams in my company who participate in all playful groups. I am not a playful master, but I understood that all members of the team should be able to do any work. Due to the designers, the UX team, friends and developers, and the system manager, how long will it take to undertake a backend task? I think how difficult it is to take time I can barely know! So my question is, am I being so strict? Can it work in a playful environment?

    The basic concept is wrong ... all the members should be able to work in stories. Total cross - No functionality ... A developer may be unable to suddenly become a UI designer.

    And if the team per member is limited to 7-10, then that group should be divided accordingly.


    add in - Highlight text from Visual Studio 2008 add-in -


    I am writing another code coverage tool for .NET with the integration of Visual Studio 2008. Everything goes well except one thing: I can not find any way to highlight some code sections.

    I need this to inform the user about the blocks covered and covered.
    You can see an example of the feature that you want on the next screenshot. (From the native VS code coverage toolet):

    Can someone provide me the code snippet that highlights the text in the code view window?

    I have found the answer

    >

    , see the code given below:

      // Retrieving IVsTextManager and id Diet 2 applicationObject = ...; // Receive it during the Inline In Microsoft Microsoft. Visual Studio OLE.Interop.IServiceProvider serviceProvider = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider) applicationObject; Guid SID = typeof (SVsTextManager) Dog; Guid Iid = Typ (IVsTextManager). IntPtr output; ServiceProvider.QueryService (Referred SID, Ref IID, Out output); IVsTextManagerTermmanager = (IVsTextManager) Marshall. GetObjectForIUnknown (output); Int Highlight; Guide Hightguide = ...; // Your highlighted text style GUIDE text MANAGER.GetRegisteredMarkerTypeID (Ref Highlight, Out Highlighted AID); // Highlighting Text Block in Active View IVsTextView View; Int result = text manager. GetActiveView (0, blank, see out); IVsTextLines buffer; See. Getbuffer (outside buffer); Buffer Creteline Marker (Highlights, Startlines, Start Columns, Endlines, And Columns, Blanks, Blanks);  

    More examples can be found.


    Python time comparison -


    How do I compare time in Python?

    I think the date can be computed and there is also "TimeDelta", but I am struggling to find out the current time (date time.Nan ()) before Check the date, regardless of the date, compared to a specified time (like 8 o'clock).

    You can not compare a specific time (like "now ") Against an unpublished recurring event (8 days happens every day).

    You can see that now today's is before or after 8 o'clock:

      & gt; & Gt; & Gt; Import Date Time & gt; & Gt; & Gt; Now = datetime.datetime.now () & gt; & Gt; & Gt; Today at 8 o'clock = now Location (hour = 8, min = 0, second = 0, microcond = 0)> gt; & Gt; & Gt; Now & lt; Today 8:00 truth & gt; & Gt; & Gt; Now == today 8am false & gt; & Gt; & Gt; Now & gt; Today is wrong 8:00  

    c# - What are the best practices for class libraries using dependency injection for internal operations? -


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

    • 4 जवाब

    मुझे किस बारे में सावधान रहना चाहिए जब आंतरिक निर्भरता इंजेक्शन का उपयोग करने के लिए एक कक्षा पुस्तकालय जटिल बनाते हैं?

    यह मानते हुए कि यह कैसल विंडसर का उपयोग करेगा (एक उदाहरण के रूप में), कंटेनर को कॉन्फ़िगर करने के लिए सबसे अच्छा स्थान / तरीका क्या होगा, का उपयोग सरल कंसोल एप्लिकेशन (कोई डि के साथ), एक ही कंटेनर (कैसल विंडसर) का उपयोग करने वाले वेब फ़ॉर्म और एक अलग कंटेनर (एनआईएनजेक्स्ट) का उपयोग करके वेब ऐप द्वारा किया जाएगा?

    मैं यहां उपयोग करूंगा: लाइब्रेरी में, एक सार्वजनिक पद्धति का सार्वजनिक वर्ग पर खुलासा करें जो कि कंटेनर आरंभीकरण (जैसे कि एक सरल आरंभ करें () ), और केवल आंतरिक पुस्तकालय में कैसल विंडसर का उपयोग करें, ताकि पुस्तकालय ग्राहकों को यह भी पता न हो कि आप इसका उपयोग कर रहे हैं।


    save datetime in registry using installer class during installation of C#.NET Setup -


    I want to create a setup in C # .NET as a trial version. So I installed the registry on the date of installation I want to save and check the validity of the trial version. I tried to use the installer class. But I do not know the exact method of storing the product's date time. This code can be explained with examples.

    Thank you in advance

    Most of the current date add-on to the registry in a setup project The easiest way is as follows:

    1. Right-click your setup project in Solution Explorer, select 'View', select 'Registry'
    2. HKEY_LOCAL_MACHINE Open , software, [Creator] key
    3. Right-click between the screen (where you see a name / value grid), And select new, string value
    4. Change the name to your liking Value # 1 and right-click and open the property window
    5. In the Properties window, the most likely solution is from Explorer Enter [date] in the form of value, with parentheses below!
    6. Create your setup, run setup.exe from your debug / release wall and complete the setup.
    7. Open Regis, browse on HKEY_LOCAL_MACHINE \ Software \ (your 'company name')
    8. If everything is okay, The name / value will see the current date in the pair :). If not, then reading the steps again and repeating or commenting on my answer where and what is wrong

    svn - Managed (.NET) Subversion Server -


    I fully know that many clients libraries to connect to an SVN repo Managing copies of work etc. However, I'm looking for implementations of subversion server for networks, or (a cover around some low-level code).

    Is someone asking or something I'm asking for (well, I'm sure, because I understand how much effort will be to make an SVN server from scratch) .

    If the server is a free subversion server for Windows ... Not sure whether it is enough That's you later though.

    Kindness,

    Charity


    c# - Possible authentication problem? Loading a JSON via WebClient in Silverlight 4 -


    I have been playing with Silverlight 4, and when my page loads, I'd call

    < Pre> StartGate ("me / people /", new openred compliant Avent handler (loadloaded data released));

    I have defined as the

      private void beginGet (string endpoint, OpenReadCompletedEventHandler callback) {WebClient WC = new WebClient (); Wc.Credentials = New network credentials (username, password); Wc.OpenReadCompleted + = Callback; Wc.OpenReadAsync (new url (baseURL + endpoint)); }  

    and continueLoadStamData ()

      void continueLoadStamData (object sender, OpenReadCompletedEventArgs e) {JSONObject root = (JSONObject) JsonObject.Load (e.Result) ; }  

    My problem is that when I e Receives I, it throws an exception, it had tried to do the same exception that I get when I use WebRequest req = ...; Req.Credentials = new network credentials (username, password) :

      {System.Reflection.TargetInvocationException: during an exceptional operation, result invalid. Check the inner exception for the exception details. --- & gt; System.Net.WebException: An exception occurred during a web client request. --- & gt; System.NotImplementedException: This property has not been implemented by this class. System.Net.WebRequest.set_Credentials (ICredentials Price) on System.Net.WebClient.OpenReadAsync on System.Net.WebClient.GetWebRequest (URI address) at (URI address, object userToken) --- the end of the inner exception stack trace - --- End of the internal exception stack trace --- on System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIf () System.Net.OpenReadCompletedEventArgs.get_Result () JSONSample.MainPage.continueLoadStamData (Object Sender, OpenReadCompletedEventArgs e) on System.Net. WebClient.OnOpenReadCompleted (OpenReadCompletedEventArgs e) on System.Net.WebClient.OpenReadOperationCompleted (object arguments)}  

    Have any idea of ​​what's going on, how I believe Land that can make basic authentication

    Nick

    P > Depending on you, your lines are missing some lines of code in the gate method.

      Private zero startGet (string endpoint, OpenReadCompletedEventHandler callback) {WebRequest.RegisterPrefix: something like this should be done ("http: //", System.Net.Browser.WebRequestCreator.ClientHttp) ; Webclient wc = new webclient (); Wc.Credentials = New network credentials (username, password); Wc.UseDefaultCredentials = false; Wc.OpenReadCompleted + = Callback; Wc.OpenReadAsync (new url (baseURL + endpoint)); }  

    In addition, if you are just trying to get JSON from the server, then you should be able to use OpenStoreAsync instead of OpenReadAsync to make things easier. .


    Asp.net, directly assigning properties from value? -


    व्यक्त करने का एक तरीका है

      & lt;% objControl.ObjProp = Objvar; & Gt%; & Lt; my: नियंत्रण आईडी = "objControl" runat = "server" / & gt;  

    ऐसा कुछ, एक पंक्ति में? और ओब्जावीर को स्ट्रिंग के रूप में नहीं छोड़कर?

      & lt; my: कंट्रोल आईडी = "objControl" runat = "server" ObjProp = Objvar / & gt;  

    जब तक आप एक डेटाबेस संदर्भ में नहीं होते हैं, ऐसा करने के लिए कोई आसान तरीका नहीं है । यदि यह एक डाटाबेस संदर्भ है (जैसे पुनरावर्तक / ग्रिडव्यू में) आप बस ObjProp = '& lt;% # ObjVar% & gt;' जा सकते हैं, लेकिन उस संदर्भ के बाहर आप इसे दुर्भाग्य से इनलाइन नहीं कर सकते।


    java - Sharing a static object between a servlet and a webservice -


    I have a servicelet that receives http receipt requests that I would like to be able to share an object that its It also uses a webservice im developing they are both in the same web app container on the same tomcat server, I am not sure how to do any idea of ​​this? You can store things in WebFile by storing them as attributes ( setAttribute

    / getAttribute ) you can create an object in a codification, store it in ServletContext , and then retrieve it and it can You can use it from your web service and servlet.


    Oracle Trigger Updating a field on an Insert or an Update -


    For some reason I am running an empty about doing something like this.

    I have a table that looks like this:

      UserID | Name | Date added | Last update ------------------------------------------------ - - 1 | James Q | 1/1/2009 |  

    If I include or update the last updated field, then it should update sysdate. How will I go about doing something like this?

      Add or trigger your_trigger_name before or trigger on your_table for each line Start : New.LastUpdated: = sysdate; End;  

    Try it was not an Oracle server in my hand, but I hope I got the right to syntax.


    visual studio 2008 - .Net multitargeting gone wrong? -


    V.S. In 2008 I have a small dummy project, which only has the following code file

       

    using the system; Namespace Frameworktist {Internal Fixed Class MessageCenture {Structure Test Structure} {Public Input Estates; } Public static zero main () {Test Structure pMgmtProps = New Test Structure {aStatus = IntPtr.Zero}; }}}

    This project has been set to target Framework 2.0, even manually set up Toolwarson 2.0. Now this project is just doing fine from VS and fails (by using csc.exe 2.0) from the command line.

    C: \ wINDOWS \ Microsoft.NET \ framework \ v2.0.50727 \ csc.exe / noconfig / Nowarn: 1701,1702 / errorReport: signal / warning: 4 / define: DEBUG; TRACE /reference:C::WINDOWS\Microsoft.NET\Framework.v2.0.50727.aspy.data.dll/Reg: C: \ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ System.dll / reference: C: \ WINDOWS \ Microsoft.NET.Framework \ v2.0.50727 \ System.Xml.dll / debug + / debug: full / file-side: 512 / customization- / out: obj \ Debug \ FrameworkTest.exe / target: exe Class1.cs Properties \ assemblyInfo.cs

    The question now is why does it compile from VS? In the case of the compilation of the CMD line, this should fail. The same source failed in the VS-2005 project (correct).

    Multi-targeting means CLR --Version-targeting, C # -Display-Targeting


    javascript - Performing calculations on form inputs -


    I created a food menu with a webpage checkbox and radio box. I use PHP to get results from a MySQL database table. An example of the code below shows how things are currently set:

    PHP includes connecting to the database:

       

    An example of one of PHP is:

      $ host = "localhost"; // hostname $ username = "root"; // Enter mysql username here code $ password = "admin2"; // MySQL Password Enter code here $ db_name = "food"; // Database Name Enter the code here $ tbl_name = "fruit"; // table name mysql_connect ("$ host", "$ username", "$ password") or die ("can not connect"); Mysql_select_db ("$ db_name") or die ("can not choose DB"); $ Sql ​​= "SELECT * FROM $ tbl_name"; $ Result_fruits = mysql_query ($ SQL);  

    Input box on the main page that returns table data (in each category it has its own MySQL table):

      & lt ;? Php while ($ line = mysql_fetch_array ($ result_fruits)) {? & Gt; & Lt; Input type = "radio" name = "fruit []" id = "& lt;? $ Rows ['item name'];? & Gt; value =" & lt;? Echo $ rows ['label'] ;? & Gt; "class =" green-border-fruit "/> & lt ;? php while ($ rows = mysql_fetch_array ($ result_cheese)) {? & Gt; input type =" radio "name =" Pie [] "id =" & lt;? $ Rows ['item name'] ;? & Gt; Value = "& lt;? $ Rows echo ['labels'] ;? & gt;" Class = "green-border-paneer" /> & Lt ;? Php while ($ rows = mysql_fetch_array ($ result_desert)) {? & Gt; & Lt; Input type = "radio" name = "desert []" id = "& lt;? $ Rows ['item name'];? & Gt; value =" & lt;? Echo $ rows ['label'] ;? For example, the code above will return:  
         Apple $ 2 & lt; br & gt; Orange $ 1 & lt; br & gt; Grapes $ 2 & lt; td & gt; Swiss $ 3 & lt; / br & gt; & lt; / td & gt; Blue Paneer $ 1.50 & lt; br & gt; Feta $ 2.20 Cake $ 5 
    $ 4 Pieces $ 3.50

    In a checkbox I All checked items are required.

    EX: This will be the amount displayed if (apple, orange, blue)

    TOTAL - $ 8.50

    Any help will be greatly appreciated.

    I use jQuery to select the radio And then I use all the values ​​and put the result with .html in the textfield.

    Check the radio button:

    $ value ($ value) [Name = radioName]: checked '). Val ()

    and you can loop with all the radio buttons:

      $ ('. ClassName '). Combined example:  
      var sum = 0; $ ('radio button') (each (function () {// work here}  

    . ($ (This (': checked')) {sum = sum + $ (this) .val ();} $ ("# idTextfield"). Html ("Total: "+ Sum +" $ ");


    php - How do I perform 2 actions with 1 submit button? -


    I have 1 submit button in my form but there are a lot of posts that need to be done except 2 tasks, except that There are 2 different types of actions in this issue, first to post on a .php file, and the second action must be posted to MailChimp.

    For example, here's a form:

      & lt; Form id = "form-signup_v1" name = "form-signup_v1" method = "post" action = "http://mydomain.us10.list-manage2.com/subscribe/post"> & Lt; Input type = "hidden" name = "U" value = "fadf23525acar3fad" & gt; & Lt; Input type = "hidden" name = "id" value = "3234davca4er" & gt; & Lt; Input id = "MERGE0" name = "MERGE0" placeholder = "my email address" type = "text" data-verification = "[EMAIL]" & gt; & Lt; Button class = 'buttonmain' id = "buttoned" type = "submit" & gt; Submit & lt; / Button & gt; & Lt; / Form & gt;  

    Ideally, I want this form in action = "login.php" and then anyway on http://mydomain.us10.list-manage2.com Post / Subscribe / Post with required fields:

      & lt; Input type = "hidden" name = "u" value = "fadf23525acar3fad" & gt; & Lt; Input type = "hidden" name = "id" value = "3234davca4er" & gt;  

    How can I do 1 to submit these 2 tasks?

    In advance thank you

    I login It is resolved by adding some additional PHP code to the php file. I used curls hope it helps someone


    batch file - Volume decrease program (win7) -


    Usually when I go to sleep, I leave my speaker and I leave my music, but After about 30 minutes, the music gets a lot, so I have to get up and reduce it ... (I am using foobar2000, if she helps)

    ID wants to know Is there any program, which will be implemented for example 30min and the volume is low, is it possible? (And then probably will continue to do that for every 5 minutes the volume reaches 0?)

    Thank you in advance to all,

    <

    < P> It is possible, but you need either third-party utility, or Windows scripting host (VBSScript or JScript). In the Windows scripting host language, use WshShell.SendKeys for the volume down (0xAE).

    Save it from the .bat extension and run it.

      @if (@CodeSection == @ batch) @theno off cscript / nologo / e: jscript "% ~ f0" geto: EOF @end // End batch part / start jscript chimer ware OSH = WSH Crete object ('Wscript shell'); 25 min early sleep WSH.Sleep (25 * 60 * 1000); // After 10 loop iterations, the volume is probably 0. (var i = 0; i & lt; 10; i ++) {// Other 5 (ISH) minutes WSH Sleep (5 * 60 * 1000 - 10000); WSH.Echo ('Decreasing quantity ...'); For a period of 10 seconds, press 5 times more for (var j = 0; j & lt; 5; j ++); {If (j) WSH.Sleep (2500); OSH.SendKeys (String.fromCharCode (0xAE)); }}  

    (Based on.)


    C++ Can you keep a double or float with trailing zeroes (NOT a string or output)? -


    I know that by using the output precision, or after converting to a string, leaving or adding indexed zeros There are several ways.

    But, there is a way to keep zero on the actual zero, float or any other data type, which at the end holds 0. 0. like 1! = .10

    The reason, zero shows that we know that the next digit is a zero. 1 shows that we all know that there is up to 1 and not later.

    Of course I can convert to string or create a custom class that monitors it. I'm using a lot of couples though, and I want to leave something like this that is possible. I think there is all the ways to mess with wire and output. Something like double Precision (x) would be good =)

    Thanks! IEE's floating-point formats do not have many ways to store (finite, cement, non-zero) values, otherwise you can not internalize that numerical variable.

    You will need to keep a pair of (value, exact) ( (value, uncertainty) - which is most important to you ).


    How to describe duration in Android? -


    I am writing a small app and I have to write the period of the game event in i18n. Using the preetytime library for a date, but when I try to use datumytles or pretium, I have problems. For example, I want to say this period is 2 minutes. I need some way of passing the library which supports the I-18N and accepts milliseconds and returns the chairs.

    We have the following in Android:

      com.android.internal.R.plurals.duration_minutes  

    But I Can not access. Is there any way to use it correctly and not write your own plural for all languages?

    Thank you

    I'm not sure that you have the Android-DatUtils and PrettyTime-Library On what issue are you talking about? But I'm sure Android-DateUtils does not fully manage the plural rules of different languages ​​(especially Slavic languages ​​or Arabic) because it knows only singular and a plural form that is very easy) For example, see PrettyTime- Regarding the library, if you consider Arabic, the same objection is valid.

    My recommendation:

    See my library (a new one) R-Library After that you can use this code to process on millisecond input and to create a localized min-string:

      // Input long mills = 1770123; // Create a Duration Period & amp; ClockUnit & gt; Period = period. (Million, clock unit. MILIS); // normalization (round) minute duration = period With (ClockUnit.MINUTES.rounded ()); String s = PrettyTime.of (Locale.ENGLISH). Print (period, textwidth.WIDE); Println (s); // 30 min  

    Examples for Korean (Answer to Gaibe Savchen's comment):

      string s = PrettyTime.of (new locale (" ")). Print (duration, textual wide); Println (s); // 30 분 (Korean translation "30 minutes")  

    Examples for Arabic (right to left):

      string s = PrettyTime.of ( New locale ("AR")). Print (duration, textual wide); Println (s); This solution currently supports  56 languages ​​ (more than the preetytime-library) and three text width (full, short or narrow). Accurate plural handling is included automatically. Time 4A uses its language resources based on CLDR-data (independent of android). But you are free to override those resources by defining your assets in your property (UTF-8). 

    Regarding generalization: I have just shown the version that you described in your question. However, there are several ways to normalize time in Time 4A (J). This will give you more idea how to use that feature.

    If you still miss a few languages, just tell me, and I will support it in the next editions of Time 4A. Currently supported (in ISO-639-1-notation):

    am ar az be bg bs ca cs da en es from the first person and h Lt LV Mk MS NB NL NL PL RTU R SU SL SL SL SL SL SR SR SV V T T UR UK U UZ VIP (and some country-specific locations, for example ZTH, NGB etc) )


    Python concordance command in NLTK -


    I have a question about the Python encoded command in the NLTK. First of all, I came through a simple example: already. Now, I have my own .txt file and I want to do the same order. I have a list called "Text List" and I want to search for the word "CNA" so that I enter the command

      textList.concordance ('CNA')  

    However, I got the error

      AttributeError: 'List' object does not have any attribute 'Integration'  

    In the example, is there any Do not have a list? I wonder what's going on here

    .concordance () There is a special nltk function. So you can not call it on any dragon object (like your list).

    More specifically: .concordance () is a way

    Basically, if you type .concordance () If you want to use, you have to first need to instantize a text object, and then call it on that object.

    A text is usually started with a given document or corpus. Like: import nltk.corpus from import nltk.text text moby = text (nltk.corpus.gutenberg.words ('melville-moby_dick.txt'))

    Unity (word, width = 79, rows = 25)

    Print a uniformity for the word with the specified reference window. Word match is not case-sensitive.

    Then I will do something like this (not tested)

      import nltk Text from nltk.text import text textList = text (nltk.corpus) .gutenberg.words ('your file name is here .txt')) textList.concordance ('cnA')  

    Grails 3.0 app starts on unexpected path. How to fix? -


    I'm just starting to use Grails 3.0 RC1 and can detect a small problem. After the run-app command, my application path is available on localhost: 8080, but Grails 2.x was the local host by default on the right path: 8080 / appname /. In the document for Grails 3.0, I see it, the application must start on the local host: 8080 / appname / Why in my case / appname / suffix lost? I have a very simple test application and did not tune config files. How do I solve this problem? According to

    , you will configure:

      server.context -  Path = # reference path, '/'  

    For example, add an error to your application.yml :

      : 'Context-path': '/ lol'  

    In context Qualified


    asp.net mvc - 403 forbidden in MVC application when trying to browse directory without controller -


    I have a directory in my project that is "~ // API"

    No controller in it Is connected with it

    Its purpose is. Json files, accessed by an external service.

    I'm worried that when I go to configure this external service, it is not able to see a full file list; I get a 403 forbidden error when I browse the directory.

    My external service (ICIADA) will need full access to my API directory so that all in the directory. JSO files can be monitored continuously, which can be changed and added, so specifying a list of files to check will not be enough.

    However, if I do this then I should see my file properly.

    Does any content directory file as a listing? Or is there a security setting on that server which prevents directory contents from being listed? (I'm running Server Admin IIS 8.5)

    You can browse the directory using your web.config

    & Lt; /system.webServer> & Lt; / Location & gt; & Lt; / Configuration & gt;

    java - 500 error after Controller return statement -


    I am using spring as my MVC framework, and one of my controllers gives me 500 errors. However, I have debug this error and found that since the controller return statement 500 error has been thrown, so no error has been thrown to the server side. I am returning a map where the object is a custom class. I Jackson is imported correctly, and this custom class has a toString method (not sure that it is necessary). In addition, this same style of controller return works for other methods. I am unsure why 500 error is thrown. The code snippet is down thanks!

      @RequestMapping (value = "/ method", method = RequestMethod.GET) @ ResponseBodyBody public map & lt; String, Object & gt; Method () {Hashmap < String, Object & gt; RetMap = new hashmap & lt; & Gt; (); Result result = service.method (); RetMap.put ("Results", Results); Return RetMap; }  

    So I have discovered this problem in my project Was defined, which was imported through Maven. Apparently Jackson does not pick up classes from other imported projects, so I created a DTO class in my web project and changed it to DTO before returning to the controller. Now it works perfectly!

    EDIT: Does anyone know how to go to Jackson to scan sections with imported projects?


    javascript - url in css get rewritten with angular -


    url (#url) is a problem with the base set and html5mode with svgs in itemprop = "text">

    filter as : url (/ base / # url) .

    I have tried to disable the html5 mode and remove the base, but whenever the angular bootstrap writes this URL again

    when SVG exists , Then the angular is loading, it will show the right clip / filter, however whatever may happen that once the angular iClassia starts. Does anyone know an alternate solution? I have tried to use full file path before trying to target it as well as disable the base.

    By setting the base I mean & lt; Base href = '/' & gt; which should work

    Inspection ahead of this problem shows that when angular is started, then it is a SVG

    before angular

      & lt; Svg & gt; & Lt; Defs & gt; & Lt; Filter & gt; & Lt; / Filter & gt; & Lt; / Defs & gt; & Lt; Ch & gt; & Lt; Path & gt; & Lt; / G> & Lt; / Svg & gt;  

    After bootstrap

      & lt; Svg & gt; & Lt; Defs & gt; & Lt; Svg class = 'filter' & gt; & Lt; Path & gt; & Lt; / Svg & gt; & Lt; / Defs & gt; & Lt; Ch & gt; & Lt; Path & gt; & Lt; / G> & Lt; / Svg & gt;  

    I think you set the wrong base attribute in the head of the index file .

    Be sure to check all relative links, images, scripts etc. Angle is required to specify the URL base at the top of your main HTML file, unless the html5Mode.requireBase is set to false. With the passage in the $ locationProvider.html5Mode () in the Html5Mode definition object, the relative url will always be resolved for this base URL, even if the initial URL of the document is different.


    Python: How to properly deal with NaN's in a pandas DataFrame for feature selection in scikit-learn -


    This is related to the question I posted, but it is more specific and simple.

    I have a panda dataframe whose index is a unique user identifier, the column corresponds to unique events, and value 1 (present), 0 (not present), or Nain (which was not invited / Was not relevant). The matrix is ​​quite rare in relation to NAN: there are several hundred incidents and most users are invited only for maximum tens.

    I created some extra columns to measure "success", which I just attended to the relative invitation:

      my_data ['invite'] = my_data.count ( Axis = 1) my_data ['present'] = my_data.sum (axis = 1) -my_data ['My goal is to make the feature selection right now on events / columns, my goal is to start [my_data [' success'] = My_data ['present'] / my_data ['invited']  

    with the most basic variant-based method: remove people with low variance then I have a linear on events I see Ratigmn and I keep only the large multiples and those with small P-values.

    But my problem is that I have many nan and I am not sure how much better to deal with them, the same as scikit-learn methods Give them errors due to them. One idea that is not present in '1' and is not 'Invited with 0' is in place, but I worry that it will change the importance of events.

    Can someone suggest that all of these NANs, without changing the statistical significance of each feature / event?

    Edit : I would like to add that I am happy to change my metric for "success" from above, if appropriate is appropriate which will allow me to go Ahead with I am just trying to determine which incidents are effective in capturing user interest, it is very open and it is mostly an exercise to practice convenience selection.

    Thank you!

    If I understand correctly, then you would not want to clear your data from the nan, within it Without altering statistical properties - so that you can run some analysis afterwords.

    I've actually used something similar recently, a simple approach that you might be interested in, using Scalarn's 'Imputter'. As mentioned earlier, adamum is to be replaced with the meaning of a thought axis. For example, other options include the place of mediation. Some: like sklearn.preprocessing imports Impeter imp = imputer (missing_values ​​= 'NaN', strategy = 'mean', axis = 1) cleaned_data = imp Fit_transform (original_data)

    In this case, it will replace NaN with the mean in each axis (for example, we asbestone = 1). Then you can make sure to score the clear data, that you get 0 and 1.

    I will plot some histograms for the data, to check discretion that this preprocessing will make significant changes in your distribution - as we swap a large number of values ​​/ with each axis in the mode / mean <

    Links to References:

    Moving things one step forward (not enough to handle above), you can alternatively do the following:

    • To leave the event column and all the NAN numbers in your data Calculate the area after ( '1 - p') are likely to be present to participate in ( 'P'). [To wit. P = To be present / not present (not present)]
    • Then by replacing your NaN number in each event column, through the random number generated from the Bernoulli distribution, 'Np:

      import np as np

      n = 1 # number of tests

      P = 0.25 # Replace the expected probability of each lawsuit (i.e. that is what you attended / have got)

      s = np.random.binomial (n, p, 1000)

      # s is now a bunch of random 1 and 0, you

    Again, this is not right in itself, yet you still have to slow down your data in a little bit or a little bit or a little bit. Moving at speed (for example, more precise approaches will be based on the dependence of your data in events for each user) - But sampling is largely arbitrarily replaced with matching delivery, at least mean value etc. From a Should be strong.

    Hope it helps!


    Running Script in CMD Works but when ran using Process.Start() in C# python script fails -


    मेरे पास एक अजगर स्क्रिप्ट है, changeDates.py , जो सफलतापूर्वक सी # प्रोग्राम के बाहर चलाता है में आदेश द्वारा cmd:

    <कोड> अजगर changeDates.py पथ / / फ़ोल्डर में NUMBEROFMONTHS numberOfWeeks testSetsToCheck

    इन तर्कों सभी स्ट्रिंग्स हैं। नंबरऑफमोन्थ्स और नंबरओफ़ोइक्स पैथॉन स्क्रिप्ट को एक स्ट्रिंग के रूप में पारित किया जाता है, फिर स्क्रिप्ट के अंदर एक int में कनवर्ट किया जाता है।

    लेकिन अगर मैं का उपयोग कर एक ही आदेश को चलाने के लिए किए गए:

      निजी शून्य run_CMD (स्ट्रिंग cmd, स्ट्रिंग args, bool संदेशबॉक्स) {try {Console.WriteLine (cmd) ; Console.WriteLine (args); ProcessStartInfo प्रारंभ करें = नया प्रोसेस्टस्टटाइन्फ़ो (); Start.FileName = सीएमडी; Start.Arguments = args; Start.UseShellExecute = false; Start.RedirectStandardOutput = सच; (प्रक्रिया प्रक्रिया = प्रक्रिया। प्रारंभ (प्रारंभ)) का उपयोग कर ({StreamReader reader = process.StandardOutput}} {string result = reader.ReadToEnd (); Console.Write (परिणाम); }}} पकड़ (अपवाद पूर्व) {Console.WriteLine ("पैकेज की तारीखों को जांचने में त्रुटि: \ n" + पूर्व); लकड़हारा। लिखो (लकड़हारा। लेवल। एसर, "पैकेज की तारीखों को जांचने में त्रुटि: \ n" + पूर्व); }}  

    स्क्रिप्ट शुरू होता है और निम्न त्रुटि आउटपुट:

      C: \ Users \ bblashko \ दस्तावेज़ \ VisualStudio2012 \ परियोजनाओं \ Athena_Test_Automation_Fr amework \ Athena_Test_Automation_Framework \ स्क्रिप्ट \ changeDates.py C: \ Users \ \ VisualStudio2012 \ Athena_Test_Automation_Framework \ Athena_Te st_Automation_Framework \ Test_Cases 6 1 00100 Traceback (सबसे हाल कॉल पिछले) \ परियोजनाओं bblashk ओ \ दस्तावेज़: फ़ाइल "C: \ Users \ bblashko \ दस्तावेज़ \ VisualStudio2012 \ परियोजनाओं \ एथेना_टाटमा tion_framamework \ एथेना_टाईट_आटॉमेशन_फ्रेमवर्क \ स्क्रिप्ट \ changeDates.py ", रेखा 51 0, इन & lt; मॉड्यूल & gt; allFiles = checkContent (सामग्री, subdir, पूर्णांक (sys.argv [2]), पूर्णांक (sys.argv [3])) फ़ाइल "C: \ Users \ \ \ Athena_Test_Automa tion_Framework \ Athena_Test_Automation_Framework \ bblashko \ दस्तावेज़ VisualStudio2012 \ परियोजनाओं लिपियों \ ChangeDates.py ", पंक्ति 47, जांच मेंसंयंट चेक XLSX (f, सबडिअर, संख्याओफ़ोमॉन्स, संख्याऑफ़वैक) फ़ाइल" C: \ users \ bblashko \ दस्तावेज़ \ VisualStudio2012 \ Projects \ एथेना_टाइटोमा tion_framework \ एथेना_टाइटमेशन_फ्रेमवर्क \ स्क्रिप्ट \ changeDates.py ", पंक्ति 85, चेक XLSX changeDate = checkXLSXDates (salesStartDate, pubDate, प्रकार, todaydate, check date) फ़ाइल "C: \ users \ bblashko \ दस्तावेज़ \ VisualStudio2012 \ Projects \ एथेना_कास्टोमा tion_framamework \ एथेना_टाटमातन_फ्रेमवर्क \ स्क्रिप्ट \ changeDates.py", पंक्ति 15 7, चेक XLSXDates में अगर (फिर से खोज ("(\ w \ w) / (\ w \ w) / (\ w \ w \ w \ w)", salesstartDate) और re.search ("(\ w \ w) / (\ w \ डब्ल्यू) / (\ w \ w \ w \ डब्ल्यू) ", pubDate)): फ़ाइल" C: \ Python34 \ lib \ re.py ", लाइन 166, खोज बदले में _compile (पैटर्न, झंडे) .search ( स्ट्रिंग) TypeError: अपेक्षित एस Tring या बफर  

    अजगर में regex अचानक क्यों एक त्रुटि का परिणाम होगा? मैं यह कैसे तय कर सकता हूं?

    आप अपने re.search < / कोड> फ़ंक्शन एक अजगर मॉड्यूल है और जब आप अपने अजगर कोड को उसी तरह कार्यान्वित करते हैं तो वेरिएबल स्ट्रिंग सही ढंग से असाइन नहीं होता! तो सबसे पहले अजगर कुंजी शब्दों और अंतर्निहित नाम आपके चर नामों के रूप में, और इस स्थिति की सवारी पाने के लिए आपको अपने कोड में string को असाइन करने के तरीके की जांच करनी होगी!


    mysql - SQL data constraints doubts -


    In SQL, can you set a column that will be unique to the null value Allows?

    What happens if there are several rows for that column in the null value?

    If you specify a foreign key for that column in another table, and there is a null value for the foreign key in a tube in the reference table?

    / div>

    You want a column set with a unique index as null There may be several rows with in the Mysql check the table below:

      create table 'test1' (`id` int (11) unsigned null atangment,` null Qualified 'et' (11) default null, primary key (`ID`), unique key 'null qualified' (` faucetable ')) engine = InDebbi default charge = UTF8; In the values ​​(1, zero), (2, faucet), (3, zero) in `test1` (` id`, `tapable ');  

    You can add as many records as you would like to make this table with a tap in faucetable field.

    I think I have the name faucet :).


    swift - Invalid composition error (-11841) when trying to add CATextLayer to video -


    I am trying to add text to a video, but it does not matter if I have an invalid structure error (-11841 ). I have followed the tutorials, have read through the thread and there is nothing wrong. I'm combining 3 videos, and an audio track and it works great. I'm trying to add text to the duration of the first video clip (videoStartAsset)

    Here is the code I am using:

      var mainInstruction = AVMutableVideoCompositionInstruction VideoAssetTrack = videoStartAsset.tracksWithMediaType (AVMediaTypeVideo) [0] AVAssetTrack videoLayerInstruction.setOpacity (0.0, atTime : videoStartTimeRange .duration) mainInstruction.layerInstructions = [videoLayerInstruction] var mainCompositionInst = AVMutableVideoComposition () var Prakritikakar = video AssetTrack. naturalSize var renderWidth = naturalSize.width var renderHeight = naturalSize.height main Compojisninst Krenderskele = float (UIScreen.mainScreen (). scale) main Kanpaipment Inst. RenderSize = CGSize (width: 640.0, height: 480.0) mainCompositionInst.instructions = [mainInstruction] mainCompositionInst.frameDuration = NameTextLayer = CATextLayer () nameTextLayer.font = "font" nameTextLayer.fontSize = 100 nameTextLayer.frame on CMTimeMake (1, 30) = CGRect (X: 0.0, Y: 0.0, width: NaturalSizekwidth, height? naturalSize.height) If the nameText = nameInputText .label .text {nameTextLayer.string = "text"} else {nameTextLayer.string = "default text "} NameTextLayer.alignmentMode = kCAAlignmentCenter nameTextLayer.foregroundColor. = UIColor.whiteColor () CGColor bridesmaid overlayLayer = CALayer () overlayLayer.addSublayer (nameTextLayer) overlayLayer.frame = CGRect (X: 0.0, Y: 0.0, Width: NaturalSizekwidth, height: naturalSize.height) overlayLayer.masksToBounds = true var parentLayer = CALayer () var videoLayer = CALayer () parentLayer.frame = CGRect (X: 0.0, Y: 0.0, width: NaturalSizekwidth, height: naturalSize.height) videoLayer.frame = Sijiartiaks (X: 0.0, Y: 0.0, Width: Natural Size. Width, Height: Natural Seed.) Parent Layer. AadS Slayer (Video Laure) Parent Laure Adspair (overlay layer) is the main composition main. AnimationTool = Avivio Composercore AnimatingTool (Postprocessing ASVideoLayer: Video Layer, Inner: Parenter Layer)  

    Thanks.

    "itemprop =" text ">

      AVErrorInvalidVideoComposition = -11841, you tried to perform a video structure operation which supported Is not available in iOS 5.0 and later.  

    You get more information about AV Foundation errors.


    c++ - decltype and const reference return types for strings -


    एक डेटा सदस्य, _value, को एक वर्ग में, इस प्रकार परिभाषित किया गया है:

      unique_ptr & lt; std :: स्ट्रिंग & gt; _value = nullptr;  

    निम्न संकलन नहीं करता है।

      स्वतः मिलना () const - & gt; Const decltype (* _ मान) & amp;  

    संकलक यह त्रुटि देता है:

    'const' क्वालिफायर को 'std :: basic_string & amp;' पर लागू नहीं किया जा सकता

    < P> हालांकि यदि मैं इस तरह से समारोह घोषित करता हूं:

      स्वत: getValue () const - & gt; Const remove_reference & lt; decltype (* _ value) & gt; :: टाइप & amp;;  

    यह संकलित और व्यवहार करता है जैसा कि मैं चाहता हूँ (यानी मूल रूप से एक const स्ट्रिंग देता है);

    मुझे यह अजीब लगता है क्या यह जीसीसी कम्पाइलर में एक बग हो सकता है या क्या दो घोषणाओं के बीच कुछ बुनियादी अंतर है?

    डेल्टाइप (* _ वैल्यू) सही तरीके से मूल_स्ट्राइंग के लिए मूल्यांकन करता है & amp; जो मिल गया है, इसलिए मैंने सोचा कि मैं सिर्फ इसके सामने एक कंस्ट्रक्ट को छू सकता हूं और इसे ढूंढना चाहिए, लेकिन संकलक को भ्रमित करने लगता है ...

    ध्यान दें कि मेरा इरादा मूल रूप से एक कंसोल

    ऐसा लगता है कि यह में तय हो गया था। जीसीसी 5.0 जो हम ऑनलाइन का परीक्षण कर सकते हैं लेकिन टीसी के रूप में नोट C ++ 11 मानक <कोड> 8.3.2 :

    से संदर्भ के लिए लागू होने पर नोट्स को नजरअंदाज कर दिया जाता है, सीवी-योग्य संदर्भ केवल जब तक सीवी-क्वालिफायर एक टाइप-फेफ-नाम (7.1.3, 14.1) या डेल्प्टीप-स्पेसिफायर (7.1.6.2) के उपयोग के माध्यम से पेश किया जाता है, इस स्थिति में सीवी-क्वालिफायर को अनदेखा कर दिया जाता है।


    http - REST: Update resource with unknown (server-generated) value -


    मेरे पास निम्न संरचना के साथ foo संसाधन है:

    प्राप्त करें / एफू / 1 रिटर्न:

      {"id": 1, "server-key": "abcdef", "status": "expired"}  

    स्थिति या तो सक्रिय या समाप्त हो गई हो सकती है। अगर यह की समय सीमा समाप्त हो गई है मैं चाहता हूं कि सर्वर एक नया निर्माण करे।

    आम तौर पर मैं नई कुंजी के साथ PUT / Patch Foo / 1 मुद्दा उठाता हूं, लेकिन क्लाइंट कुंजी-पीढ़ी के एल्गोरिथम को नहीं जानता है मैं बिना किसी शरीर के POST foo / 1 / server-key भी कर सकता हूं, लेकिन यह अजीब लगता है (मुझे पता है कि यह बहुत वैज्ञानिक कारण नहीं है)।

    कोई भी अच्छा विचार / प्रतिमान?

    यदि आप की समय सीमा समाप्त हो गई है, तो बस डाक कॉल को / foo पर कॉल करें किसी भी पैरामीटर और सर्वर को नई इकाई वापस करनी चाहिए (और HTTP प्रतिसाद कोड 201 होना चाहिए):

      {"id": 2, "server-key": "xyz", "status": " सक्रिय करें "}  

    अगर कुछ पुनरारंभ समाप्त हो गया है, तो इसे पुट / पैच अनुरोध द्वारा फिर से सक्रिय करने के लिए असुविधाजनक है।


    database - Mysql column count doesn't match value count fix for unattended -


    I have to load the load of files in a database, the problem occurs, over time it gets more columns < / P>

    The files are all inserted from SQLite, but I need them in MySQL, SQLIte does not provide column-names in their SQL files, so MySQL scripts are more or less columns when accidents like in the Insertion Statement

    Is this the solution? Maybe there is more than one?

    The newly added columns are in the end, so it always happens first. There is a possibility to insert the SQL-file in the temporary table, then to join the empty table (or 1 ghost record) to get the correct amount of columns, and then insert a table on each row from that table. Want data in?

    Looks like files:

      Table values ​​in INSERT (1,1, text, 2913, textile,);  

    And if the column was added then the table value (1,1, text, 2913, textile, plus-text) in INSERT like file

      ;  


    Convert YYYY-mm-dd to a specific locale name in php -


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

    • 2 जवाब

    मैं एक तिथि कैसे बदल सकता हूँ Ro_RO लोकेल में yyyy-mm-dd से माह-डीडी-य्याय प्रारूप में

    तारीख & lt; php द्वारा आउटपुट है प्रतिधारा ($ _GET ["तारीख"]);? & Gt;

    PHP से> 5.3 आप उपयोग कर सकते हैं

      $ dt = नया दिनांक समय ('2015-02-01'); // दिनांक में yyyy-mm-dd प्रारूप $ formatter = नया IntlDateFormatter ('ro_RO', IntlDateFormatter :: SHORT, IntlDateFormatter :: SHORT); // सेट करें लोकेल नाम $ formatter- & gt; setPattern ('MMMM dd yyyy'); // महीना में वापसी की तारीख- dd-yyyy प्रारूप $ formatter- & gt; प्रारूप ($ dt); // फ़ॉर्मेट की तारीख  

    इसे कार्रवाई में देखें:


    java - Ebean enhancement -


    I would like to create a small app, which uses EBI as an ORM, I have a small problem with Ebene , And increase, so I made a minimum example, which can be seen here:

    This is a small Maven project, in which a unit , and a Dao I wrote a test, where I would like to save the unit in DB. (In this example, DB is H2, the reason for being small. I tried it with MySQL, but that too was not working.)

    When I mvn clean install < / Code>, I see the following rows in the output:

      Change & gt; Pkg: com / example / entites transform & gt; CLS: Com / Examples / Entitts / BaseTT msg: Interface: Entity Interface [FET] Transactional [Fetate] Transforms & gt; CLS: Com / Example / Antivas / BentTY Message: Transform Transform & gt; CLS: Com / Example / Entitts / BaseInte msg: ... adding intercept & lt; Init & gt; In Constructor: () V Owner / Super: Java / Long / Object Transforms & gt; CLS: Com / Example / Entitts / BasePress msg: ADS () hash code () and IDE IDE index with _ebean_getIdentity () Adding: 0 Primitive: Incorrect Conversion & gt; CLS: Com / Example / Entities / BaseTT msg: Enhanced  

    So, I think my unit has been enhanced successfully.

    But when I run the test, I get the following exception:

      Test in error: test_save (com.example.daos.BaseDaoTest): type [class com.example. Entites.BaseEntity] is not a registered entity? If you do not explicitly list unit sections to use EBI, then search for them in the classpath. If the unit is in a jar, check the ebean.search.jars property in the ebean.proverties file or check ServerConfig.addJar ().  

    I can not find any solution What am I missing?

    Thank you!


    PHPUnit not running all tests when executed with coverage -


    I have a test suite which has about 50 tests - each of which test the exec When I run PHPUnit, it executes all the tests and passes them all - every time.

    But when I use the coverage, all the tests will not run, the first test runs partly and the script is removed, there is no coverage in it. Any help?

    This is my order:

      phpunit --coverage-html ./coverage --debug --verbose test /  

    My code is something like this:

      class classtoxt {function fu ($ callback) {// something asynchronously, triggered while triggering callback}} class test {function testFoo ( ) {$ Count = 1; $ Obj- & gt; Foo (new job) ($ obj- & gt; foo (new function) ($ obj-> foo (new function) ($ count = 0;});});}); // Check $ count == 0, exit If not, then sleep for a while and repeat. }}  

    I am using PHP 5.6.6

    I tried to run the same thing with PHPStorm, and in the end I used it in its console Error code found. This is what it says:

      The exit code -10373740940 (0xC0000374) has finished the process  

    For any of this error Support not found. Any help appreciated Thanks.

    If harsh mode is enabled, then you may need to annotate your tests.

    > <
      class MyTest extends PHPUnit_Framework_TestCase {/ ** * @ big * / public function test some () {// some test code here; }}  

    Get the object length in angularjs is undefined -


    How do I get an object's length?

    My object in the console looks like this:

      object {2: true, 3: true, 4: true}  

    .length me undefined . I just want to get the result = 3 for this case.

      var key = object Key (obeys instance); Var len = keys.length;  

    Where is your "length" from.

    There may be situations which I did not think about why this does not work, but you should do it, give your example.


    gnuplot - Is it possible to use row number instead of spaces to create a 2d heat map type plot? -


    I am trying to create heatmap 2 as described here:

    but empty space for it Need to be in the middle of the data, while my data looks like this:

    <0> 0 0 0 0 0 0 0 0 0 0 0 0 1 1 2 1 2 0 1 0 0 1 1 2 0 2 2 2 1 2 2 2 2 2 3 1 2 4 0 3 0 3 3 3 3 3 3 3 2 3 4 3 4 4 0 4 1 1 4 2 2 4 3 4 4 4 3

    Is GnuPhotot a way to use the number of entries as an indicator instead of a blank line, which is the 5th line 1 4 1 To make a verse and then start a new line?

    Any suggestions? If you understand correctly and you want the first two columns (or any other columns you specify, thank you

    ) determine the structure of the map / data, then new lines are not required.

      plot 


    wpf - How to animate a DataGrid height -


    सभी,

    मेरे पास एक WPF डेटाग्रिड है जिसमें एक टेम्पलेट स्तंभ परिभाषित किया गया है: < / P>

      & lt; DataGridTemplateColumn Width = "105" & gt; & LT; DataGridTemplateColumn.CellTemplate & gt; & LT; DataTemplate & gt; & Lt; स्टैकपैनेल ओरिएंटेशन = "क्षैतिज" ऊंचाई = "35" & gt; & Lt; बटन शैली = "{StaticResource tableButtonStyle}" & gt; & LT; ContentControl / & gt; & Lt; / बटन & gt; & Lt; / StackPanel & gt; & Lt; / DataTemplate & gt; & LT; /DataGridTemplateColumn.CellTemplate> & Lt; / DataGridTemplateColumn & gt;  

    बटन शैली (जो उपयोगकर्ता को एक विशिष्ट डेटा ग्रिड पंक्ति पर माउस को स्थानांतरित करने पर बटन दिखाता है) इस प्रकार है:

      & lt ;! तालिकाओं के लिए गायब बटन - & gt; & Lt; शैली x: कुंजी = "टेबल बटनटन" लक्ष्य प्रकार = "बटन" आधारितऑन = "{स्टेटिक संसाधनों {x: स्टेटिक टूलबार.बटन एसटीलेके}}" & gt; & Lt; सेटर संपदा = "दृश्यता" मान = "ढह गई" / & gt; & LT; Style.Triggers & gt; & Lt; DataTrigger बाइंडिंग = "{बाध्यकारी रिलेटिव सोरस = {रिलेटिवसॉर मोड = खोजएन्स्टार्स, एंस्टीरटाइप = {x: टाइपडेटाग्रीडआरओ}}, पथ = इस्माउथ ओवर}" मान = "सच" & gt; & Lt; सेटर संपदा = "दृश्यता" मान = "दृश्य" / & gt; & Lt; / DataTrigger & gt; & LT; /Style.Triggers> & Lt; / शैली & gt;  

    मैं डेटाग्रिड की ऊंचाई को सजीव करना चाहूंगा ताकि बटन छिपे रहें जब 'एक्स' इकाइयां ऊंची हो जाएं, या जब बटन प्रदर्शित होते हैं तो 'वाई' यूनिट ऊंची होती है। क्या यह xaml मार्कअप में हासिल किया जा सकता है?

    धन्यवाद अग्रिम!

    I पता नहीं है कि एक्सएएमएल में ऐसा करने का कोई तरीका है (मैं इसे नहीं जानता क्योंकि मैं xaml में नया हूँ)।
    लेकिन मैं कोड-पीछे के साथ क्या करूँगा मैं एक फैंसी एनीमेशन का उपयोग करता हूं, जैसे कुछ:

    <प्री> निजी स्टोरीबोर्ड एसबी = नया स्टोरीबोर्ड (); निजी डबलअनिमेशन da = नया डबल एनीमेशन (); da.From = datagrid.actualHeight; da.to = एक्स; Da.Duration = नई अवधि (टाइमस्पेन.फॉर्मसेकंड्स (0.5)); स्टोरीबोर्ड। सर्टिफिकेटप्रॉपर्टी (दा, नई प्रॉपर्टीपाथ (आपकीडेटाग्रिड। हाइगथप्रॉपर्टी)); sb.Children.Add (दा); yourDatagrid.BeginStoryboard (sb);

    और शायद आप इसे ClickEvent के अंदर प्राप्त कर सकते हैं। आशा है कि यह मदद!


    R Plyr Rename multiple columns in list of dataframes -


    Only search for Plyr Rows of tons have saved great. But I have a problem of changing another name that I can not understand.

    I have a list that has many data frames (this is a subset because actually there are 108 in the actual list).

    & gt; Str (mydata) 4 $ C11 list: 'data.frame': 8 obs. 3 variables: .. $ X: Factor w / 8 level "n> = 1", "n> = 2", ..: 1 2 3 4 5 6 7 8 .. $ n.ENSEMBLE. COVERAGE: Num [1: 8] 1 1 1 1 0.96 0.91 0.74 0.5 .. $ N. Encelable. Recall: Number [1: 8] 0.88 0.88 0.88 0.88 0.9 0.91 0.94 0.95 $ C12: 'data.frame': 8 Objects 3 variables: .. $ X: Factor w / 8 level "n> = 1", "n> = 2", ..: 1 2 3 4 5 6 7 8 .. $ n.ENSEMBLE. COVERAGE: Num [1: 8] 1 1 1 1 0.96 0.8 9 0.86 0.72 .. $ n.ENSEMBLE.RECALL: num [1: 8] 0.91 0.91 0.91 0.91 0.93 0.96 0.97 0.98 $ C13: 'data.frame': 8 Obs 3 variables: .. $ X: Factor w / 8 level "n> = 1", "n> = 2", ..: 1 2 3 4 5 6 7 8 .. $ n.ENSEMBLE .COVERAGE: Number [1: 8] 1 1 1 1 0.94 0.7 9 0.65 0.46. $ N.ENSEMBLE.RECALL: Number [1: 8] 0.85 0.85 0.85 0.85 0.88 0.9 0.92 0.91 $ C14: 'data.frame': 8 obs 3 variables: .. $ X: Factor w / 8th And "n> = 1", "n> = 2", ..: 1 2 3 4 5 6 7 8 .. $ n.ENSEMBLE.COVERAGE: Num [1: 8] 1 1 1 1 0.98 0.95 0.88 0.74 .. $ n.ENSEMBLE.RECALL: num [1: 8] 0.91 0.91 0.91 0.91 0.92 0.94 0.95 0.98

    Do I really want to get every data frame That's to join the columns with the title of dataframe. Therefore the columns in the example would be:

    C11.X , C11.n.ENSEMBLE.COVERAGE & amp; C11.n.ENSEMBLE.RECALL

    C12.X , C12.n.ENSEMBLE.COVERAGE & amp; C12.n.ENSEMBLE.RECALL

    C13.X , C13.n.ENSEMBLE.COVERAGE & amp; C13.n.ENSEMBLE.RECALL

    C14.X , C14.n.ENSEMBLE.COVERAGE & amp; C14.n.ENSEMBLE.RECALL

    Can someone suggest a brilliant approach to change the name of this column?

    bash - How To Eliminate Duplicate Results? -


    I have written a bash script to check / etc / fstab, fsck option (last column)

    Enable <1> for <1> - 0 - disable

    1 - $ (cat / etc / fstab | grep -v 'proc')

      # ! / Bin / bash | Sda \ | Rootvg \ | Sysfs \ | Debugfs \ | Fd0 \ | .host \ | Nfshome: \ | Devpts' | Awk '{print $ 6}'); Do $ for n (cat / etc / fstab | grep -v 'proc \ | sda \ | rootvg \ | sysfs \ | debugfs \ | fd0 \ | .host \ | nfshome: \ | devpts' | awk' {print $ 1} '); What to do [["$ i"! = "0"]]; Then check "$ n = FSKK non-OS filesystem error" !!! Else echo "non-OS Partiton FSC successfully complained !!!" Finished  

    Output:

      / dev / repovg / lvol1 = FSKC check on non-OS file system error !!! / Dev / appvg / appvol-os = FSCK probe on non-OS file system error !!! / Dev / TEST12 / TEST12 = FSCK check on non-OS filesystem error !!! / Dev / repovg / lvol1 = FSCK probe on non-OS filesystem error !!! / Dev / appvg / appvol-os = FSCK probe on non-OS file system error !!! / Dev / TEST12 / TEST12 = FSCK check on non-OS filesystem error !!! / Dev / repovg / lvol1 = FSCK probe on non-OS filesystem error !!! / Dev / appvg / appvol-os = FSCK probe on non-OS file system error !!! / Dev / TEST12 / TEST12 = FSCK check on non-OS filesystem error !!!  

    Is there a way to eliminate duplicate values?

    I can try

    sh + x script.sh | Sort-U

    But, can I do anything in script?

    You should not use nested loops at all. Try something like this in Awk:

      awk '! / Proc | Sda | Rootvg | Sysfs | Debugfs | Fd0 |. Hosting | Nfshome: | Devpts / {if ($ 6! = 0) print $ 1, "= FSCK checks on non-OS filesystem error!" Other print "non-OS Partiton FSC successfully complained!" } / Etc / fstab  

    This will be done by typing lines from lines with regular expression (as in your grep) by line / etc / fstab < / Code> reads via line ). For those rows that do not match, it checks the 6th column and prints one of the two messages, depending on the value.

    On one side, . in .host means "any character", so you should save it from . If it means literal . or consider removing it completely.