Posts

sql - How would I do this JOIN in Rails? -

यहाँ मेरा एसक्यूएल कथन है: SELECT * से 'message_users' LEFT JOIN 'messages` पर message_users.message_id = messages.id WHERE (message_users.user_id = 1 और message_users.hidden = 0) और message_users.last_read_at & gt; Messages.updated_at ORDER BY messages.updated_at DESC LIMIT 0, 20 मैं उचित रेल के साथ उस बंद कैसे खींचूँगा / शामिल / जो कुछ भी हो? आप आम तौर पर कई तालिकाओं से सभी डेटा को रेल में एक मॉडल में लोड नहीं करते हैं। शामिल हो को शामिल करें से बदलकर अधिक सामान्य है, जो संबंधित मॉडल को प्रीलोड करेगा ताकि आप message.message_users को कॉल करते समय कैश को दबाएंगे। संदेश और संदेश_युजर्स के बीच कोई स्तंभ नाम संघर्ष नहीं है, किसी भी दर पर, यह आपके एसक्यूएल क्या कर रहा था डुप्लिकेट चाहिए। यदि आप क्वेरी के बाद messages_users से डेटा की आवश्यकता नहीं है, आप चयन करें खंड निकाल सकते हैं। Message.find (: सभी,: joins =>: Message_users,: select => "message_users। *, संदेश। *",: Conditions => ['message_users.user_id =? और messag...

MODx removing content resource field -

How do I hide the content processing field from non-administrator users? So you want a user to change the document fields such as title, alias etc. Yes, but not content? You can not remove individual fields from the admin user (as far as I know). You can either lock the whole page / resource or you can put content that you want to lock in the template for that document and lock the template only to the admin user who will get the same effect . Be sure that you do not have a reference to [+ content +] in the template, and even if the user enters the document contents, then this page will not affect.

Unix C++ simple server question: sending data back to browser -

I have written in a simple Unix server C ++ which just waits for an incoming connection, and then when a connection If installed, sends the requested data to display in the customer's browser. I have everything except work to send the data to the customer. I started the server and set the port number (for this example I have 8181 I will use it). The client opens the browser and connects to my server and tries to retrieve test.txt to see. The server accepts incoming connections. Checks to see whether the file exists or not. If the file exists, then it sends the file to the browser. My problem is that I am not sure how the data can be sent back to the browser. I am trying to use Unix system calls to accomplish this, because I believe everyone needs to get back the data. Now what I am doing, put the file in a four array buffer and then it is fed into writing (socket id, buffer, strollon (buffer)). When I check it, the server gets the file correctly and reads ...

.net - jquery ajax error cannot find url outside of debug mode -

I used some jquery.ajax method to connect to a .NET web service that I received some code two weeks ago Has been doing. Here the code snippet is causing me trouble ... if (MSCour.AppSettings.OFFLINE! == 'TRUE') {$ .ajax ({url: url, data: json, Type: "Post", Content Type: "Application / Jason", Timeout: 10000, Datatype: "Jason", // No "Jason" We will parse the success: Function {race} {if (! Callback) {return; } / * // *** Use the JSN Library so that we can fix MS AJX dates * / var results = "" if (RAS! == "") {try {result = $ .valvalJSON (res); } (E) {Results = {}; bare = true;}} / * // *** The bare message is the result * / If (bare) {callback (result); return;} / * // *** top-tier object node in wrapped message / *** strip it off * / for (different attributes in result) {callback ( Result (properties); break;}}, error: function (xhr, position, error) {if (position === 'parsererror') {} else {return err...

c# - Tips for creating an admin login for a client's website -

I am making a website for a real estate firm. Looks great, but the last factor is to create an admin login for my clients so that they add and remove real estate properties, and that they want to sell. I am planning to store my entries in the database file. Entries will be displayed on a public page on a public page, which will be bound to DB. How can I log in to an ASP.NET 3.5 website? I do not know PHP yet [and] I have read some MSDN content on making roles. Members and it seems that I just want an administrator login for my client. "Itemprop =" text "> If you create a subscription provider, you can use standard login controls that are included in the toolbox! Check it out: And this: Then, this Check: How to use login controls.

java - Element not recognized on page until a manual click on the page occurs -

I am looking for an element on a web page using my xpath. Xpath is correct and the element can be found only if I manually click on the page for the first time if I do not do this before the statement, then it will not get the element. I have tried many attempts to focus on the page: selenium.selectWindow (null); Selenium.firivant (xpath, "focus"); Selenium.Click (element on page); Selenium.mouseDown (); Selenium.mouseUp (); After completing these tasks, the statement will still not be able to find the element, but if I maximize the page manually and click anywhere on the page, then say the statement The element is found. Can anyone help me with this? I am using this element to find: selenium.isElementPresent ("// div [@ class = 'sample_class']"); Thanks! Instead of using XPath, the CSS selector for that item. Use selenium.isElementPresent ("css = div.sample_class"); as your selector. Saucelabs explained this very well o...

Does anyone know how to generate on the fly page that contain iframe of specific site That his address appears after the main site address? -

Does anyone know how to generate on the fly page that has a special site's iframe, which addresses its main site address Appears after? sample = "post-text" itemprop = "text"> Check it: You can replace src = "http: //url.to/page " with src =" & lt;? Echo $ _GET ['link']? & Gt;; "