Posts

ruby on rails - How to avoid ActionController::InvalidCrossOriginRequest exception? -

मैंने Rails 4.1 को अपने रेल ऐप को अपडेट किया है और ActionController :: InvalidCrossOriginRequest अपवाद प्राप्त करना शुरू कर दिया है। मुझे पाया गया कि बिंग बॉट्स सक्रिय रूप से मेरी गतिशील रूप से जेनरेट की गई जावास्क्रिप्ट फाइल को क्रॉल करते हैं। मुझे लगता है कि यह सही है कि रेलवे इस अपवाद को उठाती है क्योंकि जावास्क्रिप्ट को सीधे कहा जाता है, लेकिन मेरा लॉग इस अपवाद के साथ भरा हुआ है। > सीएसआरएफ संरक्षण को बंद किए बिना इस अपवाद को बढ़ाने से बॉट्स से बचने का कोई तरीका क्या है? मेरा नियंत्रक ऐसा दिखता है। वर्ग सूचियाँ नियंत्रक & lt; ApplicationController before_filter: authenticate_user! Def add @list = List.find (params [: आईडी]) response_to do | format | Format.js {render 'add'} format.html {redirect_to list_path (@list)} एंड एंड एंड जेएच के उत्तर में जोड़ने के लिए और मानते हुए कि आपको कुछ सहायता चाहिए, आपको पता होना चाहिए कि हर मेजबान यह निर्धारित करने के लिए उपयोग करता है कि उनके सर्वर का कौन (और नहीं) पहुंच सकता है सीधे आपकी त्रुटि मूल रूप से है क...

Selenium IDE Conditional Statements -

I want to ask if there is another way to see the error label, which has been shown whether we There is no need to fill up with the necessary to use the verifyText command. Here's an example: id: [required] PW: [required] Email: [expected] Dropdown box: [required] If you make test cases, then there is an easy way to make a test case first, and then three error labels will show whether the other fields will not be filled with that. The PW or email from the dropdown box will be shown even if the error is filled with the error label. Before saving that field, I'm just using the verified text, but if there are many conditional requirements like this there is no easy and easy way to create this testcase? Thx If I understand you correctly, If you ignore the required text fields, you are searching for a way to verify that error message. Since I know the Waitfortext command and expect the error message to appear, this command will wait until it expects the err...

linux - How to use dos2unix? -

I am learning perl programming. I have run a Perl script in the Windows platform but I need to run it like a Linux platform like Ubuntu. My script runs entirely in windows but not in Linux. I'm not familiar with the dos2unix tool. I'm struggling to use this in my Windows 7 and how to convert my winfile to unixfile. Suppose that my perl script is test.pl and coding is inside. How do I work correctly using this dos2unix tool in linux? Also, how should I open the dos2unix tool? You should be able to get the dos2unix from your package manager on Linux . If you are using a Debian-based distro, you should be able to do sudo apt-get dos2unix . If you want to be RH-such as distro, you should be able to sudo yum install dos2unix . Once installed, you can only give the target file as an argument ' dos2unix test.pl In addition, note that this can not be the only problem, that you can run Linux while trying to move from Windows to Script. For example, if you ...

c# - How to send bulk email using smtp avoiding spam -

I have a website and I need to send newsletters for around 2 customers. But email to customers in the spam sent. How to remove this problem? Please suggest smtp configuration to avoid spam in any case. I am sending 1) HTML text 2) I use the C # code to send mail 3) Let me address some emails with my domain name for example : Newsletter@mydomain.com as ADDRESS Thank you in advance. Firstly send a test to a service like From there, You can diagnose the report lines with "1.0" or "-0.5" as they are issues that affect your overall score (& gt; 10.0 = spam). This may be a problem with your HTML or how you are setting up your MIME header.

sql - Select count and aggregate, but only unique -

Image
मेरे पास टेबल के साथ एक डाटाबेस (MSSQL) है: बनाएँ तालिका [ डीपीए] [साइप्रर्स] ([टाइम] [डेटाइम] NULL, [होस्टनाम] [वरारार] (50) नल, [क्लाइंटआईपी] [वरारार] (50) नल, [यूजरएजेंट] [वरारार] (550) नल, [साइफर नेम ] [दोहराव] (200) नल, [साइफरवर्सन] [वरचर] (100) नल, [साइफरबिट्स] [वरारार] (50) नल) पर [प्राथमिक] कुछ पंक्तियाँ इस तरह दिख सकते हैं: अब का चयन करें CipherName, CipherVersion, CipherBits, मैं प्रत्येक शीर्ष स्तर डोमेन के लिए CipherName, CipherVersion और CipherBits के संयोजन की घटनाओं की संख्या की गणना करना चाहते हैं। , सीआईपीआरएन नाम, साइफरविर्सियन, साइफरबिट्स द्वारा समूह '% domain.com' समूह की तरह सीपर्स से "हिट्स" के रूप में, "हिट्स", क्रैक्स यह है कि मैं केवल विशिष्ट उदाहरणों की गिनती करना चाहता हूं प्रत्येक ग्राहक आईपी यही है, अगर कोई ग्राहक sub.domain.com और test.domain.com पर गया है तो मैं इसे दो के रूप में नहीं मानना ​​चाहता, बस एक। यह देखते हुए कि आप HostName द्वारा समूह नहीं कर रहे हैं, ऐसा लगता है कि आपकी ज़रूरत है: SE...

html - Website works on Chrome, but not Firefox? -

Therefore, I have a problem; I think it's supposed to be done with HTML or CSS ... I was working on a website template, and ... like .. I will explain the pictures. Chrome: Firefox: Not sure what's going on; Because this is my first website & lt; Html & gt; (at the bottom, ignore 5,000 blockquotes) The problem is that your CSS file is not included on Firefox. This is likely to happen because Firefox is more rigid in parsing its HTML. Just change this line: & lt; Link href = "layout.css" type = "syle / css" rel = "stylesheet" /> gt; To do this: & lt; And it's probably my guess that Chrome will know that you're working with the link href = "layout.css" type = "text / css" rel = "stylesheet" /> Want to point the link to a CSS file but not Firefox

ios - NSJSONSerialization parse error - unrecognized selector -

यह कोड है: NSString * jsonString = @ "[{\" sn \ ": \" ई \ ", \" टी \ ": \" के \ ", \" d \ ": \" मंगल 3-मार्च \ "}, {\" sn \ ": \" F \ ", \ "टी \": \ "वाई 1 \", \ "डी \": \ "मंगल 3-मार्च \"}] "; एनएसडीटा * डेटा = [jsonString डेटाउपकरण एन्कोडिंग: NSUTF8StringEncoding]; NSArray * jsArray = [NSJSONSerialization JSONObjectWithData: डेटा विकल्प: 0 त्रुटि: शून्य]; एनएसएलॉग (@ "जेएसएआरए:% @", जेएसएआरआरए); (जेएसएआरआर में आईडी नौकरी) {एनएसएलॉग (@ "जॉब:% @", जॉब); एनएसएलॉग (@ "% @", [नौकरी एसओ]); } कंसोल में, मुझे यह मिलता है: 2014-04-22 15: 40: 46.464 परीक्षण [2442: 60b] जेएसएआरआरए: ({ D = "मंगल 3-मार्च"; sn = E; t = K;}, {d = "मंगल 3-मार्च"; sn = f; t = "y 1";}) 2014-04-22 15:40 : 46.466 टेस्ट [2442: 60 बी] नौकरी: {d = "मंगल 3-मार्च"; sn = E; टी = के; } - [__ एनएससीएफएप्शन एसआईपी]: अज्...

wpf - shift+click couldn't select correct items with listview -

In my list view, I press ctrl + a to select all the items and select several items with the shift button. But this does not work, I use the keybinding to rewrite all the commands, but how to select multiple items with the shift button? XAML: & lt; ListView VirtualizingPanel.IsVirtualizing = "True" VirtualizingPanel.VirtualizationMode = "Recycling" ItemSource = "{Binding Test List}" SelectionMode = "Extended" & gt; & Lt; ListView.ItemTemplate & gt; & Lt; DataTemplate & gt; & Lt; Text block text = "{binding test content}" /> & Lt; / DataTemplate & gt; & Lt; /ListView.ItemTemplate> & Lt; ListView.InputBindings & gt; & Lt; Key binding command = "{binding selection all command}" modifier = "control" key = "a" /> & Lt; /ListView.InputBindings> & Lt; ListView.ItemContainerStyle & gt; & Lt; Style TargetType = "ListViewItem...

jquery - Events not displayed in fullcalendar js -

Please help someone figure out what's wrong with the code. I used fullcalendar.js for the calendar event. I want to show the event in the calendar. Below is my code. $ (document) .ready (function () {$ (window). reset (function () {$ ('# calendar'). fullCalendar ('option', 'height' get_calendar_height ());}); var date = new date (); var d = date.getDate (); var m = date.getMonth (); var y = date.getFullYear (); var navent = []; nevent = document.getElementById ('& lt;% = hdnevent.ClientID%';); value; // alerts (nevent); var calendar = $ ('# calendar'). FullCalendar ({Subject: true, title: {left: 'prev, next today', center: 'title', right: 'month, agendaWeek, agendaDay', width: get_calendar_width}, width: get_calendar_width, height: 480, select: right, selectHelper: true, slots min: 15 , All data default: false, // events: 'JasonRespons.Shex', events: navent});}); nevent is the value: [{id: ...

python - Replacing value in dictionary -

I'm not sure how to change the value of a dictionary with the second value I b Value should be replaced with the value of a and the value of c should be replaced by the value of the code (which is a is the value of). For d_values ​​for d_keys in : my_dict = {"a": 1, "b": "a", "My_dict.keys ()": if d_values ​​in d_values: My_dict [d_keys] = d_values ​​ I need my_dict to become {a: 1, b: 1, c: 1} , but my code gives me {a: a ....} with somewhere line I think you are more confused, depending on your requirement, just what you want > gt; & gt; therefore values Instead of changing, '' one ': 1,' C ': 1,' B ': 1} dict.fromkeys (my_dict, my_dict, same ku Rebuild the entire dictionary with the capital structure, but with the value my_dict ['a']

Codeigniter:Not found error -

I'm the start of the codeigniter. I have created a project called 'Administration' in Codeigniter. It has a login page named login.php which is in View / login.php. The login controller, which is set as the base controller for the admins controller, looks like this: CI_Controller {class in the class login} {public function index () {$ data ['msg'] = '' ; $ This- & gt; Load-> View ('Login', $ data); } Public Function User Login () {$ this-> form_validation- & gt; set_rules ('uname', 'username', 'required'); $ This- & gt; form_validation- & gt; set_rules ('login_password', 'password', 'required'); $ Msg = $ this- & gt; Login_model- & gt; Get_login (); If ($ this-> form_validation-> run () === incorrect) {$ data ['msg'] = ''; $ This- & gt; Load-> View ('Login', $ data); } And if ($ msg == 0) {$ data ['msg'] = 'Username an...

c - How do I know which exec command to use for a specific program? -

My question is about the ADF family of C system calls. How do I guess what type of program I am implementing, since then, the exec family has a different way between arg1, arg2, arg3 ... and its 2d char array for its parameters I see. Can most Linux command line programs handle both forms of input? For example: int execl (const char * path, const char * arg0, ... / *, (four *) 0 * /); Intimate Exec (Constant Charles * Path, Four * Cost Agg []); What will happen if I execute the LS: execl ('/ bin / ls', 'ls', NULL); versus: execv ('/ bin / ls', lsArgsArray); Probably LS can handle both forms of input, but my actual question is generally general about other utilities, it is safe to believe that you can tell them in any way? If it is not safe to invoke any method, how does it happen, as if it is different to use besesh? The program executed, or the kernel, does not matter to whatever you say: both of them Has changed from your C library to...

javascript - Different styles for text and elements inside another element -

I am trying to style the pager of the WebGrid element in ASP.Net MVC. The pager looks like this: However, I can easily style a elements, I'm having trouble styling the "untagged" text (in this example, 2 ). Is there a way that I can target / target, not just text and anchor elements? (Provided) I am not aware of a CSS selector which can target text nodes . You can use JavaScript or jQuery to wrap an active link of a tag; So this style is an example here: $ (".pagination"). material (). Filter (function () {this.nodeType === node.TATXADNADA & amp; / \ / d + /.test(this.nodeValue);}). Rap ("& lt; b & gt; & lt; / b & gt;");

Magento CSS/JS not loading after upgrade to 1.8.1 -

I have upgraded my Magento site from 1.6 to 1.8.1 yet. After updating the website is unable to load CSS and JS. I checked the error log and say this: [Tuesday April 22 16: 40: 30.616082 2014] [Original: crit] [PID 27847: TID 140041728800512] (13) Permission denied [customer 60.240.167.112:59507] AH00529: /home/strictly/public_html/js/.htaccess pcfg_openfile: To check the htaccess file, it is readable and that '/ home / strict / Public_html / js / 'is executable, ​​ I followed the advice of many people and did the following: var / cache folder Web / Unsafe / base_url and Both dev / js / merge_files and dev / css / merge_css_files 0 P> This site loads very slowly, and when it loads, it is not CSS and JS. I inspect Chrome's Elements button and check the back-functioning of using the I fail to load CSS and JS files, each 404 can not see the error not found. My guess is that it has been set to right with permission for JS and CSS folders / files. Does...

jsf 2 - Sending "Authentication Required Message" when not authenticated and "Session has expired" when session is timed out -

I am working with the login filter and have successfully implemented them Also, It needs to show that if someone tries to see a page, I just need to show an error message, "authentication required". Error message like "Session has expired" after the session expired, implementation for later (as suggested by everyone), login or index to use filters. Redirecting xhmtm , Is over. But I thought of showing an error message. Any help? Thanks in advance See my answer here: Instead of using Flash or Session Area, in your case You should use the URL parameter to see that it should add a FacesMessage to @PostConstruct You can insert in your bean: @PostConstruct public Zero init () {string ShowMessage = FacesContext.getCurrentInstance (). GetExternalContext (). GetRequestParameterMap (). Get ("showMessage"); If ("Truth". Acquires (Show Message)) {FacesContext.getCurrentInstance () AddMessage (empty, new FacesMessage (FacesMessage.SEVERITY_...

(C++) If - Else if statements for a CommandLine rock paper scissors game -

I'm quite new to C ++ but I'm reading a lot of documents and I do not know what's here Used to be. If I have made statements on other things, but maybe this is just a brain fart, I really do not know when I type "1" when he asks for input and I enter and it goes straight to the Else statement #include & lt; Cstdlib & gt; # Include & lt; Iostream & gt; # Include & lt; Sstream & gt; #include & lt; String & gt; using namespace std; Int main () {four choices; Int P2 = 2; Int R1 = 1; Int s3 = 3; // question cout & lt; & Lt; "Let's Rock Paper Scissors" and Lieutenant; & Lt; Andal; Cout & lt; & Lt; "(Use Letter) Rock (1) - Paper (2) - Scissors (3)" & lt; & Lt; Endl; Que: cout & lt; & Lt; "What is your choice ?:"; Cin & gt; & Gt; the option; If (like == p1) {cout & lt; & Lt; "You choose rock" & lt; & Lt; Endl;} and if (like == p2)...

mysql - Field naming basics -

I am new to MySQL and want to drag / show a field that contains a place I thought the following Syntax will work - but I have been given an error code of 1054: SELECT [record ID] to testDB.all; Try using Backlit: IDD to testDB.all ; Side note: Back tiles are being used for table and column identifier, but only when the identifier is a MySQL reserved keyword , Or when the identifier contains white space or characters outside of a limited set, it is often recommended to avoid column or table identifiers to avoid the quoted problem while using reserved keywords. P> Back Tix status requires the following: SELECT id, 'my name', 'other field', 'field, with, comma '

mongodb - Mongo DB error: invalid operator: $search when doing $text search -

मैंने इसके साथ एक सूचक बनाया है: db.MyCollection.ensureIndex ({ "फ़ील्ड 1": "टेक्स्ट"}) और मैं निम्नलिखित को रोबोमोंगो में चला रहा हूं: db.MyCollection.find ({$ text: {$ search: "something"}}) और इस त्रुटि को वापस पाने के लिए: त्रुटि: {"$ err": "अमान्य ऑपरेटर: $ खोज "," कोड ": 10068} डॉक्स बहुत स्पष्ट लग रहे हैं कि मैं सही सिंटैक्स का उपयोग कर रहा हूं:। मैं मोंगो संस्करण 2.4.9 का उपयोग कर रहा हूँ। किसी को भी पता है कि समस्या यहाँ क्या हो सकती है? मुंगो 2.6+ $ text इस प्रकार से कार्य करता है: db.collection.insert ({desc: "यह पाठ के साथ एक स्ट्रिंग है"}); Db.collection.insert ({desc: "यह टेक्स्ट के साथ एक और स्ट्रिंग है"}); Db.collection.insert ({desc: "यह ext के साथ एक अन्य स्ट्रिंग है"}); db.collection.ensureIndex ({ "desc": "पाठ"}); Db.collection.find ({$ text: {$ खोज: "टेक्स्ट"}}); यह आउटपुट को निम्न के रूप में देगा: {"_id...

In python, how do I create two index slicing for my own matrix class? -

I'm trying to write my own matrix class in Python, in fact, for testing purposes this matrix class Is in C ++ and I am using SWIG to interface between two. However, for this question, it may be easy to consider the pure Python implementation of the matrix class. I want to be able to call this matrix class and want to use two-indexed slicing action. For example, after we created 4x4 matrix of people, & gt; & Gt; & Gt; A = matrix (4,4,1) I want to be able to get sub2x2 matrix: & gt; & Gt; & Gt; A [1: 2,1: 2] I have heard about the code Hollis __ , but it seems that this only allows for single skiing Gives, e.g. One [1: 2] . How can I do a two-index skiing so that I can call A [i: j, l: k] ? Thank you! Note that __ getslice __ dislikes so consider the following minimum example Do: square fu: def __getitem __ (auto, * args): print args f = foo () f [1: 2,2: 4] It will print: ((piece (1, 2, none), piece (2, 4, none)), If ...

java - How to handle network state and HTTP status codes correctly -

Within one method, I am sending GET and POST requests using HttpURLConnection. As you can see in the example code, I am holding most exceptions. But I wonder if this is the right way and how should I actually manage a site like "no network is available" and bad status code in response to the server? I ask because of this because I want to inform the user about various problems. Public static bitmap getImage (string url) {HttpURLConnection conn = null; {URL new URL} Try new URL (URL); Conn = (HttpURLConnection) newUrl.openConnection (); Conn.setDoInput (true); Conn.setDoOutput (wrong); Conn.setUseCaches (wrong); Conn.setRequestProperty ("Accept-Charset", "utf-8"); Conn.setRequestProperty ("content type", "image / PNG"); Conn.setRequestMethod ("GET"); Conn.connect (); Int total = conn.getContentLength (); InputStream = conn.getInputStream (); // ... read the image here! } Catch (malmarmdureleuxation E) {e.printStackTrace ...