Tuesday, 15 January 2013

nosql - representing a many-to-many relationship in couchDB -


Assume that I am writing a log analysis application, the main domain object will be a LogEntry along with it. Users of the application define a logotype that indicates which listings they are interested in. As the app receives log entries, they think they are connected to DB, and all the people in the system check them against the system so that they can match the criteria in this regard. . If this happens then the system should record that the entry matches the subject. Thus, there are many-to-many relationships between LogEntries and LogTopics.

If I was storing it in RDBMS, I would do something like this:

  create table entry (Id int, ...) Create table topic (id int, ..) Create table subject antrimap (EntryId, Subject_ID ANI)  

Using CHDB I have only two documents before I tried a type of LogEntry type, looking something like this:

  {'type': 'LogEntry', 'severity': 'DE BUG ', ...}   

And I have a logotype type, which looks like this:

  {' type ':' Logotyic ',' Mailing_entry ': [' log_entry_1 ',' log_entry_12 ',' Log_entry_34 ', ....], ...}  

You can see that I am using all logostic documents It represents a relationship by using a matching_entries field in order to store a list of log entry document IDs works fine until one point, but I have problems When you try to add a matching entry in both more than one client a topic efforts both optimistic updates, and one fails. The solution I am using now is essentially to regenerate the RDBMS approach, and adds a third document type, such as something:

  {'type': 'LogTopicToLogEntryMap', 'topic_id': 'topic_12 this works, and concurrent updates occur before problems, but I have two reservations: 

  1. I worry that I just have this approach I am using because it is what I will do in a relational DBI wonder if another couch is a DB-like (relaxed?) Solution
  2. My thoughts can not retrieve all entries for a specific topic in a call. My last solution is allowed (if I used the include_docs parameter).

Anyone have a better solution for me? If I can also post thoughts I'm using?

Your approach is okay, using Cochchadi does not mean that you will only leave relational modeling . You will need to run two questions, but this is because because it is "included", the SQL questions are also slow with connecting but SQL syntax allows you to express the query in a statement.

In my few months of experience with CouchDB, I have found this:

  1. There is no schema, so designing the app model is fast and flexible
  2. There is a CRUD, so increasing your application is fast and flexible.
  3. Bye SQL injection
  4. What will happen in a SQL insertion takes a little more work in Wikipedia:

According to your needs I have found that Couched-Lucene is also more complicated Useful for the construction of houses.


url - Extracting html elements in a given region? -


Looking at the area defined by a rectangular and a URL, there is a way to determine what is given on the basis Elements within the rectangle are present on the given url?

Edit: Screen resolution, font size, etc. Everyone can be set as appropriate defaults

  • Get the document from the URL.
  • Render it (of the browser).
  • For each element in the browser's DOM:
    • Obtain the captured rectangle by element.
    • Comparing the rectangle of the element with the rectangle you are interested in it.

java - Two Android apps in the same Eclipse project? -


I want to make two Android apps from the same code base. Whether to name the app, one or two resource files, and show ads (basically, a free and paid version of the same app) - The difference between the app is very small.

It's pretty easy to do in an XCode for an iPhone app, but I'm not quite sure how to eclipse it. Is there a clean way to do this, or should I completely forget about eclipse and dip into ant scripts? Use 3 eclipse projects, everything that is normal (and possibly all your Java code) and then each application Is one where you only take part in the same (and your various resource files, etc.).


scientific computing - How to store "smaller than", equals and "larger than" in database -


I need to store scientific information in a database (SQL Server). I

Example: < Patient ID: 99 mutation rate: 3%

Patient income: 456 Radiation rate: 10%

Patient ID: 123 mutation rate: and lieutenant 3%

/ P>

I should be able to sort and filter

thanks for your help

>

How to add a 3 column for a clarity int About the area?

0 = less than = 1 = for less or equal = 2 = equal to = 3 = = or = 4 = big =

equals =

GWT Widget from HTML -


I have a block of HTML that I want to use as the basis of the GWT widget, but I'm not sure That's the best way to do this, for example, my HTML block looks like this:

  & lt; Div class = "my-widget" & gt; & Lt; Div class = "header" & gt; & Lt; Span class = "title" & gt; Title Text & lt; / Span & gt; & Lt; / Div & gt; & Lt; Div class = "body" & gt; & Lt; Span class = "content" & gt; Content text & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

Now, I can paste it into a HTML widget as a static string, but in this case I have the ability to set the text of "title" and "content" elements On the flight is required. This kills the static text option (or at least makes it much more difficult).

The first thing in that case is that it is necessary to manually construct elements in GWT and catch the context of those people who need to change, such as:

 < Code> DivElement container = document.createDivElement (); SetStyleName (container, "my-widget"); SetElement (container); DivElement Header = document.createDivElement (); SetStyleName (header, "header"); Container.appendChild (header); // Hold this element for later manipulation DivElement title = document.createDivElement (); SetStyleName (title, "title"); Header.appendChild (title);  

But it becomes easily unbearable for everyone, but the simplest of the layout (which is not mine).

What do I need to do to get this HTML The ability to send static text and then some sort of selector, such as jQuery, to query those elements that I want to manipulate, I know about it, but I have to get it to run without error Has not been able, and me That it may be easier to integrate into a commercial product soon in my life. P>

I also know about Google, what I really want to do. The problem is, as far as I can tell, this procedure is only available in GW 2.0, which is still a release candidate in the state and therefore can not be used for me.

So, given all this (sorry for the long question!) Do you have any suggestions on how to achieve something like this?

GWT 2.0 will be out before the end of the year so unless you distribute it in a few days time I do not need to, I start working with RC2 and am trying to get a new UIBinder approach.


hide checkbox border in html/javascript/css -


Is there a way to hide the square border of the checkbox in HTML?

itemprop = "text">

No cross-browser, no.

You can completely change the checkboxes with custom controls, which imitate the checkbox behavior using JavaScript, however. .


python - Django, updating a user profile with a ModelForm -


I am trying to display a simple ModelForm for a user's profile and allow the user to update it I am The problem here is that my argument is somehow faulty, and after a successful form.save () call, the old values ​​show on the page. It is not as far as refreshing proper value is not shown. What's wrong here?

  @login_required def user_profile (requested): success = false user = user.bizjects. (Pk = request.user.id) upform = UserProfileForm (Example = User Get_profile ()) if request.method == 'POST': userprofile = UserProfileForm (request.POST, example = user.get_profile ()) if userprofile.is_valid (): Up = userprofile.save (commit = false) up.user = Request.user up.save () success = True return render_to_response ('profile / index.html', local (), context_instance = RequestContext (request))  

I'm just looking to update an existing profile, do not add new ones.

Try this:

  @login_required def user_profile (requested): Success = false user = User.objects.get (pk = request.user.id) if request.method == 'POST': upform = UserProfileForm (request.POST, example = user.get_profile ()) if upform.is_valid ( ): Up = upform.save (commit = false) up.user = request.user up.save () success = true else: upform = UserProfileForm (example = user.get_profile ()) return render_to_response ('profile / index.html ', Local (), context_instance = RequestContext (request))  

c# - Abstracting from Stateful object navigation (1-1) - the challenge -


The issue of this exercise is to create navigation among objects

For example, 1-1 of the Association The person should be aware and address:

  • If any person has been given an address, then that person should be assigned to the address (and vice versa).
  • If the address is assigned to 1 person and then person 2, then there will be no address of person 1 and the person will be 2.

This is the code snippet that implements it.

  public class A {internal BA; Public b value {receive {return; } Set {if (value == null) {if (a! = Null) a.a = null; } And value. A = this; A = value; }}} Public Segment B {Internal AA; Public A Value {Get {Return; } Set {if (value == null) {if (a! = Null) a.a = null; } And value. A = this; A = value; }}}  

This allows the following tests to be passed:

  // For general setup: var a = new A (); Var B = new B (); // Test 1: A. Val = b; Apprehension Same (A, B. Well); // Test 2: b. Value = a; Assurance Reekval (b, a.well); // test3: b. Value = a; B Value = null; Assert.IsNull (a.Value); // test4: var a2 = new A (); B Value = A2; Apprehension Same (B, A 2. Well); Apprehension Oh no (A, B. Well); // Test 5: a. Value = b; Apprehension Same (A, B. Well); Var a1 = New A (); Var B1 = New B (); A1.Value = b1; Decide. Same (A1, B1 value); // test 6: var a1 = new A (); Var B1 = New B (); Assert.IsNull (a.Value); Assert.IsNull (b.Value); Assert.IsNull (a1.Value); Assert.IsNull (b1.Value);  

The question now is how will you handle the code in the setters to avoid potential mistakes while writing to such classes?

:

  • Class A and B's public interfaces can not be changed.
  • The factory should not be used.
  • Statistics should not be used (to continue sharing information).
  • ThreadInfo or similar should not be used
  • I really can not understand your challenge, what happens when you go to class A Let's start some examples and then an example of Class B?

      a1 = new A (); A2 = new A (); A3 = new A (); AA4 = new A (); AA5 = new A (); BB = new B ();  

    Which test is near? Which fails?

    You can see, once A occurs immediately, it has state in some way by B Must include an example of an current example . Therefore this example of B must be present before you start this A class.

    Also B . There should be a reference for an already present example of A .

    As far as I understand, Class A should be a constructor with reference to the current version: <: >

      Public category A {Private BB; Public A (BB) {this.b = b; }} // Then you can have: BB1 = new B (); A1 = New A (B1); // Here the link is BB2 = new B (); A2 = New A (B2); // and another link  

    either with this or the other b .

    You write that you do not want to change the public signature of A and b , and you do not want to add factories in the code. I really can not see the solution continuously under such obstacles, or the challenge itself is not clear?

    EDIT: By making a wild guess here, I think that you try to get it here, using reflection can be done: you want to reflect the current code point (call stack For a current instance of A , and a new example of A . It may be by using the image, but it is very hard and you have a concrete rule for the relationship between the new examples of A s and And should be strong set b . If the direction of this solution is , then I think you should dive in the reflection and see how it goes, it is a large area.


Handle UTF-8 DataString ( Velocity/Struts ) -


Hey people, lately, I use a combination of strushes and velocity framework to create some websites, the problem is that when I tried UTF-8 to tell Japanese characters to input, a field name, Which I had put in the value of "索", then I click on submit (use), the data will be sent to the ad, in which I have the string name field to handle the name field The problem is that, The received string is a bit weird than the expected string "索", I have set all workstations in velocity of UTF-8. The property (input.coding / outputcoding = UTF-8), content-type / charset = UTF-8, but it always returns the strangle string, I can set the name field directly: Public Zero Setname (string name) { This.name = "索"} and confirm that fix the work, but normally add it to AddForm to name the field, someone can tell me what was wrong? Thanks for reading the patient: d.

I understand that your problem is as follows, is that correct?

  • But when the form is sent back to the server, the data becomes corrupted.
  • You are caused by "索"

    on the client browser due to mismatch:

    • encoding in which the request is encoded (UTF -8 as you said) and
    • encoding by which the server decodes (by default ISO-8859-1)

    This can be solved by specifying the server-side encoding (up to 2) by using explicitly the CharacterEncodingFilter of Spring Framework. / P>

    (Note: Japanese frameworks such as Caesar and Teresoluna have similar filters and articles on the problem.)


  • .Net library for sending trackbacks -


    Is there a library to send trackback or pingback in the netbook? I know that writing this code is not hard to write, but if someone writes, it keeps debugging and maintains it, then I want to use it again.

    My solution was to implement pingback instead of trackback, it took me a fraction of the time ( While I never ended trackback). And in fact, many blogs are no longer accepting trackbacks, but they are accepting pingbacks.


    C++ high precision time measurement in Windows -


    I am interested in measuring a specific point in nanosecond using C + + in Windows. Is this possible? If it is not, then at least it is possible to get specific time in Microsoft? Any library should be done, unless I think it is possible with the managed code

    If you have a threaded application that is running on a multicore computer then QueryPerformanceCounter will (and will) return the different values ​​on which the core code is being executed. See the MSDN article ( rdtsc is the same problem)

    This is not just a theoretical problem; We ran into it with our application and had to conclude that the only reliable time source is timegate time in which only MS is accurate (which was good enough in our case). We also tried to determine thread threads for our thread that each thread always got a consistent value from QueryPerformanceCounter , it worked, but this performance was completely killed in this app.

    There is no reliable timer on those windows to include things that can be used for timing objects with minimal precision (at least one multicore computer While walking on)


    c# - I want to add the date to my log file -


    If you log in to wcf calls and messages, then log files can be very big, very fast I log from date I want to split the file. I can write my own tracel Tellin, but if possible I like some stability in the log. Something like this

      & lt; Shared Editor & gt; & Lt; Add initilizeDate = "SomeLogFile {TODAY} .log"  

    A log file output like this would be: SomeLogFile2009-12-01

    How can I do this?

    You can use your own trace aliasing or apply it. Log 4 has a rolling file adapter in the net, which actually does it (it can roll files according to date and / or size)


    sql server - SQLServerException: The statement did not return a result set when executing SQL -


    I am using sqljdbc4.jar (sqljdbc_2.0) version.

    To get an identity like this, select one of the + one execution:

      In the beginning, the date date option (description, code) value ('dateRange. QuickPick.option.all ',' ALL '); Select SCOPE_IDENTITY () END  

    and I'm getting:

     com.microsoft.sqlserver.jdbc.SQLServerException: This statement did not return the results set. 

    The line is:

      st.executeQuery (updateQuery)  

    Any ideas?

    was updated from SQL 2000 to SQL 2005 and switched to Microsoft SQL Server 2005 JDBC Driver version 1.2 . I got the error "No results were found from selection", when an integration was performed by SELECT SCOPE_IDENTITY (). "I resolved this problem by using execGetReport () and getGeneratedKeys instead of executing it. Here is the code before and after.

    Note: The connection used in this example is java .sql.connection is not com.microsoft.sqlserver.jdbc.sqlServerConnection.

    SQL 2000 code

      string dbURL = "Jdbc: sqlserver" + ":" "+ dbServer +": "+ dbServerPort +"; SelectedMethod = cursor; database name = "+ dbName +"; User = xxx; password = xxx "; category. Fornum ("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Java.sql.Connection connection = DriverManager.getConnection (dbURL); Sql = "Enter value in contact (name) ('ABC'); select SCOPE_IDENTITY ()"; Place created ps = connection.prepareStatement (sql); Resultset = ps.executeQuery (); If (rsnext ()) {long id = rs.getLong (1); System.out.println ("id =" + id);}  

    SQL 2005 code

      string dbURL = " Jdbc: sqlserver "+": // "+ dbServer +": "+ dbServerPort +"; SelectedMethod = cursor; database name = "+ dbName +"; user = xxx; password = xxx "; Class .for name ("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Java.sql.Connection connection = DriverManager.getConnection (dbURL); Sql = "Enter the contact (name) value ('ABC'); select SCOPE_IDENTITY ()"; PreparedStatement ps = connection.prepareStatement (sql); Ps.executeUpdate (); Do not use // execute () Otherwise you can get the error // statement // should be executed before any result can be obtained on the next // getGeneratedKeys statement. ResultSet rs = ps.getGeneratedKeys (); If (rsnext ()) {long id = rs.getLong (1); System.out.println ("id =" + id);}  

    java - Clean up after servlet if init() failed -


    मेरे पास Initializer वर्ग है जो ServletContextListener इंटरफ़ेस लागू करता है। इसके प्रसंग शुरूआती () विधि में, मैं कुछ वैश्विक कक्षाओं को प्रारंभ कर देता हूं जिन्हें नष्ट करना है, अन्यथा सर्वलेट को अनलोड नहीं किया जा सकता।

    हालांकि, जब सर्वलेट का init () विधि एक सर्विसलेट एक्सपॉशन फेंकता है, contextDestroyed () विधि कभी नहीं बुलाती -> संसाधन नहीं रिहाई -> सर्वलेट टॉमकेट द्वारा लोड नहीं हो जाता (यह "रनिंग" स्थिति में बनी हुई है, हालांकि इसकी init विधि कभी समाप्त नहीं हुई।)

    मेरा सवाल यह है - मैं इस मामले में संसाधनों को कैसे साफ़ कर सकता हूं?

    बोनस: सर्विसलेट को "रनिंग" स्टेट भी क्यों मिलता है?

    संपादित करें - मुझे लगता है कि यह प्रत्येक स्टेटस लाइन के कारण है, जब तक कि init () विधि सफलतापूर्वक पूरा नहीं हो जाती। टॉमकेट मैनेजर में प्रदर्शित एक पूरे युद्ध का प्रतिनिधित्व करता है, और सर्वलेट नहीं। एक युद्ध में कई सर्विसलेट शामिल हो सकते हैं, जिनमें से कुछ शुरू करने के लिए सफल होते हैं और अन्य नहीं। जब कंटेनर शुरू होता है तो आरंभकर्ता कहलाता है, और इसके नष्ट को केवल तब ही कहा जाता है जब पूरे कंटेनर गिरा दिया जाता है। यह एक संबंधित प्रश्न की ओर जाता है - क्या व्यक्तिगत सर्विसलेट्स की स्थिति पर नजर रखने के लिए एक समान अंतर्निहित तरीका है?

    (मुझे पता है कि मैं सर्वलेट को मॉनिटर करने के लिए कस्टम कोड लिख सकता हूँ, या तो जेएमएक्स के जरिए, या नहीं, लेकिन यह इस प्रश्न के दायरे से बाहर है।)

    जहां तक ​​मैं बता सकता हूँ वहाँ बिल्कुल है बाहरी अनुरोध के बिना ऐसा करने का कोई तरीका नहीं है ServletContextListener आपको सही संकेत देता है (जब सभी सर्विसलेट आरंभ किए गए हैं - सफलतापूर्वक या नहीं), लेकिन आप अपनी सर्विस का परीक्षण करने के लिए संदर्भ में सभी सर्लेटों की गणना नहीं कर सकते क्योंकि संबंधित सर्वोलेट कॉन्टैक्ट विधियों को बहिष्कृत किया गया था और अब एक खाली गणक वापस आ गया है।

    संक्षेप में, ऐसा करने का एकमात्र तरीका एक गैर-मानक API के माध्यम से होता है; विशेष रूप से, यह टॉमकेट के जेएमएक्स एपीआई के साथ ऐसा करने के लिए लगभग तुच्छ है, जो कि मैं सुझाता हूं।


    Declaring list and binding property values via XAML for a custom silverlight control -


    I think I have clarified something, but when I am creating custom control in Silverlight, I can declare them and they will be exposed while making XAMML announcements, so I can easily do something like this:

      Public category MyControl: UserControl {public string title {get; Set;}}  

    and this:

      & lt; Local: MyControl title = "Hello World" /> Although  

    Although the properties are not always the usual type, I can have a complex property, such as a list that defines 1 or more columns and has a field in which to be bound Identifies. The syntax is straight forward to define these values ​​in XAML with existing controls:

      & lt; Local: MyControl title = "People list" & gt; & Lt; Local: MyControl.Columns & gt; & Lt; Local: MyControlColumn Heading = "column1" binding = "{binding name}" /> & Lt; Local: MyControlColumn Heading = "column2" binding = "{binding age}" /> & Lt; / Local: MyControl.Columns & gt; & Lt; / Local: myControl & gt;  

    How can I do this in the definition of class:

      public class MyControl: UserControl {public string title {get; Set;} public IEnumerable ItemSource {get; Set;} public supervision qualification & lt; MyControlColumn & gt; Column {get; Set;} //? } Public class MyControlColumn {public string title {get; Set;} public ??? Binding {receive; Set;} //? }  

    Has anyone told me in the right direction to create outside lists and binding properties?

    column An example for the archive to maintain a personal archive Grab the example archive and remove the set accuser: -

      Personal Observe Collection & lt; MyControlColumn & gt; _columns = new reviewable selection & lt; MyControlColumn & gt; (); Public supervision qualification & lt; MyControlColumn & gt; Column {back {_columns; }}  

    For binding properties, it looks like what you may want is the binding type itself System.Windows.Data.Binding . But I think that you should know once that what you want to do with the object after receiving it.

    GetValue (TitleProperty); } Set {set value (title, property, value); }} Dependency for public static readability Property title = Dependency Property Registration ("title", typef (string), typef (microcontroll), blank;);

    Similarly for ItemSource however you should change the name of the ItemsSource to hold the conference with the existing controls.

    I did not help feeling that there is a new invention of the wheel, does not the datagrid or list box or some other similar controls cut for you?


    Modelling a temporal-style relational table in Hibernate -


    I am trying to wrap the hibernate around an existing data model, which is expected to fluctuate.

    My current sticking point is that the unit is a semi-floating model from the table; No rows are ever destroyed or updated; Instead, the "is_current" column is set to false (and a new line is created with new fields in the update with another primary key).

    Being relatively new to hibernate, how do I do this model, or even find out if it's possible that everyone at all Well, a custom @SQLDelete is easy enough to be deleted with annotation, but this update which seems difficult seems theoretically it seems that might be There are clear complexities (the fact that this syntax is not in existence), partial As a matter of fact, to make the primary key worthless between two statements around this fact I will be required and will be updated in the other, and I am convinced that other data sustainability issues have not yet been accepted.

    Is there a realistic way to manage it, i.e. deleting model updates + into hibernate?

    EDIT: Just to clarify, I know that I can explicitly specify it by inserting SQL to work it in a brute-force way, and then updating I am using the above snippet (with legal references of SQL stents) for However, I really do not want to do this because I am happy with SIL Hibernate that I choose to be born by default for inserts, and hand writing will be very brittle because the orbit changes should be at all. This is a last ditch solution through which it can be applied, but it seems that the point of ORM mapper has to be reduced to a lesser extent if I have to handwrite it to SQL ...

    Double edit: Above above will also not work as it is because I have to specify the primary key bind parameter twice in SQL (not possible with question mark), and I should be in hibernation Do not SequenceGenerator to persuade So it seems that I need a programmatic approach here, rather than a configuration - unless I remember some particularly relevant config elements.

    You say that no row has been updated, but it seems that you Updating is_current columns, instead of trying to write a custom delete function, there is actually an update, I'm using the same thing to be hibernate (line update, then create a new row).

      row1 setCurrent (wrong); Session.saveOrUpdate (ROW1); Line 2 = new line (line1); // copy constructor; Use a separate primary key (or your default primary key for a new object) line 2. setCurrent (true); Row2.setFoo ("bar"); // Update whatever data you are making to the new line session (line 2);  

    You can wrap this process in some medium level / business logic code, to ensure that no other fields are updated.


    c# - PowerShell: passing blocks as parameters to functions -


    मैं एक उदाहरण पर अपने प्रश्न की व्याख्या करेगा। चलो C #:

      शून्य ए (एक्शन ब्लॉक) में निम्नलिखित कोड है {B (() = & gt; {Console.WriteLine (2); block ();}); } शून्य बी (एक्शन ब्लॉक) {कंसोल। WrightLine (1); ब्लॉक (); } शून्य मुख्य () {ए (() = & gt; {Console.WriteLine (3);}); }  

    इस कोड का आउटपुट है:

      1 2 3  

    अब, मैं यह लिखना चाहता हूं कोड PowerShell में:

      फ़ंक्शन ए ($ ब्लॉक) {B {2। $ ब्लॉक}} फ़ंक्शन बी ($ ब्लॉक) {1 $ Block} A {3}  

    हालांकि, यह कोड कॉल की गहराई अतिप्रवाह करता है:

    कॉल की गहराई अतिप्रवाह के कारण स्क्रिप्ट विफल रहा। कॉल की गहराई 1001 तक पहुंच गई और अधिकतम 1000 है।

    मैंने पाया है कि अगर मैं फ़ंक्शन बी के पैरामीटर का नाम बदलता हूँ, तो यह काम करेगा।

    है यह एक फीचर या बग (या दोनों)? मैं पार्सशेल में यह काम कैसे कर सकता हूँ बिना फ़ंक्शंस में विशिष्ट पैरामीटर के बिना?

    हाँ, आप जा रहे हैं पुनरावर्ती क्योंकि फ़ंक्शन बी में दिए गए स्क्रिप्टब्लॉक में $ block संदर्भ फ़ंक्शन बी के संदर्भ में मूल्यांकन किया जाता है और परिणामस्वरूप, बी के $ block पैरामीटर के मूल्य का मूल्यांकन करता है

    यदि आप पैरामीटर नाम बदलना नहीं चाहते हैं (आप पर दोष नहीं डालें) तो आप PowerShell को ए में एक $ $ ब्लॉक के मूल्य को कैप्चर करने के लिए ए में एक नया क्लॉथर बनाने के लिए बाध्य कर सकते हैं जैसे:

      फ़ंक्शन ए ($ ब्लॉक) {B} लिखें-होस्ट 2; & Amp; $ ब्लॉक} .GetNewClosure ()} फ़ंक्शन बी ($ ब्लॉक) {लिखें-होस्ट 1 और $ ब्लॉक} ए {लिखें-होस्ट 3}  

    Why do I get a CURLE_URL_MALFORMAT when trying to http post? -


    यहां कोड है (मौजूदा अनुप्रयोग से निकाला गया):

      curl * curl = curl_easy_init (); _ASSERTE (कर्ल); स्ट्रिंग url = "http://127.0.0.1:8000/"; चार * डेटा = "मोड = परीक्षा"; Curl_easy_setopt (कर्ल, CURLOPT_POSTFIELDS, डेटा); Curl_easy_setopt (कर्ल, CURLOPT_URL, url); CURLcode res = curl_easy_perform (कर्ल); Bool सफलता = (res == CURLE_OK); curl_easy_cleanup (कर्ल);  

    res का मान CURLE_URL_MALFORMAT है। क्या यह यूआरएल को कर्ल के साथ संगत नहीं है?

    आह, साधारण गलती, मुझे char पास करना होगा * से curl_easy_setopt और स्ट्रिंग नहीं। इसे ठीक करने के लिए मैंने अभी .c_str () जैसा प्रयोग किया है:

      curl * curl = curl_easy_init (); _ASSERTE (कर्ल); स्ट्रिंग url = "http://127.0.0.1:8000/"; चार * डेटा = "मोड = परीक्षा"; Curl_easy_setopt (कर्ल, CURLOPT_POSTFIELDS, डेटा); Curl_easy_setopt (कर्ल, CURLOPT_URL, url.c_str ()); CURLcode res = curl_easy_perform (कर्ल); Bool सफलता = (res == CURLE_OK); curl_easy_cleanup (कर्ल);  

    Force Whitespace in C Macro? -


    I have got the following macro to define a new function after a special naming scheme :

      #define CREATE_HOOK_STUB (func) void ## func_STUB () {/ * some code * /}  

    However, the preprocessor always zero and ## Monqub but I clearly want to preserve whitens in that situation.

    I know that I can only add some strings to ## monkub user , but this is not what I want. How do I solve this?

    I think what you really want:

      #define CREATE_HOOK_STUB (func) void func ## _ STUB () {/ * some code * /}  

    but you should also see which additional details are on token pasteing operator Behavior:

    When you are using token-paste ('##') or knowing about the stringing ('#') preprocessing operator, one thing is that you have all those cases To work properly in them Sector should be condemned to an additional level.

    If you do not do this and the items passed to the token-pasteing operator are the macros themselves, you will get the result, maybe this is probably not what you want ...

    • Link:

    ASP Classic - Include VBScript page in a JavaScript page? -


    Is there a way to include a VBScript page in an ASP page using Javascript?

    An ASP page is written in Javascript, but our sidebar menu is written in VBScript. When I include the sidebar ASP file in Javascript, the server returns an error.

    & lt; % @ LANGUAGE = "JavaScript"%>

    & lt;%

    ...

    & lt; ! - # include file = "sidebar asp" ->

    ...

    where sidebar AP is written using VBScript.

    You can try it, but I guess that sidebar.asp is preceded by your javascript code will be performed.

      & lt; % @ LANGUAGE = "Javascript"%> & Lt;% ... & lt; Script language = "VBscript" runat = server & gt; & Lt; ! - # include file = "sidebar.asp" - & gt; & Lt; / Script & gt; ...  

    objective c - Fading out a Cocoa window -


    Hello, I am thinking that there is a way to extend the window using core-animation or quartz in Objective-c is. When I close it, I would like to exit the window. My OSX operating system is Tiger.

    Edit: Is it possible to do this with an applescript app in Xcode by calling a method in Objective-c or some other way?

    , despite its name, works on windows also is there.


    dom - howto append something to an empty body with jquery -


    मैं इसे jquery के साथ कर रहा हूँ

      $ ()। Ready (function () { $ (दस्तावेज़) .empty (); $ (दस्तावेज़) .append ("& lt; div & gt; hallo & lt; / div & gt;");});  

    मैं उम्मीद करता था कि यह शरीर को खाली कर देगा और बाद में शरीर में हेलो के साथ एक div जोड़ देगा। लेकिन यह नहीं करता है फायरबग में यह कोई त्रुटि नहीं दिखाती है यह काम क्यों नहीं करता और मैं इसे कैसे काम करूं?

    इसे आज़माएं।

    < ("& Lt; div & gt; hallo & lt; / div & gt;");} {$ ("body") रिक्त (); $ ("body")। );

    asp.net mvc - Can I get a simple bool value from another controller in my HomeController? -


    There is a check for registration in my registration controller:

      Public class registration controller: controller {html} 

    Private Readonly IAmaregistrationRepository _RegistrationRepository; Public Registration Controller (IAmaregistrationRepository Registration Regository) {_RegistrationRepository = Registration Replacement; } Public Bull IRGistered (String Username) {return _ register repository. ISR registered (user name); }}

    How can I test it from my home controller? Is there any way to access controller builder to pull an open controller at present? Or at least one client controller may be able to generate one by using the factory I have loaded in my global builder in Global.asax.cs

    >

    I think you're ending it. You already have a method on your repository that you can use. Why do you make another controller just to call a method that just protects the repository method? Make an example of the repository in your home controller and use the IsRegistered method on it.


    Upgrade to ASP.NET MVC version 2 -


    I am doing some work on the ASP.NET MVC project, today I tried to publish the website but I got an error. . My hosting service provider told me that they are due to the fact that I have version 1 while they support version 2. How do I upgrade to version 2? Are the differences between the two versions so extreme that no previous version is supported by success?

    Thank you

    This sounds very unusual because:

    1. MVC 2 is still in beta, and
    2. Two versions can be played from the side. / Li>

    yacc - Why do i have a shift reduce/conflict on the ')' and not '('? -


    मेरे पास वाक्यविन्यास है

     % (var)  

    और

     % var  

    और (var)

    मेरे नियम कुछ ऐसा है

      optExpr: | '%' '(' कॉमलोप ')' | '%' कॉमलोप कॉमलोूप: वैल | कॉमलोप ',' वैल एक्स्प: अधिक नियम | '(' वाल ')'  

    समस्या यह है कि यह बताने में सक्षम नहीं लगता है कि) % (CommaLoop) या % ( वैल) लेकिन इसके बदले में शिकायत की गई है) () क्या है? इसे ( पर शिकायत नहीं करनी चाहिए और मुझे त्रुटि कैसे तय करनी चाहिए? मुझे लगता है कि % ( एक टोकन एक अच्छा समाधान है, लेकिन मुझे यह सुनिश्चित करना है कि क्यों $ ( ऐसा करने से पहले एक त्रुटि नहीं है।

    java - How can I interface with a third party module that only provides JTAPI API From C++? -


    I am supporting a large system written in C ++ and now we have to talk to a third party system Our application requires only JETPI interface which provides. It appears that I am writing a JTDAPI proxy in Java, which speaks JTAPI on the other side and some language-neutral API on the other. However, it seems like it should be a solution problem and I do not want to invent the wheel unnecessarily. What is the best solution to interact with JTAPI from C ++? Is such a proxy already present, or maybe there is a solution that does not require a Java layer?

    Displays the way to call Java objects from C ++.

    You can also think about embedding JVM in your C ++ program. See also a possible way to do this: Also see:

    If your C ++ system provides an API, then there is an easy way to write a Java program which is called C ++ API (Using JNI) and calls JTDAPI library from there.

    / div>

    how to Binding DataGridView to multiple Tables in DataViewManager -


    I have two tables, 'customer' and 'location' these tables are related, I have given these tables the intro datagrid view Parents and child's tables (which are expandable) + When I click on the + button, it will display the child in the same Datagram view.

    pls help me

    Thank you ...

    This was asked.

    edited : After further investigation, I see that the questions are slightly different, it mentions an expandable rows, but the titles are almost identical.

    Here you are An example of this is:

    and second:


    debugging - Error message in C# software debug question -


    While I try to run a program in creating this error, how I repeated the error message, the macro runs just fine For many loops, but then it is broken by mistake, it is giving the error.

      ************* exception text ************************************ The value of '-1' is not valid on 'Blue' System.Drawing.Color.FromArgb on System.Drawing.Color.CheckByte (Int32 value, string name) (int32 alpha, int32 red, equal to or greater than 0 And should be equal to or less than 255 green, int 32 blue) on the system. Drawing Caller.phomArgb (int 32 red, int 32 green, int 32 blue) on dispatcher. Caller check Gatepxal Atcurs () Dispatcher. Dispatcher. Caller check.getpixel () on Dispatcher. Caller check Dispatcher_Tool.main_normal.checkColor () on Dispatcher_Tool.main_normal.startMacro (text box valX) on Dispatcher_Tool.main_normal.button5_Click on CheckColorBlack (Inter 32 Blackcards X, int 32 blackCordsY) System.Windows.Forms.Control.OnClick (Object Sender, EventArgs E) (on EventArgs e) on the system. On Windows.Forms.Button.OnClick (EventArgs e) System.Windows.Forms.Button.OnMouseUp (MouseEventArgs mevent) System.Windows.Forms.Control.WmMouseUp (Message in & amp; M, MouseButtons Button, Int32 Clicking ) On System.Windows. Control Andropy (Message and M) ystem.Windows.Forms.ButtonBase.WndProc (Message in & System.Windows.Forms.Control.ControlNativeWindow.WndProc in Me) (Message & System.Windows.Forms.Control ControlNativeWindow.OnMessage in m) (Message & System.Windows.Forms.Button.WandProc (meter on message & meter) System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 Message, IntPtr wParam, IntPtr The code around this point is  
      [DllImport ("gdi32")] Private static extern c GetPixel (IntPtr hdc, int x , Int y); [DllImport ("User32")] Private static extern IntPtr GetWindowDC (IntPtr hwnd); #region Pixel Color Testing for Private Stable Reading Only IntPtr DesktopDC = GetWindowDC (IntPtr.Zero); Public Static System Drawing Caller GetPixelAtCursor () {System.Drawing.Point p = Cursor.Position; Int color = Gate pixel (DesktopDC, PX, P.Y.); Return system Dropping Colour. Foam ARGB (Color and 0x FF, Color> 8 & amp; 0xFF, Color> gt;> 16); } Error message is quite clear - you are calling, but you do it - 1 give "blue" value, which is invalid Docs:  

    blue
    type: System.Int32
    blue component to the new color value valid values ​​are 255 to 0 Are up to

    How can you decide that it will depend on your code which is trying to code your code.

    Edit: Okay, now you have the code is returned I strongly suspect that he CLR_INVALID is that I thought estimated -1 bit patterns (I.e. all bit sets). You are just moving that signal being expanded, so you're still getting -1.

    It is very easy to avoid creating an exception - just the same way the blue face "others are masking:

      Color.FromArgb return (; 0xFF, (Color> Color & amp; 8) & amp; 0xFF, (Color> & gt; 16) & amp; 0xFF);  

    However, this is really going to hide the problem - you will end up with white where you do not actually have a valid value, you should probably check if the color == -1 and work appropriately. Then, that exact behavior will depend on your application.


    iphone - Setting a boolean property in Info.plist from a User Defined Setting -


    Setting an asset in the Info.plist file is easy from user-defined settings, you just use $ {YOUR_SETTING_NAME} Importance is important. However, is it possible for this bidding property? The structure in the flylist file for a boolean is:

      & lt; Key> NSAppleScriptEnabled & lt; / Key & gt; & Lt; False / & gt;  

    This is not to explain how to use a user-defined setting.

    I'm not sure what you are asking, but I'm pretty sure this special key You can use the "yes" and "no" string for nsapplacescript annexed and it will work.


    javascript - Continuous Image Marquee in HTML -


    I need a continuous image marquee in HTML in horizontal direction. This code is working for text marquee, but not for images. thank you in advanced.

    Continuous Text Marquee Link:

    1- Do not use

    2-?

    3- Profit!

    If you really want to, try using it


    How crucial is Model View Controller pattern for software? -


    I participated in an enterprise architecture session in my firm

    "If your software model view controller pattern Does not use it, then it can not be called software ",

    Well, it made some noise in the room what you guys think.

    On the one hand, your architects are doing their job - important topics.

    On the other hand, your architect is getting a gray color, and maybe he knows it.


    Where should interfaces and other dependencies go in C#? -


    By other dependence, I mean intangible class and something else.

    I have a project that requires a fixed interface , IInput for a dll . This interface is also required for a test project, so I put this interface in my main project, which in turn has a different exe assembly.

    That's because the main project at the end will need to use this interface when I wire everything together. Now the problem was that when I tried to add DLL to a reference in the main project with reference to the main project, I got a circular dependence.

    I have never had this problem, do not I know the best way to combat it? One temporarily I was taken to different DLL interface, but very soon I will need it in its main project so that I can return back to square one.

    Edit:

    I should mention the design, so here goes.

      Menu menu test runner  

    In the menu is INPT which is actually a unit adapter for a third party library for permission of unit testing.

    Therefore the menu needs this for input, but such a runner runner (exe) will need input, so I'll need IInput again.

    Because there is no relation to the interface test project or main project, just move it to a separate assembly , And refer to this assembly as both examinations and main.

      MySolution | - & gt; Interface Dll | - & gt; MainProject.exe (Reference Interfaces.dll) | - & gt; TestProject.exe (Reference Interface.DLL)  

    matlab - Cross-correlation coefficient -


    I have two waves in the field of time, of which I need to measure the coefficients in MATLAB. I max (ABS (MC, N, 'COF')) but it is not working properly.

    In addition to this I need to measure the different types of wave Measure cross correlation coefficient for classes, eg cross correlation coefficient at 1 minute interval, and if these values ​​are matte Rex or something else.

    I know that there is a lot to ask, but I am a MATLAB novice and this task seems challenging!
    With any help you can give me

    Edit: This code is used to test the correlation code:

      X = Rand (1,14400); Y = RAND (1,14400); R = Max (stomach (xx (x, y, 'cof')))  

    < Div class = "post-text" itemprop = "text">

    you According to switch to equations such as the cross-correlation coefficient can be counted:

     % Say: m and n row vectors r = cov ([m your signals; N]) / (std (m) * std (n));  

    If you want to calculate the coefficients for some part of the signal, just use it:

      r = cov ([m (1 : 100); N (1: 100)] / (STD (M (1: 100)) * STD (N (1: 100)));  

    Have you also tried the corrcoef function?

    Edit OK, I have checked the corrcoef function and it's working properly, take a look:

      & Gt; & Gt; X = 100 * randon (1000,1); & Gt; & Gt; Y = 34 * randn (1000,1); & Gt; & Gt; Corrcoef (x, y) ans = 1.0000 -0.0543 -0.0543 1.0000  

    Then the correlation coefficient is equal to -0.0543 - small similarity (expected). To check, let's count the coefficients of the same signals:

      & gt; & Gt; Y = x; & Gt; & Gt; Corrcoef (x, y) ans = 1 1 1 1  

    As expected, it is equivalent to 1.

    Edit As you can see, the result of corrcoef is the matrix of all possible correlation coefficients between these two signals:

      xyx 1.0000 -0.0543 y -0.0543 1.0000  

    For cross-correlation you must choose one of the elements outside the main diagonal (self-correlation coefficient, in this case always equal 1 ).
    There is no difference if you choose ans (2, 1) or ANS (1,2) - there is no difference, if you calculate the correlation of x and y, or correlate y and x Are there.

    The last code should look like this:

      R = corrcoef (x, y); % Correlation matrix R = R (2,1); % This is your cross-correlation coefficient  

    Is it possible to have secondary server available read-only in a log shipping scenario? -


    I'm seeing log shipping in SQL Server 2005 environment. This idea was intended to set log shipping on a secondary server often: Use a secondary server to send the report query, from which the primary DB server is being offloaded.

    I came across one on this:

    When you create log shipping, you have 2 options. You can configure the log-in lodge operation to be done with the Norwickwari or with standby option. If you use the Norwich option, you can not raise the issue of selected statements on it. If you use the standby option instead of for example, you can run selected questions on the database. When the log file is restored, keep in mind with the standby option, users will be removed without warning by the restoring process. Intensely when you configure log shipping with the standby option, you can also choose between 2 options - kill all the processes in the secondary database and restore the log or if the database is being used log Do not restore. Of course if you choose the second option, the restoration operation can never be run when someone opens a connection to the database and does not turn it off, then it is better to use the option first.

    So my questions are:

    • Is the above true? Can you really not use log shipping, the way I intend to?
    • If this is true, then someone can tell that why can not you run a selection database while restoring the transaction log?

    Edit:

    The first question is a duplicate but I still want to answer the second question: restores the transaction log Is it not possible to execute the time selection statement?

    Can someone tell you why you can not select the selection statement in the database while restoring the transaction log Can you run

    The short answer is that the restoration statement is being restored to a special lock database.

    writes, I hope there is no need to tell me why they are incompatible with restoring. Why not read this? First of all, there is no way to know that the session that has a lock in any session is read or written. But even if this is possible, a restore (log or backup) is an operation that updates the data page directly into the database. Since these updates go straight to the physical location (page) and do not follow the logical hierarchy (metadata-division-page-line), they will not respect the potential intent of the data from other data readers, and thus change the structures The possibility is as they are read Scan a Select Table After the next-previous indicator the page will be thrown into chaos, resulting in a corrupt read. Ega.


    vim - make gvim treat wrapped line as new line -


    When I press the down arrow in "j" or vim / gvim, the cursor goes to the next line to write the code that's good.

    While writing the text, the lines are usually very long, with the text. So I can not easily get the word above the word, by pressing the up arrow in almost all editors and text processors. ↑ The cursor will be inserted in front of "cursor". But the cursor in gvim goes on the blank line between the "code". And "when"

    I use wrap (set: wrap) and linebreak (set: LBR).

    With all the powers of VIM - should it be straight forward?

    g k and g j Instead of the text line, move up / down the line of sight you can use j and k / P>

      noremap j gj noremap k gk  

    Some people just like to set up those maps for specific file types, in which case you want something < / P>

      au FileType html, tex noremap & lt; Buffer & gt; J gj au fileetype html, tex noremap & lt; Buffer & gt; K gk  

    asp.net - Active Directory group lookup function failing -


    Help! I am trying to write a work that will confirm a user's membership in an Active Directory group, and it works when the user is in the group, the user does not give an exception.

    Here's the job:

      using private bool ISUserMemberOfGroup (string user, string group) {(var ctx = new PrincipalContext (ContextType.Domain)) Group Principal = GroupPrincipal.FindByIdentity CTX, Group)) (var user principal = userpinnel.fisbiiindtte (ctx, user)) {if (group pinstrist == empty) {return false; } Other {Return User Principal ISMBER OFF (Group Principal); }}}  

    And here is YSOD:

    Server error in the '/' application.

    Unknown error (0x80005000)

    Description: for existing web request An unrestricted exception occurred during execution. For more information about the error, review the stack trace and where it started in the code.

    Exception Details:

    System. InteropServices.COMException: unknown error (0x80005000)

    source error:

     line 34: other line 35: { Line 36: Return User Principal ISMBER OFF (GROUP PRINCIPAL); Line 37:} Line 38:}   

    I do not know that it is related, but when I move through the function, GroupPrimary. Member. "Excludes the exception" System.NullReferenceException ", with the calculation.Bass shows an exception with the message" Object reference is not set as an example of an object. "

    What is happening Is there a bool called IsMember just a false back when there is no member?

    Thanks,

    I think you can simplify things a bit:

      Private Bull ISUsmailber Group (String) C User, String Group) using {(var ctx = new PrincipalContext) (var user principal = userprintal.fundbiimenttte (ctx, user)) {principal search resultt & lt; principal> results = UserPrinter Group (); GroupPrinter GroupPinnal = Falling where (G = & gt; G.SackAccountName == GroupName). FirstOver Default (); Return (Group Principal! = Null);}}  

    userPrincipal.GetGr Oups () will give you a definitive list of all group memberships (including primary group and nested group membership) for that user; Then search for the list of that group you are interested in, e.g.

    If you search for the group you PrincipalSearchResult & lt; Principal & gt; by GetGroups () , your user is a member of that group.

    You can save at least one "FindByIdentity" call with you.


    .net - SQL Bulkcopy for Client / Parent relationship -


    We have two datatables, which are client with one million client rows / SQL data databases via SQL BulkCopy Should be put in. It is possible that many examples of this NAT application are running in parallel to insert different data into the same tables.

    We have an identity column in the parent table for the auto-generation of the primary key.

    The problem is that we do not include the related foreign key in the child's table.

    Does anyone know how to use wholesale copies in 1: N relationship problem? We can not create an ID in NDS because many examples can run.

    Thank you Daniel

    "post-text" itemprop = "text">

    This is just one of the many reasons that I have identified for all my primary keys I like using natural keys.

    How do you know which children have to go to the parents in the data source? If they are attached to any column there, then it should not be very difficult to incorporate parental rows, insert the rows of children in a loft table, then identify the ID with that column's parent Insert rows of children while joining.

    If the relationship is related to the status file in the bus or something like this and then it becomes more difficult, you can either include the file line # and then use the same steps as above. , Those (child.line_num> parent.line_num and any other parent.line_num are not included between those two numbers) or you can import parent once at a time, capture a loop, then that Use the ID to summon all your children Do Ilit. You can set it up in SSIS without much trouble, but it can be slow.

    With more details on your problem (data source, etc.), I may be able to provide more features.


    exception - My desire: to continue to edit a redirected page -


    Code used in the head:

      & quot; Meta charset = "UTF-8" & gt; meta http-equiv = "refresh" content = "1; Url = http: //example.com "& gt; & lt; script type =" text / javascript "> window.location.href =" http://example.com " 

    The problem is, it is a universal redirect. When I adjust the html / css and click to see it, whether in my browser or just by clicking on the file to preview it, Redirects to (I YouTube is used as a test)

    What Is there a way that I can redirect myself to all the visitors except myself so that I can see my progress alive?

    I will filter the IP address of the user.

    Obtaining IP with Java seems a bit difficult if you can, to put some lines of PHP on top of the file Try.

      & lt ;? Php if (! In_array (@ $ _ SERVER ['REMOTE_ADDR'], array ('127.0.0.1' , '123.123.123.123'))) {header ('location: http://www.youtube.com'); Go out; }? & Gt; 127.0.0.1 IP address is 'localhost' for your personal server on your computer. Find out what your public IP is and then enter the array. 

    This is a similar question thanks to user xdazz for the answer.


    asp.net - How to group list of media by parent in Umbraco -


    हमारा पृष्ठ उम्ब्रको में मीडिया के रूप में संलग्न मासिक तथ्य पत्र (पीडीएफ) प्रदर्शित करता है, और मीडिया वर्षानुसार समूहबद्ध होता है स्क्रिप्ट (इनपुट के रूप में तथ्य पत्रकों की आईडी के साथ) हर साल एक div में समूहीकृत मासिक तथ्यों के साथ प्रदर्शित करता है।

    समस्या यह है कि समूह के लिए वर्ष अब "तिथि" संपत्ति से लिया गया है। लेकिन तथ्यपत्र बनाने में कुछ समय लगता है, उदाहरण के लिए, दिसंबर फांटशीट की तारीख 15 जनवरी है। मैंने सोचा था कि मैं सिर्फ

      x = & gt; X.GetPropertyValue & lt; दिनांकटाइम & gt; ("तिथि")। वर्ष  

    के साथ

      x = & gt; X.Parent.Name  

    लेकिन यह सही तरीके से नहीं लगता है, हालांकि यह उदाहरण के साथ ठीक काम करता है

      @ (file.Parent नाम)  

    पिछले लूप में धन्यवाद, मैं वास्तव में एएसपी.नेट में शुरुआत कर रहा हूं!

    <पूर्व> आईएलआईटीआईटी & lt; IPublishedContent & gt; फाइल = ((आईएनएनमेरेबल & lt; IPublishedContent & gt;) (Umbraco। मीडिया (factsheetIdsString.Split (नया [] {','}))। ऑर्डरबी ("दिनांक")); "फोरेच" (IGrouping & lt; int, IPublishedContent & amp;; फाइलों में वर्ष समूह। समूहबि (x = & gt; x.GetPropertyValue & lt; दिनांकटाइम & gt; ("तारीख")। वर्ष)) {& lt; div वर्ग = "कॉल-एसएम -6" & gt; & Lt; h2 & gt; @ वर्ष समूह। मुख्य तथ्यपत्र & lt; / h2 & gt; & LT; ul & gt; @ फ़ॉरेक (वर्ड ग्रुप में आइपीब्लाइज्ड कंटेंट फाइल) {@


    Where do Apache Samza and Apache Storm differ in their use cases? -


    I have stumbled upon the fact that Samza does the opposite with the storm, but only to address the implementation details looks like.

    What is the difference between these two distributed computing engines in their use cases? What type of work is good for every device?

    The biggest difference between Apache storm and Apache has come down to understand how the data Let's process it to stream.

    Apache calculates real time using storm topology and feeds it in a cluster where the master node performs the code between the worker nodes execute it. Topology data has passed between spouts, which leaves the data stream as the unchanging set of key-value pairs.

    The architecture of Apache Storm is here: Enter image details here

    < P> Apache understood stream is processed in messages as a bar, the streams are divided into those divisions, which are an indexed sequence where each has a unique ID. It supports batching and is usually used with the headphones yarn and Apache Kafka

    Here is the architecture of Apache explained:

    Read more about each of the systems in executing the features given below for more information about specific methods.

    Case of use

    Apache was created by LinkedIn.

    A software engineer wrote:

    It has been in production on LinkedIn for many years and currently runs on hundreds of machines at many data centers . Our biggest Samza job is processed over 1,000,000 messages per second during peak traffic hours.

    / html>

    c++ - user input array program keeps returning 255 -


    I have done something wrong I know that this program is crashing when it should display an array.

    This code is:

      #include & lt; Iostream & gt; using namespace std; Int Search for the best valuation (int input_group [], integer size, int index); Zero swap (int input_values ​​[], int first_index, int second_index); Zero entry sort (int input_values ​​[], integer size); Zero display ray (int input_values ​​[], integer size); Int * userInput (int input_values ​​[], integer size); Int main () {int input_values ​​[50]; User input (input_group, 50); For {int i = 0; i & lt; 50; i ++} {cout & lt; & Lt; Input_values ​​[i]; } InsertionSort (input_group, 50); DisplayArray (input_group, 50); Cout & lt; & Lt; "\ N"; } Zero entry (int input_values ​​[], int size) {for (int i = 0; i  

    The program crashes with error code 255 unless I stop it quickly (which gives it some strange negative values).

    The program has a solution to the problem of practice in series + arrays (eg, this entry is sorted) but jump in C ++.

    This is the problem:

    Write a program that takes up 50 values ​​and the highest, lowest, average, and then all 50 input values, one per line.

    I edited this post with the latest update of the code. Even after adding the return statement I keep this weird array output

      return user_input;  

    So what's with it? This only warns me:

    Warning: The address of the local variable 'user_input' is back [enabled by default]

    related to the return statement.

    You do this:

    User input (input_values) [50], 50)

    which should be

    User input (by input_50)

    Many times, second comment: You can also take input in a loop, as you cautize in the main part of your program.


    node.js - NodeJS and Redis : getting three values simultaneously -


    Currently, I get many values ​​with node-radis in nodejs and radis:

    < (Redis.get ('data2', function (error, data2) {redis.get ('data3', function (error, Data 3) {if3 (data3 ==xx and data2 ==xx and data3 == xx} {console.log ('its ok');}});});});

    The problem is that the three requests will be one after the other, I want to create 3 at a time, and then for example, call my position like this (do not work for you Understand what I want):

      redis.get ('data1', function (mistake, data1) {var data1 = data1;}); Redis.get ('data2', function (mistake, data2) {var data2 = data2;}); Redis.get ('data3', function (mistake, data 3) {var data3 = data3;}); // When the 3 operation was completed (data 3 == xx & amp; data2 ==xx and data3 == xx} {console.log ('its ok'); }  

    Thank you in advance

    as well

      var m = redis.multi (); M.get ('data1'); M.get ('data2'); M.get ('data3'); M.exec (function (error, result) {console.log (result);});  

    Java generics on super class but not all subclasses want to define a type parameter -


    I did not know how well this title ... I hope the motivation will come later and I will I can update, but ...

    Describe me with some (pseudo) code:

    I try to manage AJAX requests on my server in a fair way This is what I have come up with.

    Aadhaar Request:

      Public Essential Class BasRQuest & lt; T & gt; {Private last T statement; Public Security (T details) {this.details = details; } Public abstract void process (); }  

    Then I have a request that some data is coming up, it says that this is for a login request where log in details a bean Is:

      public class LoginRequest expanded the baserxtest & lt; LoginDetails & gt; {Public Login Route (T Description) {Super (Details); } / ** * @ Override * / Public Zero Process () {Toolbox.login (this.details); }}  

    It has been working hard to do so ... I have various requests where I take the form of data on beans and using these futures they have them in these requests I do All are good ... as long as ...

    I decide to request logout. There should be no data to be connected to any bean for this request and therefore I defined a type parameter I do not want to do it (it will break everything). Something like this is what I want to be able to do:

      public class logout request bassAccest {public logout request () {super (empty); } / ** * @ Override * / Public Zero Process () {Toolbox.logout (); }}  

    And when it compiles and works it crawls my skin due to security.

    Now ... I know how to solve it, but I'm wondering if there was a better way.

    My solution

    should be an in-built base request and a typed subclass of it, which is the data request sub-class and the logout request only Unlitten base will leave the request.

    Unlimited Base Requests:

      Public Essentials Base BaseRequest {public abstract void process (); }  

    A base data request has been typed:

      Public abstract class BaseDataRequest & lt; T & gt; BaseRequest extended {personal last T statement; Public BaseDataRequest (T details) {this.details = details; }}  

    Then login:

      Public class LoginRequest has requested the bassdatindest & lt; LoginDetails & gt; {Public Login Route (T Description) {Super (Details); } / ** * @ Override * / Public Zero Process () {Toolbox.login (this.details); }}  

    and logout:

      Public class logout request extends uncooked quota {/ ** * @ override * / public zero process () { Toolbox.logout (); }}  

    I want to make sure that my solution is the best option and I have not left any way to specify the type of tap (I know that this concept is not present) or Anyone else like that crazy can confirm for me.

    In addition to this, I am taking suggestions for an updated title for the question.

    You were on the right track with some kind of thinking. Such a thing is not present in Java, but in Java.

    Zero class is an unreachable placeholder class to reference class object representing zero squared.

    You can create type parameter Zero , so that only zero can be sent to the Superclass constructor in calls.

    Public Class Logout Request BaseRequest and Lieutenant; VioOD & gt; {Public logout () {super (tap); }}

    validation - Angularjs >1.3 $validator causes modelValue to go undefined -


    I am using $ validator to write a custom form verification instructions.

    Currently it looks like this:

      module.directive ('tweetLength', function (URLDetector) {return {restricted: 'a', is required: 'NgModel', link: function (scope, element, etters, CTLL) {users with permission of var}; permissions = parasant (attrs.tweetLength); ctrl. $ Validators.tweetLength = function (modelValue, viewValue) {var results; Return result = URLDetector.url has been adjusted; printRate (modelValue) & lt; = Permissions Recipients;};}};});  

    This examines the model of the element which is connected to the number of characters, while the account link shortening (hence the ng-minlength and Ng-maxlength do not work). Needs are not fulfilled when it lied. The problem is that when this false modelValue returns is undefined I know that means to store this point in $$ invalidModelValue , But I still need the value in the original model because it is being used elsewhere in the scene.

    Is there a way to move the corner and prevent it from being the original model undefined ? I know that this problem can be resolved in the Form Controller, but I do not think it is the right way to do this because I want to disable the form submission button by using the form and not some external variable. Is there an alternative way to approach this problem when using aggregation form validation?

    Angular v. The value of ng-model is undefined (docs)

    set to start in 1.3, when the return is incorrect, to prevent this behavior, allowInvalid < / Code> set the correct property, such as:

      ng-model-option = "{permissions invalid: true}"  

    java - "The three shooters algorithm" -


    Like the title, you get 3 'shooters': Shooter A , B and C
    Rules are as follows:

    There is a different chance to hit each one:
    shooter A of the time 100%
    Shooter B will hit the bar for 80% and shooter C < / Strong> will be killed for the 50% of the bar

    after each shooter once hit will actually die and remove Or.

    Shooter with the most chance of hitting each shooter will give priority to survival if all the shooters are alive: C Shoot A , B < Shoots A , A B

    Each shooter can shoot only one round when its turn

    Each new game that starts, it will be a random start of three shooters.

    Once a shooter played his turn (and if the shooter is not only standing one left), the next shooter will be randomly selected to play and the person who has played his turn can not be raised again (whose Meaning that the shooter who has played now can not play it twice, but after the next turn, he can play again).

    A game can only end after being a winner in the form of a final shooter standings
    _________________________________________________________________________

    Now, I was later assigned to find the average victory ratio for each shooter. Let's say 2,000,000 games.
    My results were as follows:
    A: 0.2344525 (23.4%), B: 0.3187745 (31.8%), C: 0.446773 (44.6%).
    We did not get any formal answer in our class and just got a different answer about the person I checked.

    To solve this scenario my code is correct as the correct answer?

      public still character shooters () {char winner = 'x'; // 'x' means that no winner is still four A = 'V', B = 'V', C = 'V'; // 'V' means they are alive dual turn = monastery Random () * 3; Shoot; / * Turn: 0 to 1 will always mean that it is a turn 1 to 2 will always mean that it is the turn of B 2 to 3 will always mean that it is the turn of the moment * / while (winner == ' X ') {// When the winner ends,' a ',' b 'or' c 'will be changed (current & lt; 1) {// start (1.0) b =' x '; // b 'is dead turn = 2.5; // C's turn now} and if (turn and lieutenant; 2) {// B start (0.8) shoot = mathematics.Random (); If (shoot and lt; = 0.8) {// b hit (a == 'v' & amp; amp; c == 'v') {// live both opponents, one = 'x'; // one is dead 'turn = 2.5; // C's turn now} and {winner = 'B'; // Whatever is the case, the last contestant will be left out}} Other {// B if (a == 'V' and amp; C == 'V') misses {Bari = Math Random () * 2; If (turn & gt; = 1) {// since we can not play the next rotation instead: turn ++; Instead of representing the // b, adjust to represent the turn of C.}} and {turn = 2.5; // C is a dead, because one is dead}}} and {// start (0.5) shot = mathematics. RANDOM (); If (shoot and lt; = 0.5) {// C hit if (a == 'V' and B == 'V') {// survive both opponents, down to an = 'x'; // one is dead 'turn = 1.5; // B. Now turn. } And (winner = 'c'; // whatever is the case, the last contestant will be left left}} and {// C if (a == 'V' and B == 'V') Mimes {Bari = Mutt.Random} * 2;} And if (a == 'v') is the dead who dies since the turn of Winner = 'A'; // A is dead; And {turn of turn = 1.5; // b, since one is dead}}}} return winner;}  


    r - S3 Class plot method conflicting with package methods -


    itemprop = "text">

    I have a collection of R scripts that defines an S3 class using different methods, model types and costs Works for large secret places to search. In order to visualize the progress of the search, I have defined some class specific plot methods and I use method remitting to ensure that the classes see the right function, especially, I have plot. There are conspiracy methods defined as fs_forward_model , etc. For example, I also have a file with method remitting tasks, for example, plot = function (x, ...) UseMethod ('plot', x)

    < P> This is all great and this set of my classes works very well in this manner but when I am using glmnet and I want to make a plot of lasso results, then I get an error which is my method The transmission line is generated. Traceback looks like this:

      4 stops ("X" is a list, but the component does not have 'x' and 'y') 3 xy.coords (x, y, xlabel, ylabel , Log) Plot 2. plot (llr) FS_MethodDispatch.R # 14 Plot (llr)  

    caused by my call to cause a plot for the glmnet object originated from

    To ensure that my dispatch does not interfere with others, call glmnet for any suggestions, i.e., llr = glmnet (x, Y, family = 'gaussian') appreciate the package Is.


    c++ - How to use std::enable_if with a condition which itself depends on another condition? -


    I have a situation where I need to differentiate between two overloads, say, foo , std :: enable_if . The condition given to std :: enable_if is automatically dependent on the dependent type of the template parameter of foo .

    What is the best way to express it using std :: enable_if ?

    The following is the test code that I have done so far. I know that in addition to std :: enable_if , there are probably better ways to achieve what I want in the test code. However, the following is a simplified version of my use case, which requires itself std :: enable_if .

      #include & lt; Type_traits & gt; # Include & lt; Cassert & gt; Struct bar {baz = int; }; Template & lt; Class T & gt; Struct is_bar: std :: false_type {}; The template's & lt; & Gt; Straight is_bar & lt; Bars & gt; : Std :: true_type {}; Template & lt; Class bar & gt; Struct baz_type {typing = type name bar :: Falcon; }; Template & lt; Class T & gt; Typename std :: enable_if & lt; Std :: is_integral & lt; Typename baz_type & lt; T & gt; :: type & gt; :: Price, Difference & gt; :: type foo (t x) {return 7; } Template & lt; Square T & gt; Typename std :: enable_if & lt; ! Is_bar & lt; T & gt; :: value, int & gt; :: Type Fu (T x) {return 13; } Int main () {emphasis (foo (bar)) == 7); Emphasis (af (0) == 13); Return 0; }  

    Compiler output:

      $ g ++ --version; Echo; G ++ -std = c ++ 11 repro.cpp g ++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. It's free software; See the source of copying conditions, there is no warranty; Not even for business or fitness for a particular purpose. Repro.cpp: 'struct baz_type & lt; Int & gt; In urgent: repro.cpp: 29: 3: 'template & lt; Class T & gt; Typename std :: enable_if & lt; Std :: is_integral & lt; Typename baz_type & lt; Bars & gt; :: type & gt; :: Price, et & gt; Required from type foo (T) [t = int] [repro.cpp: 49: 3] repro.cpp: 18: 33: error: 'int' is not a class, structure, or union type type Type = Typename bar :: baz;   

    This code does not compile because the first charge of enable_if is used in foo depending on the nested type T Is:: baz . Because int is not of this nested type, the code is illegal.

    What is the correct way to express what I have to express?

    When I wrote down on Colluery, @Op has already shown the important part in its comments What works and what is, IMHO, is quite readable:

      template & lt; Class T, typename = typename std :: enable_if & lt; Is_bar & lt; T & gt; :: value & gt; :: type, typename = typename std :: enable_if & lt; Std :: is_integral & lt; Typename baz_type & lt; T & gt; :: type & gt; :: Price & gt; : Type & gt; Int Fu (T x) {return 7; } Template & lt; Class t, typename = typename name std :: enable_if & lt ;! Is_bar & lt; T & gt; :: value & gt; :: type & gt; Int Fu (T x) {return 13; }  

    With C ++, one can also make it even smaller by using std :: enable_if_t .


    directx - copy protection API for C++ -


    I have some C ++ / DirectX games that I want to start selling from my website. What's the best way to save my game from copy / share? I really do not want to use the classic DRM and the games are not suited for the in-game purchase / freemium model. I think it is the right answer to not disclose the download link after paying the fee by the visitor ... If the DRM is the only way - even if I do not like it - does the light DRM used by other game developers Are the solutions? (Something with minimal protection)

    Thanks!

    It's easy if games are played only online ... only make part of the game calculation on the server , And login, but if you have one-player mode ...

    A good "at least" protection hardware must use fingerprint and a matching HMAC downloaded from the server . When the user transfers the game to a different computer, they have to use their credentials to create a new HMAC. In the game HMAC is not the only private key required for generation, only the public key required for verification will prevent this accidental unauthorized copies, and it is very rare that you can also do about efficient firecrackers.

    This is probably a good idea in which there is a sunset logic, if you close your server someday, you do not want to have any way to restore your paying customers. It is still 3 years after the release, you are seeing significant revenue from the sale. If you are tired of checking the license, you can also issue "updates" with license check at some point in the future.

    For some additional information about why you do not want to participate in the arms race, see my answer to:


    eclipse - Java MDB EJB Project maven depends on Web Project -


    I found an existing web project. Now I need to add an MDB EJB project and he did the same. The EJB project depends on the Meowen Web project

    So far all is well. At the moment, I start using some classes in my MDB web project, it compiles exactly and everything looks fine, but with runtime noClassDefFoundError bombs

    I have my web pom Xml and added this to the configuration configuration

      & lt; Plugin & gt; & Lt; Group & gt; Org.apache.maven.plugins & lt; / Group & gt; & Lt; ArtifactId & gt; Maven War Plugin & lt; / ArtifactId> & Lt; Version & gt; 2.1.1 & lt; / Edition & gt; & Lt; Configuration & gt; & Lt; AttachClasses & gt; True & lt; / AttachClasses & gt;  

    and in my EJB POM

      & lt; Dependency & gt; & Lt; Group & gt; My.group & lt; / Group & gt; & Lt; ArtifactId & gt; My-web-project names & lt; / ArtifactId> & Lt; Version & gt; $ {Project.version} & lt; / Edition & gt; & Lt; Classifier & gt; Classes & lt; / Classifier & gt; & Lt; / Dependencies & gt;  

    How to get classes inside my EJB web project

    I can not really do it in another way because I do not have permission to edit the web project. By default, all server modules use classloaders and web modules may depend on EJB, please help!

    < Ul>
  • If you are on a Java EE6 analog server, you can add your EJB directly to the Web module (the need for a web project change)
  • Remove the normal class from the Web project and Create Java Utility Project. Add that project to the EAR, and the web and the ejbb project depend on it, and the web depends on the ebook (changes in the web also require a change)
  • Single for your entire app Configure the Classloader If your server allows it, then it should resolve your issues.
  • In short, I advise to edit the web project and use one of the two previous solutions, but if you really want to work in the third number solution.


    java - Error running 'webdriver-manager start' on Windows 8.1 -


    After

    I am trying to run an end-to-end test for an angular project using protractor and when I run The following error is being found in the command 'WebDrive Manager Start'

    Enter image details here

    I have run the WebDriver Manager update, and Selenium standalone and chromebreakers are up to date.

    I have Java installed Java-version returns

    Image Details Here Enter

    I too?

    Anyone have any idea how to fix this error

    You can start the web driver as below,

    Java -Dwebdriver. Ie.driver = D: \ Selenium_download_New \ IEDriverServer.exe Jar D: \ Selenium_download_New \ Selenium-server-standalone-2.45.0.jar

    java -Dwebdriver.chrome.driver = D: \ Selenium_download_New \ chromedriver .exe Jar D: \ Selenium_download_New \ selenium-server- standalone-2.45.0.jar

    Protein standalone.jar You can also download standalone.jar


    html - Scroll don't work, if mouse above fixed block -


    I have a problem if Fixed block on my mouse page is blocked from this block My example:

    body overflow: hidden; Padding: 0; Margin: 0; }. An_block {display: block; Status: Completed; Width: 100%; Height: 100%; Background color: # e0e0e0; Hidden flurry; } Menu {display: block; Width: 100px; Height: 200 pixels; Background-color: #FFDDR; Status: fixed; Top: 0; Correct: 0; Z-index: 3; } .content {display: block; Status: Relative; Top: 0; Left: 0; Background color: # a9eceb; Width: 100%; Height: 100%; Z-index: 2; Overflow: scroll; }

    Working here is Bela: here Last CSS:

      body {padding: 0; Margin: 0; }. An_block {display: block; Status: Completed; Width: 100%; Background color: # e0e0e0; Hidden flurry; }. Menuu {display: block; Width: 100px; Height: 200 pixels; Background-color: #FFDDR; Status: fixed; Top: 0; Correct: 0; Z-index: 3; } .content {display: block; Status: Relative; Top: 0; Left: 0; Background color: # a9eceb; Width: 100%; Height: 100%; Z-index: 2; }  

    How to parse `key1:val1,val2,val3,key2:val1,val2` in python? -


    string

    key1: val1, val2, val3, key2: val11, val22 The most efficient way to split:

      key1: ['val1', 'val2', 'val3'] key2: ['val11', 'val22']  < / Pre> 

    thanks

     in  [150]: answer = {} 151]: In pairs for [152]: s.split (','): s = "key1: val1, val2, val3, key2: val11, val22": k, _, v = pair.rpartition (": ") If k: key = k if the key is not in answer: Answer [key] = [] Answer [key] .append (v) .....: in [153]: for k, vals in the north. ['Val1', 'val2', 'val3']  

    How does Google Maps decide when to use a specific icon? -


    I'm using the Google Maps site library to search for nearby hospitals, but it removes results that There are no necessary hospitals (but as a type of hospital). However, I noticed that a hospital icons on the actual hospitals Maps, Google must find a way to see which establishment really that hospitals Does anyone know the public this data Have access to?

    This is the icon I am referring to:

    I'm making examples of the request:

      var request = {location: self .location, radius: 20000, type: ['hospital'], keyword: 'hospital'};  

    The result of the example is not the hospital:

      { "geometry": { "location": { "k": 44.815958, "D": -68.808244}}, "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id": "de6e60bd70b90ba4cb86afe149a60169553607f1", "name": "Penobscot community health" [ "," height ": 320," Html_attributions ": []," width ": 320}]," "" "" "Kholne_achchha": { "open_now": true, "weekday_text": []}, "photos "place_id": "ChIJj - 4INRKrkwRN0z2XkoJtVU", "Rating" 3.1 "model": "CoQBdAAAADmf3YA0659efzMbCSPOK6SZttkfus7aWBDhrZZyX63Szl256BRcpz81LH6rIuONldYv256tsN7Zv-N6ZkOkJadlD2VS01bs7C4ierKvGUMyJOJu657xL5MvidF3Tgs9iejeJcXsxjDJYOwtN3m3sbfClfWYVnnIL4hMLYV8P9TnEhBurfJv_30CAG2wp1V73POVGhR-7fz1mCdh4OYWSa3Pw0mPupckoQ", "scope": "Google", "type": [ "Hospital", "Pharmacy", "" 1012 Union Street, Bangor "," html_attributions ": []}  

    My guess is that there are a few ways to get around there. You can remove the keyword argument from the API, which acts like a search term instead of a specific match in some kind of place, like the type field.

    You may want to be careful about your radius price option.

    After this, if you usually search on Google Maps, you will get a broad classification of results. Do you have to be every result being a real hospital or can you filter your own later?

    If you filter your own then it looks like this type of information and even the icons are embedded. Results JSON You can see the type of results you want and its By filter is a special feature, otherwise, no additional graphical data will be accessible by API.


    how to get meta tags with php, but with html form -


    get_meta_tags ('http://www.autostraddle.com'); The echo is "CMS:"; Echoes $ tag ['generator'];

    This code is not user-friendly; This is not ready for an online tool for my website, because I want to create a simple service - CMS detector and ...

      $ tag = isset ($ _ requests ['url '])? Get_meta_tags ('url'): ''; & Lt; Form action = "index.php" method = "post" & gt; & Lt; Input type = "text" name = "url" size = "65" value = "& lt ;? php echo $ tag ;? gt ;? /> & Lt; Br / & gt; & Lt; Input type = "submit" value = "go!" & Gt; Echo $ tag ['generator'];  

    I want to create an online tool to find out if I have a CMS, but I need this PHP script with HTML form because it will be used by users, and not Only me

    have to keep any URL, and then will act as the script described for getting the Meta tag 'generator'; How do I get the meta tag 'generator'? I only want this meta tag.

    OK, and how to do this with 'if else'? If the Meta Tags Generator does this, but such a tag is not 'Generator', then type any 'echo' message, such as

    CMS is not known.

    Well, this is a simple PHP script, but I do not know how to create variables and get the URL; What is the merit with the CRL?

    What you are struggling with is actually getting user-side input from POST superglobals . It's something you can try, but there are several ways to implement it. You can use method = "SET" and capture user parameters from the URL of the action = "" file.

    Notice, in this case, the verb = "" parameter is empty, that means PHP script will execute on the same page where the HTML form is. It may be that you do not try to do this, so if you need to redirect, add the PHP code to a different file and put it on your website and in the action = "" parameter Add. / P>

      & lt; Form action = "" method = "post" & gt; & Lt; Input type = "text" name = "url" size = "65" placeholder = "http: // yoururl" /> & Lt; Input type = "submit" name = "submit" value = "go!" & Gt; & Lt; / Form & gt; & Lt ;? Php if (isset ($ _ POST ['submit']) {$ tag = get_meta_tags ($ _ POST ['url']); If ($ tag ['generator']) "CMS: & lt; b & gt; $ tag ['generator']" & lt; / P & gt; & Lt; Br> "Else resonance" no CMS information is available. & Lt; Br>  

    Give it a shot.


    r - Annotating individual facets in ggplot2 -


    My apologies if this is a duplicate I have read many posts about the interpretation of individual aspects I my problem is the closest appears But I do not want to be with my data like this, I want to add minimal short font labels to minimum and confidence interval in each side. Any hard work in the right direction would be most appreciated, I'm just rolling with ggplot Thanks a lot.

      Library (ggplot2) library (grid extras) results & lt; -c (1,1,1,2,2,3,3,3) or & lt; -c (1.97,2.47, 3.56,1.73,2.25,4.0 9,1.21,1.48,2.25) minute & lt; -c (1.37,1.74,2.55,1.13,1.52,2.84,0.74,0.95,1.4 9) Maximum & lt; -c (2.83,3.494.98,2.66, 3.35.5.9 1.97,2.33,3.41) Aces and LT; -C (1,2,3,1,2,3,1,2,3) AC & lt; -Data Frame (CBIDand (results, or, minimum, maximum, ACS) AC2 and LT; - Data frame (minimum, maximum, result, aces) AC_lables & lt; - list ('1' = "1 ACE", ' 2 '= "2EE",' 3 '= "3 ACE") Ace_labeller & lt; -function (variable, value) {return (ace_labels [value])} Ace $ Output = Factor (Ace Dollar result, level = c ( "3", "2", "1"), labels = c ( "MH Barrier to Work: model 3", "MH Barrier to Work: model 2", "Depression: model 1")) p & lt; -ggplot (data = ac, aes (x = or, y = outcum, label = geom_point (aes = 8)) + geom_text (size = 5, vj = 1.75) + geom_errorbarh (AES (xmin = min, xmax = max), height = 1) + geom_vline (xintercept = 1, linetype = "dashed") + scale_x_log10 ( Brakes = Sik (1,6,1), name = "odds ratio (ORS) and 95% confidence interval") + Laboratories (y = "") + facet_grid (Equus ~, Labeller = AC_labeler) + Guide (size) = Crop) + theme_bau () + theme (axis .text.y = element_text (size = 12)) + theme (strip.text.y = element_text (size = 12)) + theme (axis.title.x = element_text ( Size = 12, hjust = .5)) #I can get one over there, but I can not figure out how to Packet P + is controlling Anootet ( "Text" label = "1.37", x = 1.37, y = 2.8, size = 4). I get the Data Frame Approach # (which is not exactly at all) AC 2 & lt; -data.frame (cbind (min, result, aces)) P + geom_text (Data = AC2, AES (X = minutes, Y = 2.8, label = minutes, inherit.aes = FALSE)) + facet_grid (Aces ~. )  

    this will add the minimum and maximum values ​​of the interval confidence labels: < / Geo_text (AES (label = max, x = max), vjust = 1.5, size = 4)

    this works because the g Gplot already Avs in your original data frame Required all assume that you've got. You just need to tell geom_text that you want to use the minimum and max values ​​as both text labels and x-axis locations Are there. ggplot takes care of the rest (ie, y- value factor space), because they are already an intrinsic part of the plot, as long as you do not override them.


    javascript - browser capability detection within angular app: use service, directive, controller? -


    If this question is very general or subjective, then let me know and I will know how well the phrase is.

    I am looking to implement some browser compatibility checks and information in an angular application. I'm using the Modernizr which is great, the client does not really want to do a lot in the way of the polyfile, but at least the imagery below allows users with browsers to "upgrade to the real browser" Wants to inform.

    My question is, what is the proper angular component for implementing this, I want to make this inquiry as soon as possible in the page load / compilation process, but still have more confidence in my choice For I'm not an expert with angular, besides, I want to learn the appropriate organization of the angular application so that future programmers do not have to deal with strange mutants. I have cobbed together ...

    image - Is there any way to control the concatenation of the blockproc output? -


    यह प्रश्न का अनुवर्ती है:

    तो कोड का उपयोग करके:

    <प्री> बी = ब्लॉकप्रोक (ए, [1 1], @ब्लॉक_फ़न, 'सीमा आकार', [2 2], 'ट्रिम बॉर्डर', गलत, 'पैडपार्टीअल ब्लॉक', सच) < P> मैं अपनी छवि पर ओवरलैपिंग स्लाइडिंग विंडो बनाने में सक्षम था और प्रत्येक विंडो के लिए dct2 की गणना करता था लेकिन समस्या यह है कि ब्लॉक प्रोक आउटपुट को एक तरह से संसाधित करता है जो मैं उपयोग नहीं कर सकता। उत्पादन बहुत ब्लॉक आकार पर निर्भर करता है और आउटपुट मैट्रिक्स का आकार हर बार इसकी वजह से भिन्न होता है।

    मेरा dct2 फ़ंक्शन एक 1 x 200 प्रत्येक ब्लॉक या विंडो के लिए वेक्टर इसलिए मैंने मान लिया है कि अगर 64 ब्लॉक हैं तो मुझे 64 x 200 या 200 x 64 आउटपुट की तरह कुछ मिलना चाहिए, लेकिन मुझे 64 x 1600 जैसा कुछ मिलता है या बड़े ब्लॉकों के मामले में मुझे 15 x 400 मिलता है।

    इस समस्या को देखने के लिए blockproc फ़ंक्शन को देख रहा है

    < पूर्व> % 4 कोने ब्लॉक ख (1: ul_output_size (1), 1: ul_output_size (2), :) = ul_output; यदि ll_processed last_row_start = final_rows - आकार (ll_output, 1) + 1; Last_row_width = आकार (ll_output, 2); बी (आखिरी __उ_स्टार्टः अंत, 1: अंतिम_रो_विड्थ, :) = ll_output; अंत अगर ur_processed last_col_start = final_cols - आकार (ur_output, 2) + 1; Last_col_height = आकार (ur_output, 1); बी (1: आखिरी ___हॉइट, आखिरी ___स्टार्टः एंड, :) = ur_output; अंत अगर lr_processed last_row_start = final_rows - आकार (ll_output, 1) + 1; Last_col_start = अंतिम_cols - आकार (ur_output, 2) + 1; बी (अंतिम_ओआर_स्टार्टः एंड, आखिरी ___स्टार्टः एंड, :) = एलआर_आउटपुट; अंत में

    जाहिरा तौर पर, ब्लॉकप्रोग आगे वाले ब्लाकों को ऊपरी बाएं, ऊपरी दाएं, निचले बाएं और निचले दायें में विभाजित करता है और परिणामस्वरूप संमिश्रण करता है। और यही कारण है कि मुझे ये सभी मिश्रित आउटपुट मिल रहे हैं।

    प्रत्येक विंडो में प्रत्येक ब्लॉक के प्रत्येक ब्लॉक के आउटपुट की आवश्यकता है I प्रत्येक विंडो को मुझे एक 1x200 आउटपुट देना चाहिए, जिससे कि मैं अपने वर्गीकारक में फ़ीड कर सकूं।

    क्या मैं blockproc के आउटपुट को उस तरीके से बाध्य कर सकता हूँ मुझे यह चाहिए, बस प्रत्येक ब्लॉक का आउटपुट दें।

    यदि नहीं, तो मैं छवि पर ओवरलैपिंग स्लाइडिंग विंडो के लिए वैकल्पिक समाधान की सराहना करता हूं।

    संपादित करें : फ़ंक्शन के अंदर सेल एरे में प्रत्येक ब्लॉक के लिए block_struct.data का उपयोग करके ब्लॉकों डेटा को बचाने के लिए संभव है block_fun और तब निकालने के लिए उस सरणी का उपयोग करें मेरी विशेषताएं?

    धन्यवाद

    संपादित करें:

      B = blockproc (images_m {1}, [64 64] ], 'पैडपार्टीअल ब्लॉक', सही, 'पैडप्रिमेंट', 'ट्रेंडबर्ड', गलत, 'पैडपार्टीअल ब्लॉक', [10 10] ',' प्रतिकृति '); आईएमजी = {}; मैं = 1 के लिए: आकार (बी, 1) जम्मू = 1 के लिए: आकार (बी, 2) tempy = निचोड़ (बी (आई, जे, :)); Tempy2 = reshape (tempy, [84 84]); Feats {end + 1} = block_dct2 (tempy2); % ब्लॉक के लिए dct2 की गणना करता है और एक 1 * 200 वेक्टर अंत का अंत देता है  

    हो सकता है कि नयी आकृतियाँ तीसरे आयाम में आपके डेटा?

      & gt; & gt; ए = जादू (3) ए = 8 1 6 3 5 7 4 9 2 & gt; & gt; बी = ब्लॉकप्रोक (ए, [1 1], @ (एक्स) reshape (x.data (:), [1 1 अंक (x.data)]), 'सीमा आकार', [1 1], 'ट्रिम बॉर्डर', गलत , 'पैडपार्टीअल ब्लॉक', सत्य); & Gt; & gt; Whos बी नाम आकार बाइट वर्ग गुण बी 3x3x9 648 डबल & gt; & gt; निचोड़ (बी (1,1, :)) ans = 0 0 0 0 8 3 0 1 5> और gt;